The backend solution is an API for managing employees with just 3 controllers, using MongoDB for persistence, request validation with express-validator, and try-catch blocks to make the application understandable and easy to debug.
I personally used a Mongo Docker image and Render for deployment!
db-image
: branch is responsible for creating the mongodb container which serves as the database.feature
: branch will contain all project requirements divided into sub branches and labeled with enhancements
.release
: branch is merged into the main branch when the work is tested and completed.More documentation is included in the issues tab.
npm run build
npm run dev
// navigate to docker compose
> cd ./db
// run docker compose file in detached mode
> sudo docker compose up -d
// open the mongo shell to interacte with the database
> docker exec -it personal-mongo-database mongosh
YOURE INSIDE THE CONTAINER NOW YOU CAN LIST DATABASES, USE ONE, DO ANY CRUD OPERATIONS...
# list all databases
> show dbs
# use a specific database
> use db_name
# see all the collections of the database selected
> show collections
# list all documents in a collection
> db.db_name.find()
the test is performed using
Thunder Client
I recorded the tests before adding the reqeust validation branch
POST /employees: Add a new employee: demo for adding new employee
PUT /employees/:id: Update an existing employee's details: demo for updating an employee
DELETE /employees/:id: Delete an employee by ID: demo for deleting an employee
I recommand to see the issues tag in the process of understandimg the solution (ordered) implementations:
Also reading the mentionned pull request in every issue is a good win !