Public dashboard and webhook-backed metrics for App Store review timing.
- Frontend: Vite + React
- API: Vercel Functions under
api/ - Database: Supabase Postgres
- Connect this repo to Vercel.
- Install/attach Supabase via Vercel Marketplace integration.
- In Supabase SQL editor, run
supabase/schema.sql. - Deploy.
The Vercel + Supabase integration normally injects these database vars:
POSTGRES_URL(preferred)POSTGRES_PRISMA_URL(fallback)POSTGRES_URL_NON_POOLING(fallback)
Auth + webhook vars required by this app:
SUPABASE_URL- used by API routes for bearer token verification.SUPABASE_ANON_KEYorSUPABASE_PUBLISHABLE_KEY- used by API routes to call Supabase Auth.VITE_PUBLIC_SUPABASE_URL- used by frontend auth client.VITE_PUBLIC_SUPABASE_PUBLISHABLE_KEY(orVITE_PUBLIC_SUPABASE_ANON_KEY) - used by frontend auth client.WEBHOOK_SECRET_ENCRYPTION_KEY- base64-encoded 32-byte key used to encrypt webhook secrets at rest.
Optional:
VITE_API_BASE_URL- only needed if frontend should call an external API host instead of same-origin/api.
GET /api/healthGET /api/metrics/overview?rangeDays=30GET /api/metrics/trends?months=9POST /api/webhooks/appleGET /api/my-app/setup(auth required)POST /api/my-app/secret(auth required)POST /api/my-app/secret/rotate(auth required)
- User signs in with Supabase email/password and receives a bearer token.
- Client calls
POST /api/my-app/secretwithAuthorization: Bearer <token>. - API returns a one-time secret value (store it securely).
- User configures App Store Connect webhook with the provided per-user URL + secret.
POST /api/webhooks/apple?hook=...resolves user by hook token and verifiesx-apple-signatureusing that user secret.- Matching webhook events are attributed to that user and ingested.
Use POST /api/my-app/secret/rotate to invalidate the previous secret and issue a new one.
npm run dev- Vite frontend + legacy local Express APInpm run build- frontend production buildnpm run lint- lint project files
Copy .env.example to .env.local and fill values.
api/routes are the Vercel production path.- Existing
server/code remains for local prototype workflows and seeded demo data. - Public dashboard metrics remain global in this pass; user-specific metrics can be layered on top later.