Skip to content

REST API using Node.js, Express, and MongoDB (using TypeScript) to manage employee records

License

Notifications You must be signed in to change notification settings

meddhiaka/employee-management-backend-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏆 48 Hour Backend Technical Challenge

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!


Github Workflow

  • 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.

I created this workflow with Figjam, a Figma product that is excellent for creating diagrams workflows and even project management ^^ workflow

Playing with the solution

  • To build the application (generate the javascript dist) :

npm run build


  • To run the application in the development mode :

npm run dev


  • To run the mongo docker container (MongoDB database in a container created with few commands and isolated form the OS):
// 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()

Demos of the backend application in action XD

the test is performed using Thunder Client

I recorded the tests before adding the reqeust validation branch


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 !

MIT license forever

About

REST API using Node.js, Express, and MongoDB (using TypeScript) to manage employee records

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published