Sign inSign up

devpsriram/employee-app

By devpsriram

•Updated almost 2 years ago

Employee Management Backend This is a RESTful API built with Node.js, Express.js, and MongoDB

Image
API management
Web servers
0

123

devpsriram/employee-app repository overview

⁠Employee Management Backend

This is a RESTful API built with Node.js, Express.js, and MongoDB for managing employee data. It serves as the backend companion to the Employee App frontend⁠.

⁠Features

  • CRUD operations for employees
  • Data validation and sanitization
  • Authentication and authorization
  • API endpoints for creating, reading, updating, and deleting employee records
  • Integration with MongoDB for data storage

⁠Getting Started

⁠db schema
{
"_id":{"$oid":"675997c56eead6e20ec3d35f"},
"email":"[email protected]",
"password":"Lawrance@110",
"company":"110 traders",
"data":[
   {
   "firstname":"Bruce",
   "lastname":"venkatraman",
   "dep":"dermatologist",
   "_id":{"$oid":"6767c1131ad6dbfe7720be78"}
   },
   {
   "firstname":"Foxx",
   "lastname":"Rayappan",
   "dep":"dentist",
   "_id":{"$oid":"6767d6d7a333ecf4b9dfa051"}
   },
   {
   "firstname":"Alfred",
   "lastname":"Ayyasamy",
   "dep":"dentist",
   "_id":{"$oid":"6767d6e5a333ecf4b9dfa057"}
   }
],
"createdAt":{"$date":{"$numberLong":"1733924808603"}},
"updatedAt":{"$date":{"$numberLong":"1734858481046"}},
"__v":{"$numberInt":"0"}}
⁠endpoints
  1. signin

    -POST /signin

    -request body :

    { "email": "[email protected]", "password": "John@123","company":"john & Doe co"}
    
  2. login

    -POST /login

    (you get all data from back-end replacement of GET request)

    -request body :

     { "email": "[email protected]", "password": "John@123" }
    

3.Add-Employee

-POST /addEmployee/:id

(id = _id on user collection db)

-request body :

{
"firstname":"pepper",
"lastname":"pots",
"dep":"personal assistance"
}

4.update-Employee

-PUT /updateEmployee/:id/:employeeid

( id : _id on user collection db , employeeId : _id of employee from data array on corresponding document in user collection )

request body :

  {
  "firstname": "pepper",
  "lastname": "pots",
  "dep": "asistance"
  }

5.Delete-Employee

-DELETE /deleteEmployee/:id/:employeeid

( id : _id on user collection db , employeeId : _id of employee from data array on corresponding document in user collection )

request body : none

Tag summary

Content type

Image

Digest

sha256:4b0d77135…

Size

401 MB

Last updated

almost 2 years ago

docker pull devpsriram/employee-app:v3