Simple report generation API created in NodeJS, Express and MongoDB with third party API integrations.
This project is being created with the purpose of reporting the violations taken to prevent the SarsCoV-2 virus. This API works as a fast report generator and visualizer of the dairy cases in the world, specific countries and your in your current location. Report generation only available for Dominican Republic.
This project is created with:
- NodeJS
- Typescript
- Express
- MongoDB
- Mocha/Chai
- Redis
To clone and run locally this API, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:
# Clone this repository
$ git clone https://github.com/MoisesTabar/CovidReportsAPI
# Go into this repository
$ cd Covid-Reports-API
# Install dependencies
$ npm install
# Run it
$ npm run start
npm run test
Starts the test cases once
npm run dev
Starts the app in development mode using nodemon and ts-node to do hot reloading
npm run build
Builds the app at build, cleaning the build folder first
npm run start
Starts the app in production building the proyect with npm run build
and executing the compiled JavaScript at build/app.js
This API will include routes that will implemented different http methods(GET, POST, PUT, DELETE)expecting them to return 200 or 201 depending on the case. The following table will describe the different routes and what they are supose to respond when requesting them.
Routes | Functionalities | Code |
---|---|---|
/ |
Gets all cases | 200 |
/:country |
Gets all cases by country(Login required) | 200 |
/location |
Gets cases by current location | 200 |
/auth/login |
Logs in a signed in user | 200 |
/auth/signup |
Signs in an not existant user | 201 |
/reports/create |
Creates a report(Login required) | 201 |
/reports/update/:id |
Updates a report(Login required) | 202 |
/reports/delete/:id |
Deletes a report(Login required) | 202 |
Other technologies used to increase this API use is hashing and endpoint protection using the crypto module, Json Web Tokens. Also the implementation of rate limiters, caching and proxies to hide third party API calls.
- Design the API
- Document the API
- Scaffold the data
- Create routes and models
- Create controllers
- Finish homeController
- Create the logic of the users controller
- Make tests for the users routes
- Create the logic of the reports controller
- [] Finish reports controller
- Make tests for the report routes