This project consists of a backend, frontend, and subgraph to create a comprehensive NFT marketplace ecosystem. Users can mint, list, buy, and sell NFTs seamlessly.
- Backend: Smart contracts written in Solidity with a Hardhat setup.
- Frontend: Next.js application for interaction with the smart contracts and IPFS.
- Subgraph: Subgraph using The Graph to gather blockchain data.
- Mint NFTs: Create new NFTs and add them to your collection.
- List NFTs: List your NFTs for sale in the marketplace.
- Buy NFTs: Purchase listed NFTs from other users.
- Cancel Listings: Cancel your NFT listings.
Follow the setup instructions in each of the subdirectories in this order: backend
, subgraph
, and frontend
.
Jan-Cibulka-NFT-Marketplace.mp4
Check out the instructions in each subdirectory (backend
, subgraph
, and frontend
) for more details.
If you want to change anything in the contract backend/contracts/NftMarketplaceV2.sol
, you have to follow these steps:
$ cd backend
- Update the contract
$ bunx hardhat deploy --network sepolia --contract NftMarketplaceV2
- Copy the contract's deployed address to:
frontend/utils/deployedContracts.ts
and tosubgraph/subgraph.yaml
- Copy the whole file from
backend/artifacts/contracts/NftMarketplaceV2.sol/NftMarketplaceV2.json
tofrontend/contracts
- Copy just the ABI array from
backend/artifacts/contracts/NftMarketplaceV2.sol/NftMarketplaceV2.json
tosubgraph/abis/NftMarketplaceV2.json
$ cd ../frontend
$ bun run compile-contract-types
$ cd ../subgraph
$ graph codegen
$ graph build
$ graph deploy --studio <YOUR_SUBGRAPH_NAME>
- Update the
graphUrl
infrontend/utils/util.ts
- Update the
NftCollection.sol
contract inbackend/contracts
. - Run
$ npx hardhat compile
. - Copy the artifact from
backend/artifacts/contracts/NftCollection.sol/NftCollection.json
to the frontend here:frontend/contracts/NftCollection.json
. - Copy just the ABI from the artifact from
backend/artifacts/contracts/NftCollection.sol/NftCollection.json
to the Graph here:subgraph/abis/NftCollection.json
. - Run
$ npm run compile-contract-types
in the frontend.