This repo contains a backend API and a frontend static SPA intended to be hosted on Supabase Storage.
- Node.js 18+
- PostgreSQL
- Redis
- Supabase project (for storage)
- Copy
.env.exampleto.envand fill values (esp. SUPABASE_*). - Start Postgres + Redis (locally or via docker-compose):
docker-compose up -d- Setup DB:
cd backend
npm install
npm run migrate
npm run seed- Start backend:
npm run dev- Build frontend and upload to Supabase Storage:
cd ../frontend
npm install
npm run build
# using supabase CLI or UI, upload contents of dist/ to bucket cb-embed (public)
supabase storage upload cb-embed dist --recursive --public- Create an intent (example):
curl -X POST http://localhost:4000/api/intents -H 'x-partner-id: 11111111-1111-1111-1111-111111111111' -H 'Content-Type: application/json' -d '{"type":"account_link","customerId":"cust-1"}'Response contains redirect_url pointing to Supabase-hosted SPA with sessionToken.
In backend folder:
npm run worker- This is a reference implementation. In production use mTLS or OAuth2 client auth, one-time session redemption, signed S3 PUT URLs for asset uploads, stricter CSP, and secure webhook secret management.