Skip to content

tecno04/PFM2_Master_Blockchain_Dapp_Ethereum

Repository files navigation

Logistic Trazability - Trazabilidad Logistica Inmutable

Spanish
Este proyecto fue desarrollado como proyecto académico para un Master de Blockchain Engineer y también fue un proyecto final entregable para CodeCrypto de finalización de primer ciclo, en donde se establece desarrollar una dapp para (el caso elegido) poder visualizar y auditar la trazabilidad de productos, logrando la transparencia e inmutabilidad en blockchain para el mismo. Para lograr este cometido, se realiza a través del siguiente stack:

  • React 19.2
  • NestJS (Backend)
  • Docker (Dockerización PostegreSQL)
  • Shadcn / TailwindCSS
  • Zustand
  • React-Query
  • axios (Peticiones HTTP)
  • Foundry (para desarrollo y testing de smart contract)

Actualmente la carpeta LogisticTrazability queda preparada para funcionar como monorepo liviano:

  • dapp-trazability/ => frontend React/Vite
  • logistic-backend/ => backend NestJS
  • raíz => contratos Foundry, documentación y scripts compartidos

Licencia de uso: Este proyecto se distribuye únicamente para fines académicos, de estudio, revisión y referencia técnica. No se permite su uso comercial. Ver LICENSE.md.

Para poder testear y probar esta dapp es necesario seguir los siguientes pasos:

  1. Clonar Repositorio: bash git clone <URL_GITLAB>

  2. Instalar dependencias del monorepo desde la raíz (recomendado con pnpm): bash pnpm install -r

  3. Si prefieres instalar por paquete, todavía puedes hacerlo entrando a dapp-trazability/ o logistic-backend/.

  4. Si no tienes docker instalado o descargado, procede primero a ésto, y, luego, procede a realizar: bash docker compose up -d

  5. Renombra en archivo .env.template a .env

  6. Descargar e instalar foundry (si es que no lo tienes instalado) para poder desplegar los contratos con el script o verificar los test:

    • Descargar foundry en tu PC: bash curl -L https://foundry.paradigm.xyz | bash
    • Instalar foundry: bash foundryup
    • Desplegar Contratos con el script: bash forge script script/Deploy.s.sol --rpc-url http://127.0.0.1:8545 --private-key <PRIVATE_KEY> --broadcast
    • Una vez desplegado, te mostrará por CLI, las direcciones de los contratos desplegados, copiar esas direcciones y pegarlas en el .env
    • Si deseas usarlo con Ganache u otra blockchain, deberas cambiar la url RPC para poder desplegarlo.
    • Si, quieres, ejecutar los test, debes ejecutar: bash forge test -vv
  7. Inicia el backend desde la raíz: bash pnpm dev:backend

  8. Inicia el frontend desde la raíz: bash pnpm dev:frontend

  9. Recuerda tener alguna billetera instalada en el navegador como MetaMask ó Rabitt Wallet y configurada con la red blockchain donde desplegues los smart contract.

  10. Accede a http://localhost:5173 ó http://localhost:4123 (dependiendo como hayas ejecutado el frontend) para poder acceder y probar la plataforma.

English
This project was developed as an academic project for a Master in Blockchain Engineer and was also delivered as a final project for CodeCrypto at the end of the first cycle, focused on building a dapp to visualize and audit product traceability, achieving transparency and immutability in blockchain for the same. To achieve this task, it is done through the following stack: *React 19.2

  • NestJS (Backend)
  • Docker (PostegreSQL Dockerization) *Shadcn/TailwindCSS
  • Zustand
  • React-Query
  • axios (HTTP Requests)
  • Foundry (for smart contract development and testing)

This folder is now prepared to work as a lightweight monorepo:

  • dapp-trazability/ => React/Vite frontend
  • logistic-backend/ => NestJS backend
  • root => Foundry contracts, docs, and shared scripts

License: This project is distributed exclusively for academic, study, review, and technical reference purposes. Commercial use is not permitted. See LICENSE.md.

In order to test and test this dapp, it is necessary to follow the following steps:

  1. Clone Repository: bash git clone <URL_GITLAB>

  2. Install monorepo dependencies from the root (recommended with pnpm): bash pnpm install -r

  3. If you prefer, you can still install dependencies package-by-package inside dapp-trazability/ or logistic-backend/.

  4. If you do not have docker installed or downloaded, proceed to this first, and then proceed to do: bash docker compose up -d

  5. Rename the file .env.template to .env

  6. Download and install foundry (if you do not have it installed) to be able to deploy the contracts with the script or verify the tests:

    • Download foundry on your PC: bash curl -L https://foundry.paradigm.xyz | bash
    • Install foundry: bash foundryup
    • Deploy Contracts with the script: bash forge script script/Deploy.s.sol --rpc-url http://127.0.0.1:8545 --private-key <PRIVATE_KEY> --broadcast
    • Once deployed, it will show you through CLI, the addresses of the deployed contracts, copy those addresses and paste them in the .env
    • If you want to use it with Ganache or another blockchain, you will have to change the RPC url to be able to deploy it.
    • If you want to run the tests, you must run: bash forge test -vv
  7. Start the backend from the repository root: bash pnpm dev:backend

  8. Start the frontend from the repository root: bash pnpm dev:frontend

  9. Remember to have a wallet installed in the browser such as MetaMask or Rabitt Wallet and configured with the blockchain network where you deploy smart contracts.

  10. Access http://localhost:5173 or http://localhost:4123 (depending on how you have run the frontend) to access and test the platform.

About

Dapp Proyect PFM 1 - Dapp que demuestra un proyecto que cumple con unos requisistos solicitados para la demostración de como implementar un sistema web en Solana para la trazabilidad y transparencia de registros en la blockchain -- Aplicado para Ethereum

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors