- Description
- Technologies
- Installation
- Setting up environment variables
- Seeding the database
- Running tests with Jest
This project is an application created for the purpose of accessing application data programmatically.
The intention is to build a backend service for the Just Choose web app. The API will provide the information to the front end architecture.
Link to the hosted Just Choose here.
The technologies and packages used for this project are listed below:
- Typescript v4.4.3
- MongoDB v4.1.1
- TS-Node v27.0.5
Project dependencies:
Dev dependencies:
To install Just Choose API, follow these steps:
- Ensure you have the following installed:
- Fork and clone the repo
- Open the repo and install dependencies:
npm install
Variable environment files will need to be setup locally as they have been added to .gitignore
.
Create the following following files in the root directory:
.env.development
DATABASE_URL=mongodb://localhost/just-choose-test
Run the command to create the database locally and seed.
ts-node lib/db/seeds/seedLocalDb.ts
Information for schema structure including sample data, interfaces, and seeds can be found within the lib/db
folder.
The project was written with utilising TDD (Test Driven Development) as the main focus, the test suites for app.js
and utils.js
which tests all of the functionality of this backend service can be found in the __tests__
folder.
To run the tests:
npm test // run all tests
GET /api
GET /api/users
POST /api/users
GET /api/users/:email
PATCH /api/users/:email
POST /api/users/:email
GET /api/events
GET /api/eventsbyorganiser/:organiser
POST /api/events
GET /api/events/:eventName
GET /api/events/eventById/:eventId
PATCH /api/events/:eventName
GET /api/restaurants