Deployment Guide
This page covers how to deploy both the Synctech web app and the documentation site.
Prerequisites
- Node.js ≥ 18
- Firebase CLI installed and logged in (
firebase login) - Access to the Firebase project
drill-wise-estimator
Project structure
The monorepo has two Firebase Hosting targets:
| Target | Site ID | URL | Source |
|---|---|---|---|
app | drill-wise-estimator | https://app.synctech.app | apps/web/dist/ |
docs | synctech-docs | https://docs.synctech.app | apps/docs/build/ |
Both targets are defined in .firebaserc at the repo root.
Deploy the web app
# Build and deploy the React app to the app hosting target
npm run deploy
This runs npm run build (Vite) then firebase deploy --only hosting:app.
Deploy preview channel
npm run deploy:preview
Creates a temporary preview URL for review before going live.
Deploy the docs site
# Build and deploy the Docusaurus site to the docs hosting target
npm run deploy:docs
This runs npm run build:docs (Docusaurus) then firebase deploy --only hosting:docs.
Deploy both simultaneously
npm run build && npm run build:docs && firebase deploy --only hosting:app,hosting:docs
Firestore rules
Firestore security rules live at apps/web/firestore.rules. Deploy them independently:
cd apps/web
firebase deploy --only firestore:rules
Or together with the app:
firebase deploy --only hosting:app,firestore:rules
Environment variables
The web app reads Firebase config from environment variables in apps/web/.env:
VITE_FIREBASE_API_KEY=...
VITE_FIREBASE_AUTH_DOMAIN=...
VITE_FIREBASE_PROJECT_ID=...
VITE_FIREBASE_STORAGE_BUCKET=...
VITE_FIREBASE_MESSAGING_SENDER_ID=...
VITE_FIREBASE_APP_ID=...
Do not commit .env files. Use .env.example as a template.
CI/CD notes
The deploy.ps1 script at the repo root can be used in a CI pipeline. For GitHub Actions, store Firebase credentials as a secret (FIREBASE_TOKEN) and use the Firebase CLI --token flag.