bash — ~/projects/employee-management-system
$cd ~/projects/employee-management-system && cat summary.txt
Full-stack HR portal with role-based access: employees request leave and download PDF salary slips, HR approves or rejects requests and generates payslips, and admins create users and see system analytics.
EMPLOYEE MANAGEMENT SYSTEM
Full-Stack Developer · #58d2a6f fullstack
React (Vite) · Tailwind CSS v4 · Node.js · Express 5 · JWT · SQLite · jsPDF
github.com/sleepyhead000/employee-management-system
~/projects/employee-management-system $
cat README.md
README.md
$cat roles.txt
Three roles, enforced on both sides. Employees submit leave and fetch their own slips; HR lists all requests, approves or rejects them and generates salary slips; admins create users and view system analytics. No public registration — accounts are created by admin/HR only.
$cat backend.txt
Express 5 on Node with JWT auth (bcrypt password hashing) and SQLite through node:sqlite — Node's built-in module, so there is zero external database servers to install. Controllers per domain, routes with role middleware, prepared statements throughout, plus a seed script that fills demo data.
$cat frontend.txt
React + Vite with Tailwind CSS v4, React Router, Axios (JWT interceptor with 401 redirect) and Zustand persisting the session to localStorage. ProtectedRoute and RoleRoute guard the UI, and each role lands on its own dashboard after sign-in.
$cat api.txt
Ten routes with a documented method / path / access matrix — login, employee CRUD, leave requests and status transitions, salary generation and per-employee slip history. Server-side middleware is the source of truth: the UI guards are convenience, not security.
~/projects/employee-management-system $
ls -l features/
auth
JWT auth · bcrypt hashing · session in localStorage · 401 redirect
rbac
3 roles · ADMIN · HR · EMPLOYEE — enforced server-side on every route
leave
Leave workflow · employees submit · HR approves/rejects · status filtering
salary
PDF salary slips · jsPDF client-side generation · employee self-download
users
User administration · admins create employee/HR accounts · no public signup
analytics
System analytics · admin dashboard aggregates for decision making
api
10+ endpoints · documented method / route / access matrix
onboarding
Seed script · demo account for every role out of the box
storage
Zero external DB · SQLite via node:sqlite built-in (Node 22.5+)
~/projects/employee-management-system $
cat stack.yaml
frontend
React (Vite) · Tailwind CSS v4 · React Router · Axios · Zustand
backend
Node.js · Express 5 · controllers + routes + error handler
auth
JWT + bcrypt · verifyToken + authorizeRoles('ADMIN','HR') per route
database
SQLite via node:sqlite · prepared statements · seed script
pdf
jsPDF · client-side salary slip generation and download
tooling
npm scripts · concurrent dev servers (5000 API, 5173 UI with /api proxy)
~/projects/employee-management-system $
git log --oneline
#c72f9d4feat/auth
JWT auth & role middleware
Express 5 · bcrypt · JWT · route guards
- Login issues a JWT; verifyToken + authorizeRoles guard every non-public route server-side, so the API is the source of truth.
- ProtectedRoute and RoleRoute mirror the same roles in the UI — an employee never sees an HR screen the API would reject.
- No public registration: users are created by admin/HR, which keeps the employee list curated.
#3ab6e18feat/leave
Leave request workflow
REST · status transitions · scoped queries
- Employees submit requests and read only their own history through /leaves/my-leaves.
- HR lists every request (filterable by PENDING) and approves or rejects with a single status PUT.
- Role middleware decides visibility, so a submitted request can never be edited by the wrong role.
#94e0c7bfeat/salary
PDF salary slips
jsPDF · Express endpoints · employee self-service
- HR generates a slip per employee and period; employees fetch their own through /salary/my-slips and download the PDF.
- Generation runs client-side with jsPDF, so the server never renders or stores binaries.
- Slips stay attached to the authenticated employee — no public file URLs.
#d15b83afeat/admin
User administration & analytics
SQLite · seeded demo data · admin dashboard
- Admins create employee and HR accounts from the dashboard instead of a sign-up form.
- System analytics aggregate across employees, leave and salary data for a quick operational read.
- Setup is two terminals — backend on 5000, Vite frontend proxying /api on 5173 — with node:sqlite meaning no database server at all.