After you clone the repository, run
npm install
create a .env
file in the "backend" folder
Create an account here to use mongo: https://cloud.mongodb.com/
Create an account here to use the email api: https://www.mailjet.com/
Please contact Victor or Anson if you do not know how to set it up
ATLAS_URI=<YOUR_MONGO_ATLAS_URI_HERE>
MAILJET_API_KEY=<YOUR_MAILJET_API_KEY>
MAILJET_SECRET_KEY=<YOUR_MAILJET_SECRET_KEY>
FINANCE_EMAIL=<EMAIL_WHERE_YOU_WANT_TO_SEND_FROM>
EMAIL_RECIPIENTS=<EMAILS_TO_RECEIVE_SEPERATED_BY_COMMA_(NO_SPACE)>
CLIENT_URL=http://localhost:3000
In order to run the cron that updates the db from the WATO members spreadsheet, please contact Victor or Anson for the following variables you will add in your .env
GOOGLE_SHEET_ID=<WATO_MEMBERS_SPREADSHEET_ID>
SHEET_TAB_ID=<WATO_MEMBERS_SPREADSHEET_TAB_ID>
SERVICE_ACCOUNT_EMAIL=<DISCORD_AUTOMATION_SERVICE_ACCOUNT>
SERVICE_ACCOUNT_PRIVATE_KEY=<DISCORD_AUTOMATION_SERVICE_ACCOUNT_PRIVATE_KEY>
In order to upload attachments, AWS credentials are needed. To access a role that is already set up with policies on WATonomous' AWS account, please contact Victor.
AWS_SECRET_ACCESS_KEY=<YOUR_SECRET_ACCESS_KEY>
AWS_ACCESS_KEY_ID=<YOUR_ACCESS_KEY>
AWS_FINANCE_BUCKET_NAME=<S3_BUCKET_NAME>
To start the server, run
npm install -g nodemon
cd backend
nodemon start
To generate seed data, in the terminal in the backend directory, run:
npm run seeddata
Note that this step is not optional due to the fact we need to inject wato cash's id as it is a special case for a funding item.
Create an account here to get authentication working: https://firebase.google.com/
- Create a project at
console.firebase.google.com
- Name it
wato-finance-system
- Select parent resource/organization as
watonomous.ca
- Optionally add analytics then wait for project to be created
- In the Project Overview screen, add your app by web app
- Provide a nickname (
watofinance
) and do not enable Firebase Hosting - Look for the
firebaseConfig
constant and fill in the following info in the.env
file you create in the "frontend" folder
REACT_APP_API_KEY=<YOUR_FIREBASE_API_KEY>
REACT_APP_AUTH_DOMAIN=<YOUR_FIREBASE_AUTH_DOMAIN>
REACT_APP_PROJECT_ID=<YOUR_FIREBASE_PROJECT_ID>
REACT_APP_STORAGE_BUCKET=<YOUR_FIREBASE_STORAGE_BUCKET>
REACT_APP_MESSAGING_SENDER_ID=<YOUR_FIREBASE_MESSAGING_SENDER_ID>
REACT_APP_APP_ID=<YOUR_FIREBASE_API_ID>
REACT_APP_BACKEND_URL=http://localhost:5000
- To be able to use
firebase-admin
, select the gear icon next to the Project Overview screen - Go to Project Settings > Service Accounts and generate a new private key
- Name the file
serviceAccountKey.json
and paste the JSON file in the "backend" folder
- In your Firebase Console, select Authentication on the left sidebarw
- Select the Sign-in method tab, select Google, and then select Enable
- Project public-facing name does not matter for dev environment, give it a nickname (
watofinance
) or not - Set Project support email to your own email
- Select Save and ensure that the Google Provider has the Enabled Status
- If you would like to change your authorization for debugging, set
REACT_APP_AUTH_OVERRIDE=ADMIN | TEAM_CAPTAIN | DIRECTOR
in the frontend env, andAUTH_OVERRIDE=ADMIN | TEAM_CAPTAIN | DIRECTOR
in the backend env.
To start the frontend, in a different terminal run
cd frontend
npm start
If you have created a pr and are getting failed pipelines due to prettier, run npx prettier -w .
in the root directory
You can also configure prettier to run on save, by installing prettier and following this guide