This project was done by:
- Danilo Corsi (matr. 1742375)
- Alessio Lucciola (matr. 1823638)
- Domiziano Scarcelli (matr. 1872664)
COMPLETE.1.mp4
Install the dependencies with npm install (both in the frontend and backend folder)
If you have some dependency problems, simply delete node_modules and package-lock.json from frontend and backend folders and execute the command again.
- Connect metamask to localhost network
A local blockchain will be created at the "http://127.0.0.1:8545" address.
npx hardhat node
-
Create a
.envfile in the root directory, follwing the content inside theenv.templatefile. -
Start docker
docker compose upIf you change the schema.prisma, you can update it by executing the command:
npx prisma migrate dev --name init⚠️ If you get any error related toprismadonpx prisma migrate deploy npx prisma generate
-
Compile smart contracts by executing:
npx hardhat compile --force -
Deploy smart contract
npx hardhat run ./scripts/deploy.ts --network localhost -
Copy the contract address into the
.envfile -
Copy the
SmartSupply.jsonfrombackend\artifacts\contracts\SmartSupply.solfolder tofrontend\src\assets\abi
- If you want to interact with the db via a browser, start
npx prisma studio
-
Install package
npm install -
Run frontend
npm run dev