A full-stack + data science project that lets users generate unique artworks via a GAN model and mint them as NFTs on IPFS, all through a Next.js frontend with Web3 wallet integration.
- Generative AI: FastAPI microservice runs a GAN to produce 512×512 images from random seeds.
- Web3 Minting: Users connect their MetaMask wallet, generate art, and mint metadata to IPFS with a stubbed blockchain transaction.
- Persistent Storage: Minted tokens are saved in MongoDB Atlas via Mongoose.
- Caching: Redis cache speeds up repeated art generation for the same seed.
- Modern UI: Next.js + TailwindCSS + shadcn/ui components + Framer Motion animations + Sonner toasts.
-
Next.js (frontend) handles UI, wallet connect, and fetches /generate & /mint.
-
Express (backend) proxies to the GAN service, manages caching, IPFS upload, and database persistence.
-
FastAPI microservice loads a GAN model to generate images.
-
Redis caches generated images by seed for 1 hour.
-
MongoDB Atlas stores minted NFT records.
-
IPFS (via ipfs-core) stores metadata JSON.
Frontend: Next.js, React, Tailwind
UI Components: shadcn/ui, Framer Motion
Toasts: Sonner
Backend API: Node.js, Express, TS
ML Service: Python, FastAPI, PyTorch
Caching: Redis (ioredis)
Storage: MongoDB Atlas, ipfs-core
Dev Tools: pnpm, Docker (optional)
-
Node.js ≥16, pnpm
-
Python 3.10+ and pip
-
Redis server (local or cloud)
-
MongoDB Atlas free cluster
-
MetaMask extension in your browser
1. Clone & Install:
git clone https://github.com/yourusername/gen-art-marketplace.git
cd gen-art-marketplace
# install root (workspaces)
pnpm install2. Configure Environment:
Create a .env in backend/ with:
PORT=4000
MONGODB_URI=your_atlas_connection_string3. Start GAN Service:
cd gan-service
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000 --reload4. Start Redis (if not running):
# macOS (Homebrew)
brew install redis
brew services start redis5. Run backend API:
cd ../backend
pnpm dev6. Run frontend:
cd ../frontend
pnpm devOpen http://localhost:3000 in your browser.
-
Click Connect Wallet (MetaMask pop‑up).
-
Click Generate Art to fetch GAN‑generated image.
-
Click Mint to IPFS to upload metadata and get a stub transaction.
-
Check your Atlas DB for the new NFT record.