Firebase Setup

Run CrowdCAD on your computer with Google Firebase storing the data in the cloud, then share a link with your team. This guide assumes no programming or terminal experience and walks through every step on a Mac or a Windows PC.

I'm using:
Steps below change to match your computer.

Before you start

By the end of this guide, CrowdCAD will run on this computer with its accounts and data stored in your own Firebase project, and teammates on the same network can open it from a link. Plan for about 45 to 75 minutes.

You will need:

  • A Mac running a recent version of macOSA Windows 10 or Windows 11 PC where you can install programs
  • A Google account for Firebase
  • An internet connection, both during setup and whenever CrowdCAD is in use

Terminal basics

The terminal is a window where you type instructions (called commands) instead of clicking buttons. This guide gives you every command. You never need to write your own.

To open Terminal: press ⌘+Space, type Terminal and press Return. A window opens with a line ending in %. That line is the prompt, and it means Terminal is ready for a command.

To open PowerShell: press the Windows key, type PowerShell and press Enter. A window opens with a line like PS C:\Users\you>. That line is the prompt, and it means PowerShell is ready for a command. Open it normally. You do not need "Run as administrator".

  • Running a command: click Copy on a command box in this guide, click inside your terminal window, paste with ⌘+VCtrl+V and press ReturnEnter. The %PS> at the start of each line in the boxes stands for the prompt. The Copy button leaves it out.
  • Wait for the prompt. Some commands finish instantly and some take several minutes. When the prompt comes back, the command is done and you can run the next one.
  • Replace placeholders. Words in capitals such as YOUR_USERNAME, and example values such as you@example.com, are placeholders. After pasting, use the arrow keys to move to them and type your own value before pressing ReturnEnter.
  • Stopping a command: press Ctrl+C (Control, also on a Mac).
  • Warnings are normal. Lines with warn or WARNING can usually be ignored. If a command ends with an error, check Troubleshooting at the bottom of this page.
  • After installing a program, close the terminal window and open a new one so it can find the program.

Part 1: Install the tools

Step 1: Install Git

Git downloads CrowdCAD's code and later pulls in updates. You only install it once.

Run this in Terminal:

Terminal
git --version

If a version number such as git version 2.39.5 appears, Git is already installed. Go to the next step.

If a window says the command line developer tools are required, click Install, then Agree, and wait for it to finish (about 5 to 15 minutes). Then run git --version again to confirm.

Run this in PowerShell:

Windows PowerShell
winget install -e --id Git.Git

The first time you use winget it asks you to accept its terms. Type Y and press Enter. If Windows asks whether to allow the installer to make changes, click Yes.

When it finishes, close PowerShell, open a new PowerShell window and check the install:

Windows PowerShell
git --version
git version 2.51.0.windows.1

Step 2: Install Node.js

Node.js runs CrowdCAD's setup scripts. It includes npm, which downloads the packages CrowdCAD needs.

  1. Go to nodejs.org/en/download.
  2. Download the macOS Installer (.pkg) for the version marked LTS.
  3. Open the downloaded file and click through the installer with the default options.
  4. Close Terminal and open a new Terminal window.

Run this in PowerShell and click Yes if Windows asks for permission:

Windows PowerShell
winget install -e --id OpenJS.NodeJS.LTS

Close PowerShell and open a new window. Next, allow PowerShell to run the small scripts that come with Node.js. Without this, commands such as npm stop with "running scripts is disabled on this system". This setting only affects your own Windows account.

Windows PowerShell
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

If it asks Do you want to change the execution policy?, type Y and press Enter.

Check that Node.js and npm work:

Terminal
node -v
npm -v
v22.20.0 10.9.3
Windows PowerShell
node -v
npm -v
v22.20.0 10.9.3
Any Node.js version of 20 or higher works.

Step 3: Create a free GitHub account

CrowdCAD's code is hosted on GitHub. You need a free account to make your own copy. If you already have one, sign in and skip this step.

Go to github.com/signup and follow the prompts. Remember your username. You will use it in a later step.

Part 2: Get your own copy of CrowdCAD

Step 4: Make your own copy (fork) on GitHub

A fork is your own copy of CrowdCAD on GitHub. It belongs to you, it can hold your organization's changes, and it stays connected to the original so you can pull in new releases.

  1. Open github.com/crowdcad/crowdcad while signed in to GitHub.
  2. Click Fork near the top right of the page.
  3. Leave the owner as your username and the name as crowdcad, keep Copy the main branch only checked and click Create fork.

GitHub opens your fork at github.com/YOUR_USERNAME/crowdcad. From here on, the original crowdcad/crowdcad is called upstream: it is where new CrowdCAD releases come from.

Step 5: Download your fork to this computer

First move the terminal to your home folder. cd means "change directory", and ~ is a shortcut for your home folder.

Terminal
cd ~
Windows PowerShell
cd ~

Now download (clone) your fork. Paste the command, replace YOUR_USERNAME with your GitHub username and press ReturnEnter:

Terminal
git clone https://github.com/YOUR_USERNAME/crowdcad.git
Cloning into 'crowdcad'... Resolving deltas: 100%, done.
Windows PowerShell
git clone https://github.com/YOUR_USERNAME/crowdcad.git
Cloning into 'crowdcad'... Resolving deltas: 100%, done.

Move into the new folder. Every remaining command in this guide runs from inside it.

Terminal
cd crowdcad
Windows PowerShell
cd crowdcad

Step 6: Connect your copy to the original (upstream)

Your download already knows about your fork, under the name origin. This command also connects it to the original CrowdCAD, under the name upstream, so you can download future updates with one command.

Terminal
git remote add upstream https://github.com/crowdcad/crowdcad.git
Windows PowerShell
git remote add upstream https://github.com/crowdcad/crowdcad.git

Check both connections:

Terminal
git remote -v
origin https://github.com/YOUR_USERNAME/crowdcad.git (fetch) origin https://github.com/YOUR_USERNAME/crowdcad.git (push) upstream https://github.com/crowdcad/crowdcad.git (fetch) upstream https://github.com/crowdcad/crowdcad.git (push)
Windows PowerShell
git remote -v
origin https://github.com/YOUR_USERNAME/crowdcad.git (fetch) origin https://github.com/YOUR_USERNAME/crowdcad.git (push) upstream https://github.com/crowdcad/crowdcad.git (fetch) upstream https://github.com/crowdcad/crowdcad.git (push)

Step 7: Download CrowdCAD's packages

This downloads the code libraries CrowdCAD is built from into a node_modules folder inside crowdcad.

Terminal
npm install
added 1024 packages in 1m
Windows PowerShell
npm install
added 1024 packages in 1m
Takes 1 to 5 minutes. Lines starting with 'npm warn' are normal.

Part 3: Set up Firebase

These steps happen in your web browser. Keep the terminal open for later.

Step 8: Create a Firebase project

  1. Go to console.firebase.google.com and sign in with your Google account.
  2. Click Create a project (or Get started with a Firebase project).
  3. Name it, for example crowdcad-your-team. Under the name, Firebase shows a project ID such as crowdcad-your-team-1a2b3. Write the project ID down. You will need it in step 15.
  4. Continue through the next screens. You can turn off Google Analytics and the AI assistant.
  5. Click Create project, wait a minute, then click Continue.

Step 9: Turn on email and password sign-in

  1. Open Authentication from the left sidebar of the Firebase console. It may sit inside a category such as Build, or you can type "Authentication" into the search bar at the top.
  2. Click Get started.
  3. On the Sign-in method tab, click Email/Password.
  4. Turn on the first switch (Email/Password). Leave "Email link" off. Click Save.

Step 10: Create the database

  1. Open Firestore Database from the left sidebar of the Firebase console. It may sit inside a category such as Build, or you can type "Firestore Database" into the search bar at the top.
  2. Click Create database. If asked to choose an edition, pick Standard.
  3. Leave the database ID as (default). CrowdCAD only uses the default database.
  4. Pick a location close to where your team works. It cannot be changed later.
  5. Choose Start in production mode and click Create.

Production mode locks the database until CrowdCAD's own security rules are uploaded in step 15.

Step 11: Register CrowdCAD as a web app

  1. Click the gear icon next to Project Overview and choose Project settings.
  2. On the General tab, scroll to Your apps and click the web icon </>.
  3. Enter a nickname such as CrowdCAD. Leave Firebase Hosting unchecked. Click Register app.
  4. Firebase shows a block of code containing const firebaseConfig = {. Keep this page open for the next step. You can find it again any time under Project settingsGeneralYour apps.
What Firebase shows (your values differ)
const firebaseConfig = {
  apiKey: "AIzaSy...",
  authDomain: "your-project-id.firebaseapp.com",
  projectId: "your-project-id",
  storageBucket: "your-project-id.firebasestorage.app",
  messagingSenderId: "123456789012",
  appId: "1:123456789012:web:abc123def456"
};

Part 4: Connect CrowdCAD to Firebase

Step 12: Create your settings file

CrowdCAD reads its settings from a file named .env.local. Make it by copying the example file that came with the download:

Terminal
cp .env.example .env.local
Windows PowerShell
Copy-Item .env.example .env.local

Then open it in a text editor:

Terminal
open -e .env.local
This opens the file in TextEdit.
Windows PowerShell
notepad .env.local
This opens the file in Notepad.

Step 13: Paste in your Firebase settings

Copy each value from the firebaseConfig block in your browser into the matching line of .env.local. Copy only the text between the quotation marks, and don't add quotation marks or spaces in the file.

In firebaseConfigLine in .env.local
apiKeyNEXT_PUBLIC_FIREBASE_API_KEY
authDomainNEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
projectIdNEXT_PUBLIC_FIREBASE_PROJECT_ID
storageBucketNEXT_PUBLIC_FIREBASE_STORAGE_BUCKET
messagingSenderIdNEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID
appIdNEXT_PUBLIC_FIREBASE_APP_ID
measurementIdNEXT_PUBLIC_FIREBASE_MEASUREMENT_ID

When you are done, the Firebase section of the file looks like this, with your own values:

.env.local
NEXT_PUBLIC_BACKEND=firebase
NEXT_PUBLIC_FIREBASE_API_KEY=AIzaSy...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project-id.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project-id.firebasestorage.app
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=123456789012
NEXT_PUBLIC_FIREBASE_APP_ID=1:123456789012:web:abc123def456
  • NEXT_PUBLIC_BACKEND should stay firebase.
  • If your firebaseConfig has no measurementId, delete the NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID line.
  • Leave the PocketBase lines as they are. They are ignored.

Save with ⌘+SCtrl+S and close the editor.

Step 14: Optional: turn on map image uploads (Blaze plan)

Skip this step if you don't need to upload venue map images yet. Everything else works without it.

  1. Open Storage from the left sidebar of the Firebase console. It may sit inside a category such as Build, or you can type "Storage" into the search bar at the top.
  2. Click Upgrade project and follow the prompts to add a billing account and switch to the Blaze plan. When offered, set a budget alert (for example $5) so Google emails you before any real charges.
  3. Back in Storage, click Get started. For the lowest cost choose a location in US-CENTRAL1, US-EAST1 or US-WEST1, start in production mode and click Create.
  4. Open the Rules tab, replace everything in the editor with the rules below and click Publish. They let signed-in users upload images up to 20 MB into the venue map folder.
Storage rules
rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /venue_maps/{file} {
      allow read: if request.auth != null;
      allow write: if request.auth != null
        && request.resource.size < 20 * 1024 * 1024
        && request.resource.contentType.matches('image/.*');
    }
  }
}

Step 15: Upload CrowdCAD's security rules

CrowdCAD comes with rules that control who can read and change each venue, event and log. This step uploads them to your database with the Firebase command-line tool. First, sign in:

Terminal
npx -y firebase-tools login
? Allow Firebase to collect CLI and Emulator Suite usage and error reporting information? (Y/n) ✔ Success! Logged in as you@gmail.com
Windows PowerShell
npx -y firebase-tools login
? Allow Firebase to collect CLI and Emulator Suite usage and error reporting information? (Y/n) ✔ Success! Logged in as you@gmail.com
The first run downloads the Firebase tools, which takes a minute.

Answer the question with Y or n (either is fine) and press ReturnEnter. A browser window opens. Choose your Google account and click Allow, then return to the terminal.

Now upload the rules. Replace YOUR_PROJECT_ID with the project ID from step 8:

Terminal
npx -y firebase-tools deploy --only firestore:rules --project YOUR_PROJECT_ID
✔ firestore: released rules firestore.rules to cloud.firestore ✔ Deploy complete!
Windows PowerShell
npx -y firebase-tools deploy --only firestore:rules --project YOUR_PROJECT_ID
✔ firestore: released rules firestore.rules to cloud.firestore ✔ Deploy complete!

Part 5: Run CrowdCAD

Step 16: Start CrowdCAD and create your account

Terminal
npm run dev
▲ Next.js 15.5.23 - Local: http://localhost:3000 ✓ Ready in 3.2s
Windows PowerShell
npm run dev
▲ Next.js 15.5.23 - Local: http://localhost:3000 ✓ Ready in 3.2s
  1. When it says Ready, open http://localhost:3000 in your browser. The first page load takes a little longer.
  2. Click Sign In, then Sign Up under "Don't have an account?", and create an account with your email and a password of at least 6 characters.

Step 17: Make yourself a CrowdCAD admin

Admins can manage the certification list and give admin access to others from ProfileAdmin. The first admin is set with a private key file that lets a script change your account.

  1. In the Firebase console, open Project settingsService accounts and click Generate new private key, then Generate key. A .json file downloads.
  2. Rename the downloaded file to crowdcad-admin-key.json and move it into your home folder (/Users/your-nameC:\Users\your-name). Keep it out of the crowdcad folder.
  3. In your second terminal window, run the command below. Replace you@example.com with the email you signed up with in step 16.
Terminal
GOOGLE_APPLICATION_CREDENTIALS="$HOME/crowdcad-admin-key.json" node scripts/setAdmin.js you@example.com
Granted admin access for you@example.com (uid: Xy12AbCdEf34GhIj)
Windows PowerShell
$env:GOOGLE_APPLICATION_CREDENTIALS="$HOME\crowdcad-admin-key.json"
node scripts/setAdmin.js you@example.com
Granted admin access for you@example.com (uid: Xy12AbCdEf34GhIj)

Refresh CrowdCAD in your browser to see the Admin section in your profile. From now on you can make other people admins from ProfileAdminManage Admins.

Part 6: Share CrowdCAD with your team

npm run dev is meant for trying things out. For real use, run the faster production version and share its link with devices on the same Wi-Fi or wired network.

Step 18: Start the production version

In the terminal running npm run dev, press Ctrl+C to stop it. Then run these two commands, one at a time:

Terminal
npm run build
Windows PowerShell
npm run build
Prepares the production version. Takes 1 to 3 minutes.
Terminal
npm start
▲ Next.js 15.5.23 - Local: http://localhost:3000 - Network: http://192.168.1.20:3000 ✓ Ready in 412ms
Windows PowerShell
npm start
▲ Next.js 15.5.23 - Local: http://localhost:3000 - Network: http://192.168.1.20:3000 ✓ Ready in 412ms

Keep this window open while CrowdCAD is in use. If macOS asks whether node should accept incoming network connections, click Allow.a Windows Security window says the firewall blocked Node.js, check Private networks and click Allow.

The Network line printed by npm start is the link to share. If it is missing, find the address yourself:

Other devices reach this computer through its IP address on your network, which looks like 192.168.1.20.

Run this in Terminal. It prints the Wi-Fi address:

Terminal
ipconfig getifaddr en0
192.168.1.20

If nothing prints (for example on a wired connection), open Apple menuSystem SettingsNetwork, click the connection marked Connected and click Details. The address is listed as IP address.

Run this in PowerShell:

Windows PowerShell
ipconfig
Wireless LAN adapter Wi-Fi: IPv4 Address. . . . . . . . . . . : 192.168.1.20

Find the IPv4 Address under the adapter you are using (Wi-Fi or Ethernet). Ignore adapters named vEthernet or WSL.

Teammates on the same network open that address with :3000 on the end:

Link to share
http://192.168.1.20:3000

Step 20: Starting CrowdCAD again later

After a restart, or whenever you closed the terminal, open a terminal and run:

Terminal
cd ~/crowdcad
npm start
Windows PowerShell
cd ~/crowdcad
npm start

You only need npm run build again after changing .env.local or updating CrowdCAD.

Part 7: Updating CrowdCAD

New versions of CrowdCAD come out regularly. Updating downloads them from upstream (the original repository you connected in step 6), uploads any new security rules and rebuilds your copy. Your accounts and data stay in Firebase and are not affected. First stop CrowdCAD with Ctrl+C in the window where it is running.

Step 21: Download the latest version from upstream

New CrowdCAD releases are published to the original repository (upstream). Open a terminal, go to your CrowdCAD folder and pull them in:

Terminal
cd ~/crowdcad
git pull --no-rebase --no-edit upstream main
From https://github.com/crowdcad/crowdcad Updating 8747b40..4a03ac8 Fast-forward
Windows PowerShell
cd ~/crowdcad
git pull --no-rebase --no-edit upstream main
From https://github.com/crowdcad/crowdcad Updating 8747b40..4a03ac8 Fast-forward

This downloads the newest code from upstream and merges it into your copy. Your .env.local settings and your data are left alone. If it prints Already up to date., there is nothing new.

See what changed in each release on the changelog.

Step 22: Redeploy the new version

Run these one at a time, waiting for the prompt to return after each:

Terminal
npm install
Windows PowerShell
npm install
Downloads any new packages the update needs.
Terminal
npx -y firebase-tools deploy --only firestore:rules --project YOUR_PROJECT_ID
Windows PowerShell
npx -y firebase-tools deploy --only firestore:rules --project YOUR_PROJECT_ID
Uploads any security rule changes. Replace YOUR_PROJECT_ID as in step 15.
Terminal
npm run build
Windows PowerShell
npm run build
Rebuilds the production version.
Terminal
npm start
Windows PowerShell
npm start
Starts the new version. Keep this window open.

Troubleshooting

Click a problem to see how to fix it.

"Missing required Firebase env vars"

One of the values in step 13 is missing or the file was not saved. Open .env.local, check every NEXT_PUBLIC_FIREBASE_ line has a value, save, then stop CrowdCAD with Ctrl+C and start it again. If you use npm start, run npm run build first.

"Missing or insufficient permissions", or nothing saves

The security rules were not uploaded to this project. Run step 15 again and check that YOUR_PROJECT_ID matches NEXT_PUBLIC_FIREBASE_PROJECT_ID in .env.local exactly.

Sign-up says "auth/operation-not-allowed"

Email and password sign-in is turned off. Repeat step 9.

Sign-up says "auth/invalid-api-key"

The apiKey value in .env.local is wrong. Copy it again from step 11 without quotation marks or spaces, save and restart CrowdCAD.

Sign-in from another device says "auth/unauthorized-domain"

In the Firebase console, open AuthenticationSettingsAuthorized domains, click Add domain and add this computer's IP address (for example 192.168.1.20).

Map image upload fails

Uploading venue maps needs Cloud Storage, which requires the Blaze plan. Complete step 14, including the rules.

"Error: Failed to get Firebase project" or "Failed to authenticate"

The project ID is wrong or the Firebase tools are signed in to a different Google account. Check the project ID in Project settingsGeneral, then run npx -y firebase-tools login again.

setAdmin says "There is no user record corresponding to the provided identifier"

The email does not match an account. Sign up in CrowdCAD first (step 16), then run step 17 with exactly that email.

"Port 3000 is in use"

CrowdCAD is already running in another terminal window. Use that one, or stop it with Ctrl+C before starting again.

Other devices can't open the link
  • Check the other device is on the same Wi-Fi or wired network (not a guest network or mobile data).
  • Type the address exactly, starting with http:// and ending in :3000.
  • Allow Node.js through the firewall when asked (step 18).
"command not found" or "is not recognized as the name of a cmdlet"

The terminal cannot find the program. Close the terminal, open a new one and try again. If it still fails, repeat the install step for that program (Git, Node.js or Docker).

"running scripts is disabled on this system" (Windows)

PowerShell is blocking npm's helper scripts. Run this once, answer Y, then retry your command:

Windows PowerShell
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
"not a git repository" or "Could not read package.json"

The terminal is not inside your CrowdCAD folder. Move into it and retry:

Terminal
cd ~/crowdcad
Windows PowerShell
cd ~/crowdcad
Updating says "Please tell me who you are"

Git needs a name and email to record the update on your computer. Set them once (use your own details), then run the update command again:

Terminal
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Windows PowerShell
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Updating says "Your local changes would be overwritten"

A file that came with CrowdCAD was edited on this computer. If you did not mean to change it, this command sets your edits aside and the update can run. Your .env.local is not affected.

Terminal
git stash
git pull --no-rebase --no-edit upstream main
Windows PowerShell
git stash
git pull --no-rebase --no-edit upstream main

If you meant to change it, ask for help in the CrowdCAD Discord before continuing.

Still stuck? Ask in the CrowdCAD Discord or email support@crowdcad.org. Include the step number and the exact message you see. Never share your key file or passwords.

Next steps

  • Read the privacy guidance before entering real patient information. Organizations handling protected health information on Firebase need a signed Business Associate Agreement (BAA) with Google.
  • Review your organization's responsibilities on the self-hosting page.
  • Ready to put CrowdCAD on the internet with its own web address? The technical Firebase guide covers Firebase Hosting and other hosting options.