diff --git a/README.md b/README.md index 9b2f168..e000c04 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,14 @@ Production-shaped foundation for launching a startup SaaS baseline quickly. - Cache: Redis (Upstash in cloud, local Redis in development) - Auth: Clerk (managed auth, organization context) - Billing: Stripe (checkout + portal + webhook sync) -- Deploy: Render +- Deploy: Render (backend + Postgres) + Vercel (frontend) - CI: GitHub Actions ## Repository layout - `frontend/` Next.js shell and app routes - `backend/` Go API shell, auth/billing endpoints, and migrations - `docker-compose.yml` local Postgres + Redis -- `render.yaml` Render blueprint for backend, frontend, and Postgres +- `render.yaml` Render blueprint for backend and Postgres - `.github/workflows/ci.yml` CI for frontend and backend - `docs/roadmap.md` product phases after shell @@ -129,22 +129,29 @@ Recommended flow: See `docs/operations/git-branching-and-versioning.md` for full guidance. -## Render deployment -`render.yaml` defines: -- `saas-core-template-backend` (Go web service) -- `saas-core-template-frontend` (Node web service for Next.js) -- `saas-core-template-postgres` (managed Postgres) +## Production deployment -### Setup steps on Render +This template deploys: +- Backend + Postgres on Render (see `render.yaml`) +- Frontend on Vercel (deploy `frontend/`) + +### Backend + Postgres (Render) 1. Connect this GitHub repository in Render. -2. Create services from `render.yaml` blueprint. +2. Create services from the `render.yaml` blueprint. 3. Set backend secrets: `REDIS_URL`, `CLERK_SECRET_KEY`, `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET`, Stripe price IDs. -4. Set frontend `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`. -5. Confirm frontend `NEXT_PUBLIC_API_URL` points to backend service URL. -6. Ensure auto-deploy is enabled for `main`. +4. Set `APP_BASE_URL` to your Vercel frontend URL (used for Stripe return URLs). +5. Ensure auto-deploy is enabled for `main`. + +### Frontend (Vercel) +1. Import the repo in Vercel. +2. Set project root directory to `frontend/`. +3. Set environment variables: + - `NEXT_PUBLIC_API_URL` = Render backend URL + - `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` = Clerk publishable key +4. Deploy. Deployment flow: -- Push to `main` -> GitHub Actions CI passes -> Render auto-deploys updated services. +- Push to `main` -> GitHub Actions CI passes -> Render auto-deploys backend; Vercel deploys frontend. ## Notes - Local Redis exists for parity; production uses Upstash Redis. diff --git a/docs/README.md b/docs/README.md index 276ebba..1e9220e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,6 +9,7 @@ This directory contains implementation playbooks for contributors and AI agents. 3. Review the architecture playbooks in `docs/architecture/`. 4. Review the operations playbooks in `docs/operations/`. 5. Confirm your change keeps provider boundaries portable and tenant isolation strict. +6. Skim `../README.md` for local + production deployment setup (Render backend + Postgres, Vercel frontend). ## Architecture playbooks diff --git a/docs/operations/agent-workflow.md b/docs/operations/agent-workflow.md index c9f7df0..610aafb 100644 --- a/docs/operations/agent-workflow.md +++ b/docs/operations/agent-workflow.md @@ -36,7 +36,7 @@ This runbook defines the standard operating flow for AI-agent-assisted developme - `npm run build` for route/config changes - Configuration: - Validate env example files are still consistent and complete. - - Validate deployment config changes (for example `render.yaml`) reflect new variables. + - Validate deployment config changes reflect new variables (for example `render.yaml` for Render backend, and Vercel project env vars for frontend). ## 5) Documentation and traceability diff --git a/docs/roadmap.md b/docs/roadmap.md index 66b4fd3..e9a1d30 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -3,6 +3,7 @@ ## Phase 0: Shell (current) - Deployable monorepo with Next.js frontend and Go backend. - Postgres on Render and Upstash Redis integration. +- Frontend deployed on Vercel; backend and Postgres on Render. - Local development parity using Docker Compose for Postgres and Redis. - CI checks on `main`. diff --git a/render.yaml b/render.yaml index 5ca3528..f2f97b1 100644 --- a/render.yaml +++ b/render.yaml @@ -15,10 +15,7 @@ services: - key: PORT value: "10000" - key: APP_BASE_URL - fromService: - type: web - name: saas-core-template-frontend - property: url + sync: false - key: DATABASE_URL fromDatabase: name: saas-core-template-postgres @@ -40,25 +37,6 @@ services: - key: STRIPE_PRICE_TEAM_MONTHLY sync: false - - type: web - name: saas-core-template-frontend - runtime: node - rootDir: frontend - plan: free - autoDeploy: true - buildCommand: npm install && npm run build - startCommand: npm run start - envVars: - - key: NODE_VERSION - value: "20" - - key: NEXT_PUBLIC_API_URL - fromService: - type: web - name: saas-core-template-backend - property: url - - key: NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY - sync: false - databases: - name: saas-core-template-postgres plan: free