AudiFi is a Web3 platform for independent music artists to mint their tracks as NFTs, retain full ownership, and earn perpetual royalties through the innovative "Mover Advantage" system.
AudiFi empowers artists to:
- Upload music tracks and artwork
- Configure release metadata (genre, BPM, mood, description)
- Mint tracks as NFTs with fractional ownership (Master IPO)
- Earn automatic royalties on all secondary market resales
- Engage fans through V Studio interactive sessions
This repository contains:
- Frontend: React + TypeScript SPA in
/src(deployed to Vercel) - Backend: Node.js/Express API in
/server(deployed to Fly.io) - Database: Drizzle ORM schemas in
/db(Neon PostgreSQL) - Infrastructure: Docker/Kubernetes configs in
/deploy
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ INTERNET โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Vercel (Frontend) โ โ Fly.io (Backend API) โ
โ https://audifi.io โ โ https://audifi-api.fly.dev โ
โ โ โ โ
โ โข React + Vite โ โ โข Node.js + Express โ
โ โข Static assets โ โ โข REST API โ
โ โข Client-side only โโโโถโ โข Authentication โ
โ โข NO database access โ โ โข Business logic โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Neon (PostgreSQL) โ
โ host.neon.tech:5432 โ
โ โ
โ โข Serverless Postgres โ
โ โข Auto-scaling โ
โ โข SSL required โ
โ โข Drizzle ORM โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Frontend (Vercel): Static React app, no database access
- Backend (Fly.io): Express API, sole database accessor
- Database (Neon): PostgreSQL with SSL, accessed only by backend
- Node.js 20+
- Neon PostgreSQL database (https://neon.tech)
- Docker (optional, for containerized deployment)
npm install
npm run devThe app will be available at http://localhost:5173.
cd server
npm install
npm run devThe API will be available at http://localhost:3001.
Copy the example env files and configure:
# Root (frontend)
cp .env.example .env
# Server (backend)
cp server/.env.example server/.envFrontend environment variables: (.env)
VITE_API_URL- Backend API URL (e.g.,http://localhost:3001)VITE_WS_URL- WebSocket URL for real-time features
Backend environment variables: (server/.env)
DATABASE_URL- Neon PostgreSQL connection string (required)JWT_SECRET- Secret for JWT token signing (min 32 chars)SENDGRID_API_KEY- For magic link emails (optional in development)
โ ๏ธ Important:DATABASE_URLshould NEVER be set in the frontend environment.
- Create a free database at Neon
- Copy your connection string from the Neon dashboard
- Set
DATABASE_URLinserver/.env
cd server
# Generate migrations from schema
npm run db:generate
# Apply migrations to database
npm run db:migrate
# Or push schema directly (development)
npm run db:pushโโโ src/ # Frontend React application (Vercel)
โ โโโ api/ # API client layer (calls Fly.io backend)
โ โโโ components/ # React components
โ โโโ pages/ # Route pages
โ โโโ types/ # TypeScript types
โโโ server/ # Backend Node.js/Express API (Fly.io)
โ โโโ src/
โ โ โโโ config/ # Configuration + env validation
โ โ โ โโโ index.ts # Main config
โ โ โ โโโ env.ts # Environment variable handling
โ โ โโโ db/ # Database client (Neon) & schema
โ โ โโโ middleware/ # Express middleware
โ โ โโโ routes/ # API routes
โ โ โโโ services/ # Business logic
โ โโโ Dockerfile # Backend container image
โ โโโ fly.toml # Fly.io deployment config
โ โโโ drizzle.config.ts # Drizzle Kit configuration
โโโ db/ # Shared database schemas (Neon)
โ โโโ schema/ # Drizzle ORM table definitions
โโโ deploy/ # Infrastructure configs
โ โโโ docker-compose.yml.example
โ โโโ Caddyfile.example
โโโ .github/workflows/ # CI/CD pipelines
โ โโโ backend.yml # Backend tests + Fly.io deployment
โ โโโ frontend.yml # Frontend tests + Vercel deployment
โโโ docs/ # Documentation
AudiFi uses JWT-based authentication with magic link passwordless login:
- User requests magic link via email
- Token is stored in database with 15-minute expiry
- User clicks link, token is verified and consumed
- JWT access token (short-lived) + refresh token (30 days) issued
- Optional 2FA via TOTP (Google Authenticator compatible)
Users can link Web3 wallets with signature verification:
POST /api/v1/auth/wallet
{
"address": "0x...",
"chain": "ethereum",
"signature": "0x...",
"message": "Sign this message to link your wallet"
}
- Artists can create "Masters" (tracks/albums) and launch IPOs
- Configurable supply (1 to 1,000,000 NFTs)
- "Mover Advantage" system rewards early minters with perpetual royalties
- Interactive fan sessions during creative process
- Decision points where fans vote on creative choices
- Eligibility rules (NFT holders, coin holders, subscribers)
- Ethereum, Polygon, Base networks supported
- Chain selection per IPO
- Wallet linking per chain
# Frontend
npm test
# Backend
cd server
npm test# Frontend
npm run type-check
# Backend
cd server
npm run type-check# Frontend
npm run lint
# Backend
cd server
npm run lint| Component | Platform | URL |
|---|---|---|
| Frontend | Vercel | https://audifi.io |
| Backend API | Fly.io | https://audifi-api.fly.dev |
| Database | Neon | (internal connection) |
The backend API is deployed to Fly.io via GitHub Actions.
Required GitHub Secrets:
DATABASE_URL- Neon PostgreSQL connection stringFLY_API_TOKEN- Fly.io API tokenFLY_APP_STAGING- Staging app nameFLY_APP_PRODUCTION- Production app name
Manual deployment:
cd server
flyctl deployRequired Fly.io secrets:
flyctl secrets set DATABASE_URL=postgresql://...@host.neon.tech:5432/db
flyctl secrets set JWT_SECRET=your-jwt-secret
flyctl secrets set SENDGRID_API_KEY=your-sendgrid-keyThe frontend is automatically deployed via Vercel Git integration.
Environment Variables (Vercel Dashboard):
VITE_API_URL- Backend API URL (e.g.,https://api.audifi.io)VITE_WS_URL- WebSocket URL
For local development with Docker:
cp deploy/docker-compose.yml.example deploy/docker-compose.yml
cp deploy/.env.example deploy/.env
cd deploy
docker compose up -dSee docs/api/overview.md for full API reference.
| Endpoint | Method | Description |
|---|---|---|
/api/v1/health |
GET | Health check with dependency status |
/api/v1/auth/magic-link |
POST | Request magic link |
/api/v1/auth/verify-magic-link |
POST | Verify and get tokens |
/api/v1/auth/refresh |
POST | Refresh access token |
/api/v1/masters |
GET/POST | List/create masters |
/api/v1/masters/:id/ipo |
POST | Create IPO for master |
- React 19 + TypeScript
- React Router v7
- Tailwind CSS v4
- shadcn/ui components
- Node.js 20 + TypeScript
- Express.js
- Drizzle ORM + Neon PostgreSQL
- JWT authentication
- ethers.js for Web3
- Frontend: Vercel
- Backend API: Fly.io
- Database: Neon (PostgreSQL)
- Local Dev: Docker Compose
The Spark Template files and resources from GitHub are licensed under the terms of the MIT license, Copyright GitHub, Inc.