Spaces:
Build error
Build error
AudioForge β Finalization & Deployment Plan
Date: February 2, 2026
Goal: Polish code, fix bugs, make production-ready, deploy to Vercel, attach custom domain
Custom domain: yourdomain.com β replace with your real domain when adding in Vercel
Architecture Overview
- Frontend: Next.js 14 (App Router) β Deploy to Vercel
- Backend: FastAPI (Python) β Deploy separately (Railway, Render, Fly.io) β not Vercel
- Database: PostgreSQL (Supabase or managed)
- Redis: For caching (optional for MVP)
Phase 1: Analyze & Polish β
1.1 Fix Missing Lib Modules (Blocking Build)
- Create
frontend/src/lib/utils.tsβcn()classnames helper (clsx + tailwind-merge) - Create
frontend/src/lib/api.tsβ API client withGenerationRequest,GenerationResponse,generationsApi(create, list)
1.2 Code Quality
- Run
pnpm run buildin frontend β fix any build errors - Run
pnpm run lintandpnpm run type-checkβ fix linter/TypeScript errors - Remove stray
console.log, add error boundaries if needed - Improve loading states (low-hanging fruit)
1.3 Accessibility
- Basic a11y checks on main interactive elements (buttons, forms, audio player)
Phase 2: Pre-Deploy Checks β
2.1 Environment & Config
- Create/update
frontend/.env.examplewithNEXT_PUBLIC_API_URL - Verify
.gitignoreβ never commit.env,node_modules - Create
vercel.jsonif needed (rewrites, redirects, root directory for monorepo)
2.2 Vercel-Specific
- Root directory:
frontend(monorepo β backend is separate) - Build command:
pnpm run build(ornpm run build) - Output directory:
.next(Next.js default) - Env vars:
NEXT_PUBLIC_API_URLβ your deployed backend URL
Phase 3: Deployment Execution
3.1 Git & Repo
- Ensure git remote exists (GitHub/GitLab)
- Commit all changes:
chore: pre-deployment polish & fixes - Push to
main(or preferred branch)
3.2 Vercel Deploy
- Go to vercel.com β New Project β Import Git Repository
- Configure:
- Root Directory:
frontend - Framework Preset: Next.js
- Build Command:
pnpm run build(ornpm run build) - Environment Variables: Add
NEXT_PUBLIC_API_URL=https://your-backend-url.com
- Root Directory:
- Deploy
- Copy preview URL (e.g.
https://audioforge-xxx.vercel.app)
3.3 Backend Deployment (Required for Full Functionality)
- Deploy FastAPI backend to Railway, Render, or Fly.io
- Set
CORS_ORIGINSto include your Vercel URL and custom domain (comma-separated) - Set
NEXT_PUBLIC_API_URLin Vercel to your backend URL - Redeploy frontend after backend is live
3.4 Custom Domain
- Vercel Dashboard β Project β Settings β Domains
- Add domain:
yourdomain.comandwww.yourdomain.com - Configure DNS (at your registrar):
- A record:
@β76.76.21.21 - CNAME:
wwwβcname.vercel-dns.com
- A record:
- Wait for DNS propagation (5β60 min)
- Vercel will auto-provision SSL
Phase 4: Verification & Handover
- Visit deployed URL in browser
- Test: load page, submit a generation (if backend is live)
- If issues: diagnose, fix, redeploy
- Final output: Live URL + custom domain instructions
Risks & Mitigations
| Risk | Mitigation |
|---|---|
| Backend not deployed | Frontend will load but API calls fail; document backend deployment steps |
| CORS issues | Backend CORS_ORIGINS must include Vercel domain |
| WebSocket over HTTPS | Ensure backend supports WSS if frontend is HTTPS |
| Monorepo structure | Use Vercel root directory frontend |
Commands Reference
# Frontend build (from project root)
cd frontend && pnpm run build
# Frontend dev
cd frontend && pnpm run dev
# Lint & type-check
cd frontend && pnpm run lint && pnpm run type-check
# Run tests
cd frontend && pnpm run test
Files Created/Modified
| File | Action |
|---|---|
frontend/src/lib/utils.ts |
Create |
frontend/src/lib/api.ts |
Create |
frontend/.env.example |
Create |
vercel.json (root) |
Create |
PLAN.md |
Create (this file) |
Next: Execute Phase 1β2, then deploy.