A modern NFT platform built with Next.js, Web3, and MongoDB that enables users to create, mint, buy, sell, and trade non-fungible tokens on the Ethereum blockchain.
- 🔐 Web3 Wallet Authentication - Connect with MetaMask
- 👤 User Profiles - Manage your wallet and account information
- 🎨 Modern UI - Built with Tailwind CSS and responsive design
- 🗄️ MongoDB Integration - Scalable data storage for users and NFTs
- 🔗 Ethereum Sepolia - Deployed on Ethereum Sepolia testnet
- 🚀 Next.js 13+ - Modern React framework with App Router
- Frontend: Next.js 13+, React 18, TypeScript
- Web3: ethers.js
- Database: MongoDB
- Styling: Tailwind CSS
- Wallet Support: MetaMask
- Node.js 22.14.0
- MongoDB (local or Atlas)
- MetaMask wallet
- Clone the repository:
git clone <repository-url>
cd nftsongs
- Install dependencies:
npm install
- Set up environment variables:
cp .env.local.example .env.local
Edit .env.local
with your configuration:
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/nftsongs
# OR for MongoDB Atlas:
# MONGODB_URI=<<YOUR MONGO DB URI>>
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here_change_in_production
# Next.js Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret_here
# Ethereum Network Configuration
NEXT_PUBLIC_NETWORK_ID=11155111 # Sepolia testnet
NEXT_PUBLIC_NETWORK_NAME=Sepolia
NEXT_PUBLIC_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_PROJECT_ID
- Start the development server:
npm run dev
- Open http://localhost:3000 in your browser
app/
├── .env.local # Environment variables
├── .gitignore
├── package.json # Dependencies and scripts
├── next.config.js # Next.js configuration
├── tailwind.config.js # Tailwind CSS configuration
├── postcss.config.js # PostCSS configuration
├── jsconfig.json # JavaScript configuration
├── README.md
├── pages/ # Next.js pages and API routes
│ ├── api/ # Backend API routes
│ │ ├── auth/
│ │ │ └── connect.js # Wallet connection endpoint
│ │ └── users/
│ │ └── me.js # User profile endpoint
│ ├── _app.js # App wrapper with global styles
│ ├── _document.js # Document structure
│ ├── index.js # Home page (redirects to connect)
│ ├── connect.js # Wallet connection page
│ └── profile.js # User profile page
├── lib/ # Utility libraries
│ ├── mongodb.js # MongoDB connection
│ ├── auth.js # Authentication utilities
│ └── web3.js # Web3 provider configuration
└── styles/ # Global styles
└── globals.css
POST /api/auth/connect
- Authenticate with wallet signatureGET /api/users/me
- Get current user profile
- User visits the app and is redirected to
/connect
- User selects MetaMask wallet provider
- User connects their wallet and approves the connection
- User signs a challenge message to prove ownership
- Backend verifies the signature and creates a JWT session
- User is redirected to
/profile
with authenticated session
npm run dev
- Start development servernpm run build
- Build for productionnpm run start
- Start production servernpm run lint
- Run ESLint
- New Pages: Add files to
pages/
directory - API Routes: Add files to
pages/api/
directory - Components: Add reusable components in
components/
directory - Utilities: Add helper functions in
lib/
directory
Variable | Description | Required |
---|---|---|
MONGODB_URI |
MongoDB connection string | Yes |
JWT_SECRET |
JWT signing secret | Yes |
NEXTAUTH_URL |
Next.js application URL | Yes |
| NEXT_PUBLIC_NETWORK_ID
| Ethereum network ID | Yes |
| NEXT_PUBLIC_NETWORK_NAME
| Network name | Yes |
| NEXT_PUBLIC_RPC_URL
| Ethereum RPC URL | Yes |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the development team.
- NFT minting functionality
- Marketplace for buying/selling NFTs
- Collection management
- IPFS integration for NFT storage
- Smart contract deployment
- Mobile application