Mock → live migration
The frontend started as a pure-mock SPA. It's transitioning to live-API. Track what's still mock so you know what's safe to throw away.
Status
| Surface | Source | Notes |
|---|---|---|
| Homepage featured agents | Live (useAgents()) | Replaces the original mock featured set |
| Browse catalog | Live | |
| Agent detail (hero, pricing, reviews, changelog) | Live | |
| Dashboard subscriptions | Live | |
/admin/leads | Mock | leads[] in src/data/agents.ts |
/admin/customers | Mock | customers[] in src/data/agents.ts |
/admin/vendors | Mock | vendors[] in src/data/agents.ts |
/admin/overview KPIs | Partial mock | Some derived from live, some hard-coded |
| Some "trending" homepage strips | Commented out | Awaiting backend support |
| Static category color themes | Static (intentional) | src/data/categoryThemes.ts — not migrating |
To migrate AdminLeads
The backend doesn't have a leads table yet. Two options:
- Postpone — leave the mock data in place until you have an actual lead tracking system.
- Reuse
interactions— theinteractionstable already capturesdemo_requestanduser_signup. Aggregate it into a lead view:SELECT ... FROM interactions WHERE type IN ('demo_request', 'user_signup').
Recommendation: rename AdminLeads to AdminLeadFeed, point it at GET /admin/interactions?type=demo_request, and ship.
To migrate AdminCustomers
Aggregate user_agent_subscriptions by userId. Recommended new endpoint:
GET /admin/customers?cursor=&limit=20
→ [{ userId, email, name, totalMRR, agents: [...] }, ...]
Until then, build it client-side from subscriptions + auth.user data via existing endpoints.
To migrate AdminVendors
There's no notion of "vendor" in the schema today — every agent has createdBy (a user ID) and that's it. Add:
- Column on
agents:publisherId,publisherName. - Or full
vendorstable with(id, name, contactEmail, payoutMethod)andagents.vendorIdFK.
Then GET /admin/vendors aggregates installs, revenue, agent count per vendor.
Hybrid mode for previews
The mock entries in src/data/agents.ts are still useful for:
- Previewing UI on a slow CI build without provisioning a backend.
- Adding placeholder copy for an agent that doesn't exist in the DB yet.
The runtime preference is live API. Mock entries are visible only when useAgents() returns empty or errors.
Decommission criteria
Each mock array can be deleted from src/data/agents.ts when:
- Its backend endpoint exists.
- The corresponding admin page is updated to call that endpoint.
- All consumers in the codebase reference the live hook.
Don't delete proactively — keep them as live documentation of the desired shape until the backend catches up.