A pixel art NFT marketplace on the Ethereum blockchain. Create, mint, buy and sell NFTs on the Ropsten Testnet.
Clone this repository and install pnpm.
npm i -g pnpm
Make a .env
file in the root of the repository. Refer to .env.example for the environment variables required for the project. You need to set up two things to run the client:
-
A postgreSQL database. You could set up a free one on Heroku. Set the value of
DATABASE_URL
as the url of the hosted database. -
A free Pinata account. Pinata stores all the NFT images and metadata. Create an account, generate an API key and set the values of
PINATA_API_KEY
andPINATA_API_SECRET
respectively.
To run the development server:
# install dependencies
pnpm install
# run the dev server
pnpm dev
The hardhat
directory contains all the code pertaining to the smart contracts. If you wish to play around with the smart contract code, refer to NFT.sol. Before you compile and deploy the smart contract, make a .env
file in the hardhat
directory. You need to set up two things:
-
A free Alchemy account. The project uses Alchemy to interact with the Ropsten network and deploy contracts. Create an account on Alchemy, create a new project on the Ropsten network and set the value of
ALCHEMY_API_URL
as the alchemy project url. If you're stuck at this part, refer to this guide. -
A MetaMask account. Your Ethereum account's private key is required to compile the contract using Hardhat. Set the value of
PRIVATE_KEY
.
To compile and deploy the smart contracts:
# install dependencies
pnpm install
# compile the contract
pnpm compile
# deploy the contract
pnpm deploy
The pnpm deploy
command should log something like this on the console:
Contract deployed to address: 0x1d2Cc2e0D387A04aD5111ee9Fd391110ddA0976F
Make sure to change NEXT_PUBLIC_CONTRACT_ADDRESS
in .env to the address of the newly deployed contract.