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.
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 asyou@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
warnorWARNINGcan 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:
git --versionIf 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:
winget install -e --id Git.GitThe 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:
git --versiongit version 2.51.0.windows.1Step 2: Install Node.js
Node.js runs CrowdCAD's setup scripts. It includes npm, which downloads the packages CrowdCAD needs.
- Go to nodejs.org/en/download.
- Download the macOS Installer (.pkg) for the version marked LTS.
- Open the downloaded file and click through the installer with the default options.
- Close Terminal and open a new Terminal window.
Run this in PowerShell and click Yes if Windows asks for permission:
winget install -e --id OpenJS.NodeJS.LTSClose 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.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedIf it asks Do you want to change the execution policy?, type Y and press Enter.
Check that Node.js and npm work:
node -vnpm -vv22.20.0
10.9.3node -vnpm -vv22.20.0
10.9.3Step 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.
- Open github.com/crowdcad/crowdcad while signed in to GitHub.
- Click Fork near the top right of the page.
- 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.
cd ~cd ~Now download (clone) your fork. Paste the command, replace YOUR_USERNAME with your GitHub username and press ReturnEnter:
git clone https://github.com/YOUR_USERNAME/crowdcad.gitCloning into 'crowdcad'...
Resolving deltas: 100%, done.git clone https://github.com/YOUR_USERNAME/crowdcad.gitCloning into 'crowdcad'...
Resolving deltas: 100%, done.Move into the new folder. Every remaining command in this guide runs from inside it.
cd crowdcadcd crowdcadStep 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.
git remote add upstream https://github.com/crowdcad/crowdcad.gitgit remote add upstream https://github.com/crowdcad/crowdcad.gitCheck both connections:
git remote -vorigin 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)git remote -vorigin 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.
npm installadded 1024 packages in 1mnpm installadded 1024 packages in 1mPart 3: Set up Firebase
These steps happen in your web browser. Keep the terminal open for later.
Step 8: Create a Firebase project
- Go to console.firebase.google.com and sign in with your Google account.
- Click Create a project (or Get started with a Firebase project).
- Name it, for example
crowdcad-your-team. Under the name, Firebase shows a project ID such ascrowdcad-your-team-1a2b3. Write the project ID down. You will need it in step 15. - Continue through the next screens. You can turn off Google Analytics and the AI assistant.
- Click Create project, wait a minute, then click Continue.
Step 9: Turn on email and password sign-in
- 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.
- Click Get started.
- On the Sign-in method tab, click Email/Password.
- Turn on the first switch (Email/Password). Leave "Email link" off. Click Save.
Step 10: Create the database
- 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.
- Click Create database. If asked to choose an edition, pick Standard.
- Leave the database ID as
(default). CrowdCAD only uses the default database. - Pick a location close to where your team works. It cannot be changed later.
- 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
- Click the gear icon next to Project Overview and choose Project settings.
- On the General tab, scroll to Your apps and click the web icon
</>. - Enter a nickname such as
CrowdCAD. Leave Firebase Hosting unchecked. Click Register app. - 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.
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:
cp .env.example .env.localCopy-Item .env.example .env.localThen open it in a text editor:
open -e .env.localnotepad .env.localStep 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 firebaseConfig | Line in .env.local |
|---|---|
apiKey | NEXT_PUBLIC_FIREBASE_API_KEY |
authDomain | NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN |
projectId | NEXT_PUBLIC_FIREBASE_PROJECT_ID |
storageBucket | NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET |
messagingSenderId | NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID |
appId | NEXT_PUBLIC_FIREBASE_APP_ID |
measurementId | NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID |
When you are done, the Firebase section of the file looks like this, with your own values:
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:abc123def456NEXT_PUBLIC_BACKENDshould stayfirebase.- If your
firebaseConfighas nomeasurementId, delete theNEXT_PUBLIC_FIREBASE_MEASUREMENT_IDline. - 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.
- 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.
- 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.
- Back in Storage, click Get started. For the lowest cost choose a location in
US-CENTRAL1,US-EAST1orUS-WEST1, start in production mode and click Create. - 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.
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:
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.comnpx -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.comAnswer 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:
npx -y firebase-tools deploy --only firestore:rules --project YOUR_PROJECT_ID✔ firestore: released rules firestore.rules to cloud.firestore
✔ Deploy complete!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
npm run dev ▲ Next.js 15.5.23
- Local: http://localhost:3000
✓ Ready in 3.2snpm run dev ▲ Next.js 15.5.23
- Local: http://localhost:3000
✓ Ready in 3.2s- When it says Ready, open http://localhost:3000 in your browser. The first page load takes a little longer.
- 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.
- In the Firebase console, open Project settingsService accounts and click Generate new private key, then Generate key. A
.jsonfile downloads. - Rename the downloaded file to
crowdcad-admin-key.jsonand move it into your home folder (/Users/your-nameC:\Users\your-name). Keep it out of thecrowdcadfolder. - In your second terminal window, run the command below. Replace
you@example.comwith the email you signed up with in step 16.
GOOGLE_APPLICATION_CREDENTIALS="$HOME/crowdcad-admin-key.json" node scripts/setAdmin.js you@example.comGranted admin access for you@example.com (uid: Xy12AbCdEf34GhIj)$env:GOOGLE_APPLICATION_CREDENTIALS="$HOME\crowdcad-admin-key.json"node scripts/setAdmin.js you@example.comGranted 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:
npm run buildnpm run buildnpm start ▲ Next.js 15.5.23
- Local: http://localhost:3000
- Network: http://192.168.1.20:3000
✓ Ready in 412msnpm start ▲ Next.js 15.5.23
- Local: http://localhost:3000
- Network: http://192.168.1.20:3000
✓ Ready in 412msKeep 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.
Step 19: Find this computer's address and share the link
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:
ipconfig getifaddr en0192.168.1.20If 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:
ipconfigWireless LAN adapter Wi-Fi:
IPv4 Address. . . . . . . . . . . : 192.168.1.20Find 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:
http://192.168.1.20:3000Step 20: Starting CrowdCAD again later
After a restart, or whenever you closed the terminal, open a terminal and run:
cd ~/crowdcadnpm startcd ~/crowdcadnpm startYou 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:
cd ~/crowdcadgit pull --no-rebase --no-edit upstream mainFrom https://github.com/crowdcad/crowdcad
Updating 8747b40..4a03ac8
Fast-forwardcd ~/crowdcadgit pull --no-rebase --no-edit upstream mainFrom https://github.com/crowdcad/crowdcad
Updating 8747b40..4a03ac8
Fast-forwardThis 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:
npm installnpm installnpx -y firebase-tools deploy --only firestore:rules --project YOUR_PROJECT_IDnpx -y firebase-tools deploy --only firestore:rules --project YOUR_PROJECT_IDnpm run buildnpm run buildnpm startnpm startTroubleshooting
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:
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:
cd ~/crowdcadcd ~/crowdcadUpdating 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:
git config --global user.name "Your Name"git config --global user.email "you@example.com"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.
git stashgit pull --no-rebase --no-edit upstream maingit stashgit pull --no-rebase --no-edit upstream mainIf 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.