This document provides comprehensive, production-grade REST API documentation for the Employee Management System (EMS).
The system is built using Spring Boot, secured with Spring Security (Session + CSRF), and deployed on Render with Neon PostgreSQL.
- Authentication: Form Login (Session-based)
- CSRF Protection: Enabled (Cookie-based CSRF tokens)
- Roles:
ROLE_ADMINROLE_HRROLE_EMPLOYEE
Most APIs require authentication and appropriate role access.
| Feature | Admin | HR | Employee |
|---|---|---|---|
| Dashboard | ✅ | ✅ | ✅ |
| Employee Management | ✅ | ✅ | ❌ |
| Recruitment | ✅ | ✅ | ❌ |
| Attendance | ✅ | ✅ | ✅ |
| Payroll | ✅ | ✅ | Employee-only |
| Performance Reviews | ✅ | ✅ | Self-review |
| Leave Management | ✅ | ✅ | Apply |
| Onboarding | ✅ | ✅ | Assigned tasks |
| Environment | Base URL |
|---|---|
| Local | http://localhost:8080 |
| Production | https://employee-management-qhfh.onrender.com |
GET /web/dashboard
Returns aggregated metrics:
- Total employees
- Departments
- Payroll stats
- Onboarding overview
Response:
{
"totalEmployees": 42,
"totalDepartments": 6,
"averageSalary": 72000
}GET /web/employees
Query Params:
pagesizesortsearchdepartment
POST /web/employees/add
POST /web/employees/edit/{id}
GET /web/employees/delete/{id}
GET /web/employees/restore/{id}
POST /web/attendance/clock-in
POST /web/attendance/clock-out
GET /web/attendance/my
GET /web/attendance
POST /web/leave/apply
POST /web/leave/update/{id}
GET /web/leave/analytics
POST /web/payroll/generate
GET /web/payroll/my
POST /web/payroll/mark-paid/{id}
POST /web/performance/create
POST /web/performance/self/{id}
POST /web/performance/manager/{id}
GET /web/performance
GET /careers
POST /careers/apply/{jobId}
Accepts:
- Resume (PDF/DOCX)
- Candidate details
AI Processing:
- Skill extraction
- Experience parsing
- Education detection
- AI match score (0–100)
- Missing skill analysis
GET /web/recruitment/smart-shortlist/{jobId}
GET /web/recruitment/candidate/{appId}
POST /web/recruitment/offer/{appId}
GET /web/recruitment/offer/download/{appId}
POST /web/onboarding/start/{employeeId}
GET /web/onboarding/my
POST /web/onboarding/task/{id}/complete
| File Type | Location |
|---|---|
| Resumes | uploads/resumes/ |
| Offer Letters | uploads/offers/ |
| Onboarding Docs | uploads/onboarding/ |
Uploads directory is excluded from Git and generated at runtime.
Available when application is running:
- Swagger UI:
/swagger-ui.html - OpenAPI JSON:
/v3/api-docs
Standard HTTP Status Codes:
200 OK400 Bad Request401 Unauthorized403 Forbidden404 Not Found500 Internal Server Error
- Unit & Integration tests via Spring Boot Test
- CI via GitHub Actions
- Dockerized builds
- APIs are UI-backed (Thymeleaf) and REST-backed
- Security enforced via Spring Security
- Database: Neon PostgreSQL
- Production-ready architecture
📌 This API documentation reflects the actual implementation and is maintained alongside the codebase.