Skip to content

Latest commit

 

History

History
74 lines (45 loc) · 1.91 KB

README.md

File metadata and controls

74 lines (45 loc) · 1.91 KB

7000 Languages API

This folder contains the backend api of the application.

Environments

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.

Getting Started

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.

Run

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

Technologies

Built with Express and MongoDB.

Code Style

Use ESLint with Prettier.

Testing

The unit tests are written with Jest and SuperTest.

To test,

yarn test