Three roles, one source of truth.
Admin, HR, and Employee permissions enforced at the API layer with ownership checks on every protected route.
An employee management system / case study
A minimal, role-based employee system. Admin sees everything, HR manages the team, and Employees see only their own world. Built end-to-end as a single-session production sprint.

Admin, HR, and Employee permissions enforced at the API layer with ownership checks on every protected route.
Submit, approve, or reject requests in a single workflow. Pending becomes done in two clicks.
Employees see their own pay only. Managers get the full org. Same endpoint, different scope.
Stat cards, recent activity, and upcoming work — composed per role on a single screen.
Zod schemas at the boundary, JWT bearer auth, role guards, and ownership checks. No leaky endpoints.
Every protected route enforces both role and ownership.
Mongoose models for User, Employee, Leave, and Salary with strict types and unique constraints.
JWT with jose, password hashing via Bun.password, requireAuth and requireRole guards.
Hono routes for auth, employees, leaves, and salary. Ownership enforced beside roles.
Vite + React 19 with react-router. Sidebar, header, role-filtered nav, modal-driven CRUD.
Playwright covering login, RBAC matrix, employee CRUD, leave flow, and direct API blocks.
Idempotent seed on first boot. Render staging blueprint and Docker-on-VPS for production.
Full access. Create, edit, delete — and see all payroll.
Manage the team and approve leaves. No deletions.
Only your own data. Submit leaves, view your pay.
Spin up the system locally with seed data, or open the live demo. Three accounts, preloaded with employees, leaves, and three months of payroll.
Get in touch