This folder contains the backend api of the application.
There are three environments that the backend runs in: production
, dev
, and test
, each with their own database. production
is set on deployment, dev
is set whenever running locally, and test
is set when tests are running. These environments are automatically set based on the task.
As of 02/04/2022, only the dev environment is available.
First, make sure you have Node.js and npm installed.
Also, make sure you have yarn installed.
Next, run cd api
to move to this directory.
To install all of the required node packages, run:
yarn install
Then, set the necessary environment variables by creating a development.env
file in the api
folder. Populate the file with the following:
NODE_ENV=development
PORT=3000
MONGO_URL=
EXPO_CLIENT_ID=
You can obtain MONGO_URL
by creating a MongoDB Atlas Database and the EXPO_CLIENT_ID
by creating Google OAuth credentials.
Finally, run:
yarn start
This will create a server on http://localhost:3000.
To run the API at any future time, use the following command:
yarn start
Before commiting and pushing code to the remote repository, run the command below for linting and formatting:
yarn style
Built with Express and MongoDB.
The unit tests are written with Jest and SuperTest.
To test,
yarn test