Environment map
Note on API domains: Render’s free plan does not support custom domains. Theapi.muzemus.onlineandstage-api.muzemus.onlinerecords only resolve once the backend services are on a paid Render plan (Starter or higher) with the custom domain attached. Until then, the frontend can point at the.onrender.comURLs instead (see Domains).
Deployment architecture
Development workflow
- Create branch — feature branches off
main(e.g.feat/...,fix/...). - Implement — code changes in
backend/and/orfrontend/. - Test locally —
pnpm dev,pnpm --filter backend test,pnpm --filter frontend test. - Push branch — the
ci.ymlworkflow runs the quality gate on every push/PR. - Deploy to stage — merge the branch into
staging(or push directly);deploy.ymlmigrates the staging database, deploys the staging backend to Render, then the staging frontend to Firebase. - Verify stage — check
stage.muzemus.onlineand the staging health endpoint. - Merge to main — open a PR from
staging(or the feature branch) intomain. - Production —
deploy.ymlmigrates the production database, deploys the production backend, frontend, and landing page.
CI/CD pipelines
ci.yml — pull request verification
Runs on every pull request and every push to a non-main/staging branch:
- Format check, typecheck, lint, build, and unit tests for
backendandfrontend.
deploy.yml — staging and production
Triggered on push to staging or main. Jobs are gated by the shared quality gate and use GitHub Environments (staging / production) so the same secret names hold environment-specific values.
After each backend deploy, the pipeline polls
GET /api/v1/health until the service responds.
Backend deployment (Render)
Service configuration
Two services are defined in
backend/render.yaml:
muze-uniform-backend— productionmuze-uniform-backend-stage— staging
Build and start commands
Database connections
The backend uses two connection strings against Neon:
Staging uses its own Neon database with its own
DATABASE_URL / DIRECT_URL (stored in the staging GitHub Environment and the staging Render service).
Frontend deployment (Firebase Hosting)
Firebase sites
The frontend
firebase.json declares "site": "muze-mus"; CI passes the explicit site name to firebase deploy --only hosting:<site>.
Landing page
The landing page is a static site inlanding/ (plain HTML/CSS, no build step). It is deployed to the muze-mus-landing Firebase site on every push to main.
Deployment checklist
Before deploying:- All tests pass locally
- No TypeScript errors
- Environment variables are set in the Render dashboard and GitHub Environments
- Database migrations are compatible with running code
- No secrets in committed code
- Backend health check returns 200 (
GET /api/v1/health) - Frontend loads and login works
- API calls from the frontend succeed with no CORS errors
- Staging verified before merging to
main