Development Workflow
Commands
1
Run dev server
2
Lint
3
Build and serve
Supabase
- Local migrations:
npx supabase db push(orsupabase db resetto rebuild). - Ensure buckets
downloadandavatarsexist when testing download/profile flows.
Stripe
- Local webhooks:
stripe listen --forward-to localhost:3000/api/webhooks/stripe. - Keep price IDs in
.env.localconsistent with plan configs and marketing pricing.
Conventions
- Path alias:
@/*. - TypeScript strict; prefer Zod schemas in
lib/validations. - Use
lib/access.tsfor any new gated routes/features. - Keep plan definitions in sync across
lib/payments/plans.ts,config/plans.config.ts, and marketing pricing displays. - Add metadata via
createMetadata/createDynamicMetadatafromlib/seo. - Use
rateLimitpresets for new APIs/actions that are user-triggered.
Testing ideas
- Auth flows: sign-up/sign-in/reset paths and
/auth/callback. - Checkout → webhook → Supabase rows for subscription and one-time plans.
- Download endpoint with/without license, Standard vs Ultimate.
- GitHub access endpoint with valid/invalid username and missing PAT.
- OG routes (
/api/og,/api/og/blog) render without errors.