Next.js 14 · NestJS · Flutter · Ethereum · PostgreSQL · Google Gemini AI
FundFlow is a Crowdfunding 3.0 platform that lets creators launch campaigns, backers pledge funds through a connected wallet, and admins moderate the marketplace — with on-chain transparency, AI assistance, and live funding updates.
The product ships as a monorepo with three clients talking to one API:
| App | Role |
|---|---|
| fund-client | Next.js web experience for recruiters, creators, and backers |
| fund-server | NestJS REST + WebSocket API with JWT, RBAC, and Supabase storage |
| fund-app | Flutter Android / iOS app using the same /api/v1 backend |
The platform is designed to feel like a modern product — not just a demo — while remaining practical to run locally, deploy, and extend.
| Feature | Description |
|---|---|
| ⛓️ On-chain Crowdfunding | Ethereum smart contracts for campaign creation, ETH pledges, withdrawals, and automatic refunds when a goal is missed. |
| 🤖 Gemini AI Copilot | Chat support, campaign analysis, fraud scoring, content generation, and personalized recommendations. |
| 📱 Native Mobile App | Flutter client for Android and iOS with the same user journey as the web app. |
| 👛 Wallet-First Backing | MetaMask connection, network switching, and on-chain contribution flow with explorer links. |
| 🎁 Reward Tiers | Multi-tier rewards with minimum pledges, delivery dates, backer caps, and campaign images. |
| 📡 Live Funding Stats | Socket.IO broadcasts for new pledges, campaign updates, and platform-wide counters. |
| 🌍 Bilingual-Ready i18n | English, Spanish, and French on both client and server — no heavy i18n framework required. |
| 🛡️ Role-Based Admin | user · admin · superadmin with JWT guards, Swagger role docs, and a dedicated admin panel. |
| 🖼️ Supabase Storage | Campaign, reward, and avatar images uploaded through the API and stored as public URLs. |
| ⚡ Production Ready | Dockerfiles, Vercel-friendly frontend, Swagger docs, CI, and security-minded auth defaults. |
| Layer | Technology |
|---|---|
| Web | Next.js 14 (App Router), React 18, TypeScript |
| UI | Tailwind CSS v4, Radix UI, shadcn/ui |
| Mobile | Flutter 3.4+, Dart, Provider, go_router |
| API | NestJS 10, TypeORM, Passport + JWT |
| Database | PostgreSQL 15 / Supabase |
| Storage | Supabase Storage (campaign-images) |
| Blockchain | Solidity 0.8, Hardhat, ethers.js v5, MetaMask |
| AI | Google Gemini (@google/generative-ai) |
| Realtime | Socket.IO |
| Docs | Swagger at /docs |
| Deploy | Vercel · Docker · Railway / Render |
| Package Managers | npm (web + API) · pub (mobile) |
FundFlow is built as a product experience, not a single landing page.
Creators and backers can:
- Browse featured campaigns with live platform stats
- Search and filter by category or status
- Open a campaign, pick a reward, and pledge from MetaMask
- Launch a campaign through a multi-step wizard
- Manage created and backed projects from the dashboard
- Chat with the Gemini assistant from any page
- Switch language and light / dark theme
The Flutter app covers the same journey on Android and iOS:
- Home, explore, campaign detail, and backing flow
- Create-campaign wizard with image upload
- Secure JWT storage, profile, settings, and notifications
- Admin tools for
admin/superadminaccounts - Support, blog, careers, docs, and contact screens
The NestJS backend is the source of truth:
- REST under
/api/v1 - JWT auth and role guards
- Campaigns, rewards, funding, users, blog, careers, support, contact, notifications
- Image upload to Supabase
- Socket.IO gateway for live events
- Role-split Swagger:
/docs,/docs/user,/docs/admin,/docs/superadmin
Smart contracts live in fund-client/contracts/.
createCampaign(...)deploys a new campaign contract- Tracks creator mappings and emitted
CampaignCreatedevents
contribute()— payable ETH pledgeswithdraw()— creator withdraws after the goal is reachedrefund()— backers recover funds if the goal is missedcancel()— creator cancels an active campaign
| Network | Chain ID | Usage |
|---|---|---|
| Hardhat Local | 31337 |
Development |
| Sepolia | 11155111 |
Default testnet |
| Polygon | 137 |
Mainnet |
| Mumbai | 80001 |
Polygon testnet |
AI is powered by Google Gemini. Without GEMINI_API_KEY, routes fall back to mock responses so the UI still works.
| Capability | Where it shows up |
|---|---|
| 24/7 chat assistant | Floating widget on every web page |
| Content generation | Campaign create wizard |
| Risk / success analysis | Campaign analysis API |
| Fraud scoring | Campaign + creator checks |
| Recommendations | Home page suggestions |
| Natural-language search | Campaign browse |
Get a key from Google AI Studio and add it to fund-client/.env.
user < admin < superadmin
| Role | What they can do |
|---|---|
Backer / Creator (user) |
Register, launch campaigns, pledge, manage profile |
| Admin | Moderate campaigns, manage users, open the admin UI |
| Superadmin | Create admins, change roles (max 3 superadmins) |
Public registration always creates a user. Admin accounts are created only by a superadmin or the create-superadmin script.
funddefi/
│
├── fund-client/ # Next.js web app + Hardhat contracts
│ ├── app/ # App Router pages & BFF AI routes
│ ├── components/ # UI, wallet, funding, AI widgets
│ ├── contracts/ # Campaign.sol, CrowdfundingFactory.sol
│ ├── hooks/ # auth, campaigns, i18n
│ ├── lib/ # API client, contracts, websocket
│ └── scripts/ # Hardhat deploy
│
├── fund-server/ # NestJS API
│ ├── src/
│ │ ├── auth/ users/ campaigns/ funding/
│ │ ├── storage/ websocket/ notifications/ i18n/
│ │ ├── blog/ careers/ support/ contact/
│ │ └── scripts/create-superadmin.ts
│ └── database/ # SQL migrations & seeds
│
├── fund-app/ # Flutter Android / iOS
│ ├── lib/
│ │ ├── screens/ # home, campaigns, create, admin, …
│ │ ├── providers/ # auth, campaigns, copilot
│ │ ├── models/ # campaign, reward, user
│ │ └── widgets/ # shared UI kit
│ └── pubspec.yaml
│
├── .github/workflows/ci.yml
└── README.md
- Node.js 18+ and npm 10+
- Flutter 3.4+ (mobile only)
- MetaMask (wallet testing)
- PostgreSQL 15+ via Docker or a Supabase project
- Google Gemini API key (optional, for live AI)
git clone https://github.com/alihaiderdevP2P/funddefi.git
cd funddeficd fund-server
cp .env.example .env # or create .env from the template below
npm installDatabase — Docker:
docker-compose up -dDatabase — Supabase:
npm run db:migrate:supabase
npm run storage:setupCreate the first superadmin:
npm run create-superadminStart the API:
npm run start:dev| Check | URL |
|---|---|
| API | http://localhost:3001/api/v1 |
| Health | http://localhost:3001/api/v1/health |
| Swagger | http://localhost:3001/docs |
cd fund-client
cp .env.example .env
npm install
npm run devVisit:
http://localhost:3000
cd fund-app
cp .env.example .env
flutter pub get
flutter runPoint API_BASE_URL at http://localhost:3001/api/v1 (use your machine IP on a physical device).
cd fund-client
npx hardhat run scripts/deploy.js --network sepoliaCopy the factory address into NEXT_PUBLIC_FACTORY_ADDRESS.
NEXT_PUBLIC_API_URL=http://localhost:3001
BACKEND_URL=http://localhost:3001
NEXT_PUBLIC_WS_URL=http://localhost:3001
NEXT_PUBLIC_LANG_DEFAULT=en
NEXT_PUBLIC_LANG_FALLBACK=en
NEXT_PUBLIC_FACTORY_ADDRESS=0x0000000000000000000000000000000000000000
GEMINI_API_KEY=your-gemini-api-key
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-keyDB_HOST=localhost
DB_PORT=5433
DB_USERNAME=postgres
DB_PASSWORD=password
DB_NAME=crowdfunding
JWT_SECRET=change-me-in-production
JWT_EXPIRES_IN=7d
PORT=3001
NODE_ENV=development
LANG_DEFAULT=en
LANG_FALLBACK=en
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_STORAGE_BUCKET=campaign-images
SUPABASE_SERVICE_ROLE_KEY=your-service-role-keyNever commit real secrets. Rotate any key that has been shared in chat or screenshots.
cd fund-client
npm run build
npm startcd fund-server
npm run build
npm run start:prodcd fund-app
flutter build apk # Android
flutter build appbundle # Play Store
flutter build ipa # iOS (macOS)Each service includes a production Dockerfile.
# API
cd fund-server
docker build -t fundflow-api .
docker run -p 3001:3001 fundflow-api
# Web
cd fund-client
docker build -t fundflow-web .
docker run -p 3000:3000 fundflow-web| Service | Recommended platform |
|---|---|
| Web | Vercel — set NEXT_PUBLIC_API_URL to the live API |
| API | Railway / Render / Fly.io / any Docker host |
| Database + Storage | Supabase |
| Contracts | Sepolia or Polygon via Hardhat |
| Mobile | Google Play (AAB) · Apple App Store / TestFlight (IPA) |
Live web client:
funddefi-client-six.vercel.app
CORS origins are configured in fund-server/src/main.ts (CORS_ORIGINS or the default localhost + Vercel list).
- Next.js App Router with lazy-loaded campaign media
- Flutter cached network images and shimmer placeholders
- Socket.IO rooms so clients only receive relevant live events
- Standalone / Docker production builds for the API
- WebGL-free web UI so the product stays fast on recruiter laptops and phones
- bcrypt password hashing
- JWT sessions with configurable expiry
- class-validator on every DTO
- Guard-based RBAC for admin and superadmin routes
- Non-custodial wallets — users keep their keys
- Contract refunds when a campaign fails
- CORS origin whitelist
- Secrets stay in
.envand are never committed
- Multi-chain support (Arbitrum, Base, BSC)
- Campaign milestones with escrow releases
- Email notifications for pledges and updates
- Unique user handles
- KYC / AML hooks
- Wire remaining admin UI charts to live APIs
This project is available under the MIT License.
Full-Stack / Frontend Developer
I build modern, interactive products with React, Next.js, TypeScript, NestJS, Flutter, Ethereum, and Tailwind CSS — combining solid engineering with a product-quality user experience.
ali-haider-portfolio-dev-mu.vercel.app
linkedin.com/in/ali-haider-1496a4413
github.com/AliHaiderRoy · github.com/alihaiderdevP2P
Interested in collaborating, discussing a project, or connecting?
🌐 Portfolio Visit my portfolio →
💼 LinkedIn Connect with me →
🐙 GitHub View this repository →
Built with ❤️ by Ali Haider