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:
extensions/firestore-send-email.env.template
into extensions/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:
prod_steps
and prod_runs
prod_runs
index, create replicas title_asc
, title_desc
, status_asc
and status_desc
algolia-*.json
filesextensions/firestore-algolia-search.env.template
into extensions/firestore-algolia-search.env
and fill in the missing info (see this for more explanations)extensions/firestore-algolia-search.env
extensions/firestore-algolia-search-runs.env.template
into extensions/firestore-algolia-search-runs.env
and fill in the missing infofirestore-algolia-search-runs
, and use the settings from extensions/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