A base web application for the PROVIDENT project.
yarn
yarn firebase login
Note
Only need to start the server now. The emulator for Firebase (backend database) and authentication have been disabled.
yarn serve
yarn build
yarn lint
Copy the .env.example file to create your own environment file:
cp .env.example .env.localImportant
Use .env.local (not .env) - this file is gitignored and won't be committed
Environment variables in Vite must be prefixed with VITE_ to be accessible in the browser
Never commit your actual API keys to version control
This project uses MapBox for map rendering. To get the map working properly, you'll need to set up an API key.
Open .env.local and add your actual API key:
VITE_MAPBOX_API_KEY=your_actual_api_key_here
Note
This is necessary if you want to run any of the scripts. Mainly setting up Firebase Admin allows you to read/write to the database
In order for firebase-admin to have read/write access, we need to include a private key.
- Navigate to the Firebase console to generate a private key (Settings > Service Accounts).
- Click Generate New Private Key and save the JSON file as
serviceAccount.json - Add that JSON file to the project root directory. This file is listed in the
.gitignore. Do not share this private key.
The firestore.rules file (in the repo) was used to test edits to the firestore rules against the firebase emulator. We no longer use the firebase emulator. Firebase Security Rules are editted and displayed live in the Firebase Console.
Note
Activity logging is to be migrated over to using only Google Analytics #338