A complete decentralized application for minting NFTs with metadata. This project includes a smart contract, backend service, and frontend interface.
contracts/: Solidity smart contractsscripts/: Deployment scriptsdatabase/: Database setupbackend/: Metadata and minting status servicefrontend/: Next.js frontend application
- ERC-721 NFT smart contract with:
- Minting with metadata
- Access control
- Mint limit per address
- Pausable minting
- Maximum supply
- Backend service with:
- Metadata storage and retrieval
- Minting statistics
- Rate limiting
- Input validation
- Frontend interface with:
- Wallet integration
- NFT minting form
- NFT gallery
- Minting status display
- Transaction history/ Transaction Details
- Node.js (v18+)
- npm
- Hardhat
- MetaMask or another Ethereum wallet
-
Install dependencies:
npm install
-
Compile the smart contract:
npx hardhat compile
-
Run tests:
npx hardhat test -
Deploy to a local network:
npx hardhat node npx hardhat run scripts/deploy.ts --network localhost
-
Run smart contract tests:
npx hardhat test -
Deploy to local Hardhat node:
# Start a local Hardhat node in a separate terminal npx hardhat node # Deploy the contract to the local network npx hardhat run scripts/deploy.ts --network localhost
-
Solidity documentation available at here
-
Navigate to the database directory:
cd database -
Docker Compose Setup:
docker-compose up -d
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Set up environment variables:
# Create a .env file with the following content: DATABASE_URL=mongodb://admin:admin@localhost:27017/nft-minting-app DATABASE_USER=admin DATABASE_PASSWORD=admin PORT=5000 CONTRACT_ADDRESS="0x5FbDB2315678afecb367f032d93F642f64180aa3" #Replace with your deployed contract address RPC_URL="http://127.0.0.1:8545" FAUCET_PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
Note: You can not change CONTRACT_ADDRESS if firstly deploy contract in hardhat node. The address was same.
-
Start the development server:
npm run dev
-
The API Documentation will be available at
http://localhost:5000/api/docs
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Set up environment variables:
# Create a .env.local file with the following content: NEXT_PUBLIC_CONTRACT_ADDRESS="0x5FbDB2315678afecb367f032d93F642f64180aa3" #Replace with your deployed contract address NEXT_PUBLIC_API_URL="http://localhost:5000/api"
Note: You can not change CONTRACT_ADDRESS if firstly deploy contract in hardhat node. The address was same.
-
Start the development server:
npm run dev
-
The frontend will be available at
http://localhost:3000
- The smart contract implements access control to restrict admin functions
- Input validation is used throughout the application
- Rate limiting is implemented on the backend
- The frontend validates user input before submission