A production-style RESTful backend service for managing construction workers, their daily wages and weekly work-site schedules.
This project digitizes manual labour attendance tracking used in small construction projects and provides a scalable API for dashboard or mobile integration.
- Worker CRUD operations
- Weekly site allocation system
- Reset weekly schedules globally
- Default wage handling
- MongoDB persistence
- Clean REST architecture
- Frontend ready API (React / Mobile)
| Layer | Technology |
|---|---|
| Runtime | Node.js |
| Framework | Express.js |
| Database | MongoDB |
| ODM | Mongoose |
| Config | dotenv |
| Security | CORS |
worker-management-api
│
├── models
│ └── Worker.js
│
├── routes
│ └── workers.js
│
├── .env
├── index.js
├── package.json
Clone repository
git clone https://github.com/YOUR_USERNAME/worker-management-api.git
cd worker-management-api
Install dependencies
npm install
Create .env file
MONGO_URI=your_mongodb_connection_string
PORT=5000
npm start
Server runs at
http://localhost:5000
GET /api/workers
POST /api/workers
Body:
{
"name": "Rahul",
"dailyRate": 1350,
"schedule": {
"S": "",
"M": "Site A",
"T": "",
"W": "",
"Th": "",
"F": "",
"St": ""
}
}
PUT /api/workers/:id
DELETE /api/workers/:id
PUT /api/workers/reset-sites
Resets schedule for all workers.
{
"_id": "65f1a6f3c7d3b2a12c9c1e22",
"name": "Akshay",
"dailyRate": 1350,
"schedule": {
"S": "",
"M": "Building Site",
"T": "",
"W": "",
"Th": "",
"F": "",
"St": ""
}
}
Designed for:
- Contractors
- Site supervisors
- Small construction companies
- Labour management dashboards
Replaces paper attendance register with structured digital records.
This API is designed to connect with React dashboards or mobile apps for real-time worker tracking and wage calculation.
Salmanul Faris K MERN Stack Developer
MIT License