Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/operations/agent-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
24 changes: 1 addition & 23 deletions render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading