Firebase Setup

This guide covers Firebase project setup, local environment configuration, service-account handling, and deployment basics for teams self-hosting CrowdCAD on Firebase infrastructure.

Prerequisites

Before setup, confirm Node.js (LTS recommended), npm, Git, and Firebase CLI are available, and that you have access to a Google account and a Firebase project.

  • • Node.js v18+ and npm
  • • Git and repository access
  • • Firebase project in the Firebase Console
  • • A local editor and browser for testing
Verify tooling
node -v
npm -v
git --version
# optional
# firebase --version

Create a Firebase project

If you do not already have a Firebase project, create one in the Firebase console and register a Web app. Copy the resulting Firebase client configuration values into your local environment.

High-level project creation
1. Open https://console.firebase.google.com and sign in.
2. Click Add project and complete project creation.
3. Open Project settings > General.
4. Under Your apps, add a Web app.
5. Copy apiKey, authDomain, projectId, storageBucket, messagingSenderId, and appId.

Local development environment

Add the public Firebase config to .env.local. These values are intended for client-side initialization and should match your Firebase Web app configuration.

.env.local
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project-id.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=1234567890
NEXT_PUBLIC_FIREBASE_APP_ID=1:1234567890:web:abcdef123456
Run locally
npm install
npm run dev

Service account for server tasks and CI

For server-side scripts, CI deploys, and admin tasks, use a Firebase service account credential and keep it out of source control.

Service account options
# Option A: base64 in environment
FIREBASE_SERVICE_ACCOUNT_JSON_BASE64=eyJ0eXAiOiJKV1Qi...

# Option B: mounted secret file path
FIREBASE_SERVICE_ACCOUNT_PATH=/secrets/firebase-service-account.json

Connect project and deploy hosting

Login with Firebase CLI, select your target project, initialize hosting if needed, then build and deploy.

CLI flow
npm install -g firebase-tools
firebase login
firebase projects:list
firebase use --add
firebase init hosting
npm run build
firebase deploy --only hosting

For broader deployment, governance, and operational responsibility guidance, continue with the Self-hosting documentation.

Notes and support

Keep all secrets outside version control, configure CI environment variables in your hosting platform, and validate access controls before production use.

For setup assistance, contact support@crowdcad.org.