This is a fork of the original project. It's intended to set as a codebase for the final task for the students of the course 4 of Pilar Tecno.
You have the freedom to use any free or open API for your project. You may use as many as you need/want.
Some suggestions are:
- NASA API
- The Audio DB
- The cat facts
- API del Servicio de Normalización de Datos Geográficos de Argentina
You can browse more API's here.
Keep in mind some API's will need some registration and/or are free for trial purposes only.
The final task consists in you making three or more endpoints that must consume one external service API (like the ones listed before).
It is required that you pay special attention to the structure used for the endpoint. Make sure to use:
-
Routes.
-
Controllers.
-
Services.
-
Environment variables for sensitive data (like API keys or DB access).
In one of the three endpoints you code, it is required that you save the response to a Mongodb collection. You can use MongoDB Atlas for easy setup, or a local instance if you want.
It is required that the endpoints are protected with a JWT Token. The endpoints should only allow users with the role "user" to use the endpoint.
JWT Refresh Token Implementation with Node.js Express and MongoDB. You can know how to expire the JWT, then renew the Access Token with Refresh Token.
For instruction, please visit:
The code in this post bases on previous article that you need to read first:
Node.js + MongoDB: User Authentication & Authorization with JWT
The diagram shows flow of how we implement User Registration, User Login and Authorization process.
And this is for Refresh Token:
Associations:
MongoDB One-to-One relationship tutorial with Mongoose examples
MongoDB One-to-Many Relationship tutorial with Mongoose examples
Fullstack:
Integration (run back-end & front-end on same server/port)
npm install
node server.js