The following items are required to run this project:
- Node 16: Used for the app, api and cli (Tip: use NVM)
- Java: used by the Firebase emulators (Make sure that JAVA_HOME is set. Tip: use JENV)
- You need to create a firebase project (See: https://console.firebase.google.com - You will need to config for your firebase project in the .env files, .firestorerc)
- Firebase CLI (See: https://firebase.google.com/docs/cli)
- Fork the repo
Go to: https://github.com/COS-301/miniproject-2023/fork
- Clone your fork
git clone [email protected]:<ACCOUNT>/<PROJECT NAME>.git <PROJECT LOCAL NAME>
- Install dependencies
cd path/to/project
yarn
- Add Firebase configurations
See files:
- .firebaserc
- .env
- .env.pod
and find and replace "<REPLACE_ME>"
- Run the stack:
Run these commands in separate terminals:
yarn start:api:dev
yarn start:emulators
yarn start:app:dev
- CLI:
If you want to run the cli for admin, scripts, migrations etc.
yarn build:cli:prod
GOOGLE_APPLICATION_CREDENTIALS=.keys/<REPLACE ME WITH SERVICE ACCOUNT KEY.json> FIRESTORE_EMULATOR_HOST=localhost:5003 node dist/apps/cli/main.js <REPLACE ME WITH COMMAND>
Once the emulators are up, please go to http://localhost:5001 to see the Emulator UI
- When creating your Firebase authentication, hosting, storage, functions. Make sure to use the same location throughout. (MAKE SURE TO SET "Default GCP resource location" in Project Settings in Firebase Console. If you do not do this, the app will not work)
- The app is built to be a PWA. (See: So if you deploy it to prod, you can install the app on iOS by adding to home screen or using Android by installing through Chrome)