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
.env
file in the root directory, follwing the content inside theenv.template
file. -
Start docker
docker compose up
If 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 toprisma
donpx 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
.env
file -
Copy the
SmartSupply.json
frombackend\artifacts\contracts\SmartSupply.sol
folder 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