- Just: A
Makefilealternative that run commands easily by creating ajustfileat the root of the project. Natively installed on all OS whereshcommand is available.
just installOr Manual installation:
npm --prefix ./functions install ./functions
npm --prefix ./functions run preparegcloud auth login
gcloud components update
gcloud config set project actions-dd2b5just startUsing this command, you will be able to open firebase admin panel to see and navigate inside the application data.
just devThen in another console, you can run :
just testUsing this command, there will be no firebase admin panel available but an optimal firestore instance to run unit tests.
Be sure you have an instance of the emulator running using just start.
The fixture script :
- Generate a fake user.
- Give him 5 default actions.
- Will generate a default
statsdoc, defaultchallengesdoc & defaultbadgedoc. - Will recalculate the carbon impact based on each of these 5 actions.
- Will recalculate if this user will have completed challenges or completed badges.
You can load fixtures using:
just importIn the app, there are CRON / periodic tasks that will run each day.
There are located inside: ./functions/modules/crons/index.js.
You may want to test them locally to see if the modification they will do are doing the way you expect it. To do so, you can run the logic of this periodic task locally.
# Run all CRON of the app
just cron
# Run all CRON about the reset of stats each day
just cron dayTo see if there are more / missing cron task, you can check inside:
- ./functions/modules/crons/index.js.
- ./functions/modules/crons/run-cron-locally.js.
- ./justfile (check for the
croncommand).
GCloud credential issue
If you see the GCloud error Could not load the default credentials, you can run the command:
just test-initThen, connect to GCloud using the email used for this project.
Where are stored information about the data structure?
You can find the description of entities inside the DATABASE.md file.
I can't find or remember the command I want to run.
You can run the command just help to see the list of available commands in this project. Each command has an alternative manual way to do so.