Create a project on Firebase and enable the following modules: Authentication, Firestore, Hosting and Functions.
For sending notification emails, the application needs an SMTP relay service such as SendGrid:
- Create a free account on SendGrid
- Create an API key for SMTP relay
- Install the Trigger Email extension in your Firebase project and configure it with the SendGrid API key.
- Rename
extensions/firestore-send-email.env.template
intoextensions/firestore-send-email.env.template
and edit it to change<your_name>
,<your_email_address>
and<your_api_key>
with your SendGrid API key.
For search capabilities, the application uses Algolia:
- Create a free account on Algolia.
- Create an application
- Create two indexes named,
prod_steps
andprod_runs
- Inside the
prod_runs
index, create replicastitle_asc
,title_desc
,status_asc
andstatus_desc
- Import the configuration for each of these indexes and replicas, using the provided
algolia-*.json
files - Rename
extensions/firestore-algolia-search.env.template
intoextensions/firestore-algolia-search.env
and fill in the missing info (see this for more explanations) - Install the Firestore Algolia Search extension in your Firebase project and configure it with the settings from
extensions/firestore-algolia-search.env
- Rename
extensions/firestore-algolia-search-runs.env.template
intoextensions/firestore-algolia-search-runs.env
and fill in the missing info - Install the Firestore Algolia Search extension again, this time with the name
firestore-algolia-search-runs
, and use the settings fromextensions/firestore-algolia-search-runs.env
Rename src/firebase.creds.json.temp
into src/firebase.creds.json
and edit it with the credential from the Firebase project.
Rename src/conf.json.temp
into src/conf.json
and fill in the required info.
Connect to your Firebase project:
npm install -g firebase-tools
firebase login
Install project dependencies:
npm install
To make some local tests without interacting with the production environment, you can run emulators for all the Firebase services (except Hosting).
Optional: to have Cloud functions working, you need to set up the GOOGLE_APPLICATION_CREDENTIALS
environment variable, see here. Otherwise, it will call the production environment.
Run the following command to start the emulators:
firebase emulators:start
Edit src/conf.json
to set useEmulators
to true
, for the React app to use them.
Copy
Then, see below to run the React app either in development or production mode.
npm run start
to run the app in the development mode.
Open http://localhost:3000 to view it in your browser.
To populate the database with random data:
npx tsx scripts/populate.ts
For unit testing, run npm run test
.
npm install -g serve
npm run build && serve -s build
npm run build && firebase deploy