API developed for the webapp TechMatch, with a database that relays on the MongoDB Atlas cloud. Swagger documentation can be found online.
🚀 Available online on Render!
The front-end of the application can be found at its GitHub repository.
🚀 Available online on Vercel!
- Express API with complete CRUD routes to Questions, including token authentication for adding, updating and deleting a question;
- Uses JSON Web Token (JWT) to authenticate and authorize tokens that lasts 1h;
- Implements NodeJS internal caching module for faster data retrieval from the database.
- Cloud MongoDB Atlas database with Questions collection;
- Full Swagger documentation following the OpenAPI Specification;
- Complete Postman collection containing all the REST API tests and a full detailed description;
- You can download the JSON file of the Postman collection and import it directly to your Postman to check the full API description and request examples;
- At Postman, follow
Import > Select file
to correctly import the collection and use it.
- End-to-end tests for the API endpoints built with Jest and Supertest.
- Performs unit tests on a development environment using MongoDB In-Memory Server to run an in-memory MongoDB instance and preserve the actual data.
Route | Method | Description |
---|---|---|
/questions |
POST | Creates a new question |
/questions |
GET | Gets all questions |
/questions/:id |
GET | Gets a specific question by its ID |
/questions/:id |
PUT | Updates a specific question by its ID |
/questions/:id |
DELETE | Deletes a specific question by its ID |
Route | Method | Description |
---|---|---|
/auth |
POST | Authenticates the admin credentials and generates an JWT token that allows creating, updating and deleting questions |
Route | Method | Description |
---|---|---|
/docs |
GET | Swagger API documentation |
FieldName | Type | Required |
---|---|---|
_id |
ObjectId | true |
category |
String | true |
question |
String | true |
FieldName | Type | Required |
---|---|---|
user |
String | true |
password |
String | true |
The user admin model is solely used for authenticating the API admin with a JWT token and doesn't represent a database collection.
Camila Barcellos |