A web application for managing employee leave requests and days off, featuring a role-based permision system for employees and managers.
- Log in to the system.
- Create leave request (vacation, sick leave, personal reason, unpaid leave)
- View list of their own leave requests.
- Cannot edit or delete submitted requests (locked)
- Log in to the system
- Create accounts for new employees
- View list of all employees
- Delete employees
- View all leave requests
- Approve or reject leave requests
- Frontend: React 18, React Router
- Backend: Node.js, Express
- Authentication: JWT (JSON Web Token)
- Database: JSON file (simple, easy to use)
- Node.js (version 14 or higher)
- npm or yarn
-
Install all dependencies:
npm run install-all
Or install separately:
npm install cd server && npm install cd ../client && npm install
-
Run the application:
Run frontend and backend simultaneously:
npm run dev
Or run separately:
# Terminal 1 - Backend npm run server # Terminal 2 - Frontend npm run client
-
Access the application:
- Frontend: http://localhost:3001
- Backend API: http://localhost:5000
- Manager:
- Username:
admin - Password:
admin123
- Username:
HTTDD/
├── client/ # Frontend React
│ ├── public/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ └── App.js
│ └── package.json
├── server/ # Backend Express
│ ├── index.js # Main server
│ ├── database.json # Database (auto-created)
│ └── package.json
└── package.json # Root package.json
POST /api/login- LoginGET /api/me- Get current user info
GET /api/users- Get list of usersPOST /api/users- Create new userDELETE /api/users/:id- Delete users
GET /api/leave-requests- Get list of leave requestsPOST /api/leave-requests- Create new leave requestGET /api/leave-requests/:id- Get request detailsPUT /api/leave-requests/:id- Update request (only when canEdit = true)DELETE /api/leave-requests/:id- Delete request (only when canEdit = true)PATCH /api/leave-requests/:id/status- DApprove/reject request (Manager only)
- Database is stored in
server/database.json(auto-created on first run) - Default JWT secret key is 'your-secret-key-change-in-production' - should be changed in production environment
- Leave requests are automatically locked (canEdit = false) after being approved/rejected
Possible features to add:
- More detailed permissions
- Statistics and reports
- Email notifications
- Leave calendar
- Export data to Excel/PDF