Cloudflare Workers API for VoidVault.
- Cloudflare Workers (TypeScript)
- Supabase Postgres (service-role only)
- Custom cookie/session auth
- Cloudinary (media signing)
- Username + password only
- No email, no OAuth
- Sessions: DB-backed, hashed tokens, HTTP-only cookies
- Passwords: bcrypt hashed
- No password recovery - password is the only credential
- Strict single-origin CORS
- CSRF token validation on all mutations
- Per-IP rate limiting
- Security headers: CSP, HSTS, X-Frame-Options, Referrer-Policy
- Input sanitization, body-size limits
GET /- healthGET /username/suggestPOST /registerPOST /login
POST /logout·GET /me·GET /feed·POST /post·DELETE /postPOST /media/sign-upload·POST /report·GET /searchGET /notificationsGET|PATCH /profileGET|POST|DELETE /followGET /chat/list·POST /chat/startGET|POST /chat/:id/messagesGET|POST /advice·GET|POST /advice/:id/repliesPOST /account/password/change·POST /account/deactivate·DELETE /account
GET /admin/overviewGET|DELETE /admin/users·POST /admin/user/moderationGET /admin/posts·POST /admin/post/hide·POST /admin/post/deleteGET /admin/reports·GET /admin/user-details
SUPABASE_URL
SUPABASE_SERVICE_ROLE_KEY
FRONTEND_ORIGIN
CLOUDINARY_CLOUD_NAME
CLOUDINARY_API_KEY
CLOUDINARY_API_SECRET
ADMIN_API_KEY
ADMIN_PASSWORD_ENCRYPTION_KEY
001_phase1_foundation.sql002_phase2_social_chat.sql003_phase2_moderation_media.sql004_phase3_security_profile_admin.sql005_phase4_social_advice_engagement.sql006_phase5_post_video_support.sql007_phase6_password_auth.sql008_phase7_password_ciphertext.sql009_phase8_user_request_audit_logs.sql010_phase9_admin_platform_settings.sql011_phase10_report_reason.sql
Create .dev.vars:
SUPABASE_URL=https://YOUR_PROJECT.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your_key
FRONTEND_ORIGIN=http://localhost:5173
CLOUDINARY_CLOUD_NAME=your_name
npm install && npm run devnpx wrangler deploy