# NFT Marketplace
A **full-stack decentralized application (dApp)** for minting, buying, selling, and managing NFTs and collections on the blockchain.
## Architecture
This project consists of three interconnected components:
- **Smart Contracts** — Solidity contracts managed with Foundry for NFT operations
- **Backend API** — Node.js/Express server with PostgreSQL and IPFS integration
- **Frontend** — React + Vite dApp with wallet connectivity
## Table of Contents
- [Features](#features)
- [How It Works](#how-it-works)
- [Project Structure](#project-structure)
- [Getting Started](#getting-started)
- [Smart Contracts](#smart-contracts)
- [Backend API](#backend-api)
- [Frontend](#frontend)
- [Security](#security)
- [What Makes Us Different](#what-makes-us-different)
- [License](#license)
## Features
### User Management
- Register with email, wallet address, and username
- Secure wallet-based authentication via MetaMask or WalletConnect
### NFT Operations
- Upload images and metadata stored on IPFS
- Mint NFTs with on-chain verification
- Create and manage NFT collections
- List NFTs for direct sale or auction
- Secure on-chain ownership transfers
### Marketplace
- Browse trending and new collections
- Purchase NFTs using cryptocurrency
- Real-time price tracking and analytics
- User transaction history
### Administration
- User and NFT management dashboard
- Fraud detection and reporting
- Marketplace analytics and insights
## How It Works
### User Onboarding
Users sign up by connecting their wallet and providing basic information. The backend verifies wallet ownership through signature verification.
### Minting Process
1. Upload file to IPFS and receive content hash
2. Store metadata in PostgreSQL database
3. Trigger smart contract to mint NFT on-chain
4. Sync blockchain state with backend
### Trading Flow
1. Owners list NFTs with price or auction parameters
2. Buyers initiate purchase with cryptocurrency
3. Smart contract handles ownership transfer
4. Backend synchronizes with blockchain events
### Event Synchronization
The backend continuously listens to blockchain events (`Transfer`, `Minted`) to maintain data consistency between on-chain and off-chain states.
## Project Structure
nft_marketplace/ ├── frontend/ # React web application ├── nft_contract/ # Solidity smart contracts ├── nft-marketplace-api/ # Node.js backend API └── README.md
## Getting Started
### Prerequisites
- Node.js v18 or higher
- npm or yarn
- Foundry (Solidity development)
- PostgreSQL database
- IPFS node or pinning service (Pinata, NFT.Storage)
- MetaMask or compatible Web3 wallet
### Installation
Clone the repository:
```sh
git clone <repo-url>
cd nft_marketplace
Install dependencies for each component:
# Frontend
cd frontend && npm install
# Backend
cd ../nft-marketplace-api && npm install
# Smart Contracts
cd ../nft_contract && foundryupCreate .env files in each subdirectory by copying .env.example and adding your credentials (database URL, API keys, IPFS credentials, etc.).
# Start backend API
cd nft-marketplace-api && npm start
# Test smart contracts
cd ../nft_contract && forge test
# Launch frontend
cd ../frontend && npm run devLocated in nft_contract/, built with Solidity and Foundry framework.
Key Contracts:
Collection.sol— Handles NFT minting, selling, and storageCollectionFactory.sol— Deploys collection instances per user
Uses OpenZeppelin libraries for security-audited implementations of ERC-721 and access control patterns.
Located in nft-marketplace-api/, powered by Node.js, Express, and PostgreSQL.
Core Responsibilities:
- JWT-based authentication
- Metadata management
- IPFS file uploads
- Blockchain event synchronisation
- Transaction processing (mint, list, buy, transfer)
Located in frontend/, built with React, Vite, and TailwindCSS.
Key Features:
- MetaMask wallet integration
- Intuitive minting interface
- NFT and collection galleries
- User dashboard with portfolio tracking
- Marketplace with filtering and search
- Uses OpenZeppelin's audited contracts for ERC-721 and royalty standards
- JWT authentication with secure token management
- Input validation and sanitization
- Prepared statements for SQL injection prevention
- Rate limiting on API endpoints
Note: Smart contracts should undergo professional security audits before mainnet deployment.
Every NFT includes explicit commercial usage rights, eliminating ambiguity for buyers.
Owners gain access to high-resolution files and exclusive content not available to the public.
Token holders receive perks including early access to drops, collaboration opportunities, and exclusive discounts.
Built-in verification systems ensure authenticity and ownership history.
Automatic royalty distribution on secondary sales to support ongoing creator compensation.
"We're not just selling digital images. We're providing verifiable ownership, usage rights, and exclusive utilities that extend beyond the artwork itself."
This project is licensed under the MIT License. See LICENSE file for details.
- OpenZeppelin for secure smart contract libraries
- Foundry for Solidity development toolkit
- IPFS for decentralized content storage