Comprehensive guide for development, Vercel GUI deployment, and production reconfiguration.
This repo contains a full-stack multi-service product:
unified-web(Next.js frontend)unified-gateway(API gateway)unified-auth-serviceunified-user-serviceunified-productivity-serviceunified-messaging-serviceunified-file-servicepackages/shared(shared auth/errors/config/utils)
Use only unified-* Vercel projects. Do not deploy to old duplicate project names.
- Web:
https://web-swart-delta-57.vercel.app - Gateway:
https://gateway-dun-chi.vercel.app - Auth:
https://auth-service-delta-beryl.vercel.app - User:
https://user-service-omega.vercel.app - Productivity:
https://productivity-service.vercel.app - Messaging:
https://messaging-service-theta.vercel.app - File:
https://file-service-alpha.vercel.app
- Frontend API base must target gateway domain above.
- Gateway and services must share compatible JWT secrets.
- Production deployment protection must not block public API/browser traffic.
For day-to-day operations, use these documents:
- Main runbook:
DEPLOYMENT_VERCEL.md - Environment matrix:
docs/env-matrix.md - Domains and aliases:
docs/domains-aliases.md - Release checklist:
docs/release-checklist.md - New service onboarding:
docs/new-service-playbook.md
From repo root:
- Install dependencies
pnpm install- Run full stack in dev
pnpm run dev:all- Build all apps/packages
pnpm run build:all- Type-check all
pnpm run typecheck:allpnpm --filter @unified/web dev
pnpm --filter @unified/gateway dev
pnpm --filter @unified/auth-service devUse this for fresh setup or reconfiguration without CLI.
In Vercel Dashboard, ensure these projects exist and point to this repo:
unified-web-> rootapps/webunified-gateway-> rootapps/gatewayunified-auth-service-> rootapps/auth-serviceunified-user-service-> rootapps/user-serviceunified-productivity-service-> rootapps/productivity-serviceunified-messaging-service-> rootapps/messaging-serviceunified-file-service-> rootapps/file-service
unified-web:Next.js- All backend services:
Other
For each project:
Settings -> Git- Connect
Bittu-the-coder/unified - Confirm Production Branch
- Confirm Root Directory
For public web/API behavior:
- Open each project
Settings -> Deployment Protection - Disable production auth/password protection for web/gateway/services that browsers call
- Keep preview protection enabled if needed
If protection is enabled on APIs, browser will show CORS-like failures caused by platform 401 before your app runs.
Set values by service using docs/env-matrix.md.
Minimum critical values:
unified-web:NEXT_PUBLIC_API_BASE=https://gateway-dun-chi.vercel.appunified-gateway: all service URLs +CLIENT_ORIGIN- All backend services:
NODE_ENV=productionMONGODB_URI=<remote>CLIENT_ORIGIN=<same as gateway>JWT_ACCESS_SECRET=<shared>JWT_REFRESH_SECRET=<shared>
For unified-file-service, also configure storage provider variables.
When env, domain, or routing changes are made in GUI:
- Deploy
unified-auth-service - Deploy
unified-user-service - Deploy
unified-productivity-service - Deploy
unified-messaging-service - Deploy
unified-file-service - Deploy
unified-gateway - Deploy
unified-web
Reason: gateway depends on downstream service URLs, and web depends on gateway URL.
After redeploy:
- Check
/healthon each service URL - Open web and test:
/register/login - Verify browser calls gateway domain from section 2
- Test at least one endpoint per module:
/users/*,/productivity/*,/messaging/*,/file-cloud/*
-
CORS error with no
Access-Control-Allow-OriginCause: request blocked before app (usually deployment protection) orCLIENT_ORIGINmismatch. -
Immediate logout after login Cause: token accepted by auth but rejected by another service due to JWT/env mismatch.
-
500 FUNCTION_INVOCATION_FAILEDCause: runtime bootstrap/env parse failure in target service. -
Invalid JSON responsein web Cause: upstream returned non-JSON error page (often gateway/protection/runtime failure).
Follow docs/new-service-playbook.md exactly.
High-level flow:
- Create new app under
apps/<new-service> - Add gateway route + env key if externally routed
- Create
unified-<new-service>project in Vercel GUI - Configure envs
- Deploy in order before gateway/web
- Update docs
- Keep docs updated whenever envs/domains/flow changes.
- Avoid duplicate Vercel projects with overlapping names.
- Keep root directories and project names consistent.
- Treat
DEPLOYMENT_VERCEL.mdanddocs/*as release-critical artifacts.