CloseLand is a NFT marketplace platform where users can create, buy and trade NFT. The project was completed as part of Rocket Academy Project 5 for 2 weeks.
The technology stack used for our project are as follow:
Frontend
- React.js
Backend
- Express
- PostgreSQL/Prisma
Smart Contract & Blockchain Development
- Solidity/OpenZeppelin
- Ethers.js/Hardhat
- Metamask
Links to Repositories
Launch app order Clone and launch the app in the following order:
- Backend
- Smart Contract
- Frontend
Backend Steps
- NPM / Yarn Install
- Setup .env file with the following:
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE"
FRONTEND_URL = 'http://localhost:3000'
PORT = 3004
// Example for no password:
// DATABASE_URL="postgresql://username@localhost:5432/nft_backend"
-
Run command
npx prisma migrate dev --name initto create Database and Tables. -
Run command
nodemon index.jsto start backend server. Keep this running.
Smart Contract Steps
- NPM / Yarn Install
- Run command
npx hardhat nodeto deploy local blockchain. Keep this running. Take note of the 20 dummy accounts created to be incorporated into the metamask section - Run command
npx hardhat run --network localhost scripts/deploy.jsto deploy smart contract into our local blockchain. Take note of the deployed MarketListing address and NFT address - checked against Frontend (Step 3 below) - An artifacts folder will be created. Copy
artifacts/contracts/MarketPlace.sol/Marketplace.json&artifacts/contracts/NFT.sol/NFT.jsoninto Frontend step 2 below.
Frontend Steps
- NPM / Yarn Install
- Copy the 2 files in Smart Contracts(Step 4) above into
src/contracts/folder. Replaced the existing files. - Double check
src/contracts/addressSetting.jsaddress are the same address with Smart Contract (Step 3) above. - Head to pinata.cloud to setup an account to obtain the PINATA API KEY & PINATA API SECRET. Setup .env file with the following:
REACT_APP_PINATA_KEY='YOUR_PINATA_KEY'
REACT_APP_PINATA_SECRET='YOUR_PINATA_SECRET'
- Run command
npm run startto launch the app.
MetaMask
- Guide to create metamask and connect to localhost.
- Connect your metamask wallet to localhost with the following config:
Network Name: Hardhat
New RPC URL: http://localhost:8545
Chain ID: 1337
- In metamask, select the option to "Import Account" and paste the private keys of one of those accounts (in Smart Contract - step 2) from the local hardhat node - to connect metamask to that account in order to use it.
- Start creating and trading your NFT on the website!