A modern full-stack Employee Attendance Management System that streamlines workforce attendance tracking, employee administration, and daily attendance monitoring through secure authentication, role-based dashboards, and an intuitive user experience.
TrackWise is a full-stack Employee Attendance Management System designed to simplify workforce attendance tracking and employee administration through a centralized, secure, and user-friendly platform.
The platform enables employees to activate their accounts, securely log in, record daily attendance, and review attendance history β while providing administrators with powerful tools for managing employees, monitoring attendance statistics, controlling account activation, and overseeing daily workforce operations.
Built with React, Node.js, Express.js, and PostgreSQL, TrackWise focuses on security, scalability, and maintainability. It demonstrates a production-grade implementation of JWT authentication, RESTful APIs, role-based access control, full CRUD operations, input validation, and responsive web design β all inside a thoughtfully designed interface.
Whether you manage a small team or a growing organization, TrackWise provides an efficient, digital solution for workforce attendance management.
| Area | Feature | What it does | Why it matters |
|---|---|---|---|
| π€ Employee Module | Secure account activation | Employees activate pending accounts with their Employee ID and set their own password | Keeps accounts secure from day one β admins never see employee passwords |
| JWT login & authentication | Signed 8-hour bearer tokens issued per session | Stateless, secure sessions that expire automatically | |
| Daily check-in / check-out | One-click start/end of the working day with office-hours enforcement | Simple, consistent daily attendance capture | |
| Personal dashboard | Live clock, current status, working-hours gauge, weekly chart | Employees see exactly where their day stands at a glance | |
| Attendance history | Month-filterable table of every check-in/check-out | Full transparency and self-service record keeping | |
| π¨βπΌ Admin Module | Dashboard statistics | Total employees, working today, completed today, not started | A real-time pulse of the whole workforce |
| Employee management | Searchable, filterable employee directory | Rapid access to any team member | |
| Add / edit employees | Full profile creation and updates with inline validation | Keeps workforce data accurate and current | |
| Activate / deactivate accounts | Toggle employee access at any time | Admins keep full control over who can sign in | |
| Pending employee monitoring | Track who has not yet activated their account | No lost employees β follow up on activations | |
| π Attendance Module | Working-hour calculations | Automatic check-out total-hour computation | Eliminates manual math and spreadsheet errors |
| Work-status tracking | inactive β working β completed lifecycle per day |
Always know who is present, active, or done | |
| Office-hours guardrails | Enforced 9:00 AM β 5:00 PM window (early check-in at 8:30) | Realistic, policy-aligned attendance rules | |
| Workforce monitoring | Live team snapshot with check-in times and status badges | At-a-glance visibility across the organization | |
| π Security | JWT authentication | Signed tokens with role claims and 8-hour expiry | Stateless, tamper-resistant session management |
| Password hashing | bcrypt with 10 salt rounds | Industry-standard password storage | |
| Role-based authorization | Dedicated adminOnly middleware on admin routes |
Least-privilege access β employees cannot reach admin endpoints | |
| Input validation | express-validator on every mutating route |
Prevents malformed and malicious payloads | |
| CORS allow-listing | Configurable comma-separated origin list | Restricts which browsers may call the API |
Employees and administrators sign in with their Employee ID and password on a polished split-screen page β with the product value proposition presented alongside the form.
The admin dashboard gives a real-time overview of the workforce: total employees, how many are working today, how many have completed their day, and how many have not yet started β alongside a "Today's workforce breakdown" donut chart and a live team snapshot.
Administrators manage the whole team from a centralized, searchable directory β filter by status (All / Active / Inactive / Pending), edit profiles, and activate or deactivate accounts with a confirmation prompt.
Registering a new employee is straightforward. New accounts start in a pending state β the employee activates their own password before their first sign-in.
Updating an employee's details is just as simple. The pre-filled form keeps the Employee ID read-only β the unique identifier can never be changed β while name, email, phone, department, and designation remain fully editable. Changes apply immediately on save.
New employees activate their pending account using the Employee ID issued by their administrator. Setting their own password completes sign-up and moves the account to an active state β admins never see employee passwords.
Employees monitor their day through a personalized dashboard β current work status, check-in time, working hours toward an 8-hour target, a weekly bar chart, and recent days.
Every check-in and check-out, month by month. Employees filter by month and see days worked, hours logged, average hours per day, and the full detailed breakdown.
| Category | Technology | Purpose |
|---|---|---|
| Frontend | React 19 | Component-based UI |
| React Router 7 | Client-side routing & route guards | |
| Axios | HTTP client with interceptors | |
| Tailwind CSS 4 | Utility-first styling with design tokens | |
| Vite 8 | Build tooling & dev server | |
| lucide-react | Lightweight icon set | |
| react-toastify | In-app notifications | |
| Backend | Node.js + Express 5 | REST API server |
| PostgreSQL (pg) | Relational database | |
| jsonwebtoken | JWT signing & verification | |
| bcrypt | Password hashing | |
| express-validator | Request validation | |
| cors | Cross-origin resource sharing | |
| dotenv | Environment configuration | |
| Dev Tools | nodemon | Auto-restarting dev server |
React Frontend (Vite + Tailwind)
β
βΌ
React Router (lazy-loaded routes)
β
βΌ
Axios HTTP Requests (REST API)
βββ 401 interceptor β auto-logout
β
βΌ
Express.js Backend (Node.js)
βββ CORS allow-list + JWT middleware
β
βββββββββββββββββββββββββΌβββββββββββββββββββββββββ
βΌ βΌ βΌ
Authentication Attendance Module Admin Module
/api/auth /api/attendance /api/admin
(JWT + bcrypt) (office-hours guard) (adminOnly middleware)
β β β
βββββββββββββββββββββββββΌβββββββββββββββββββββββββ
βΌ
PostgreSQL Database
β
βββββββββββββββββΌβββββββββββββββββ
βΌ βΌ βΌ
users attendance leave_requests
TrackWise/
β
βββ client/ # React frontend
β βββ public/
β βββ src/
β β βββ components/ # Reusable UI (RadialGauge, StatusBadge, β¦)
β β βββ context/ # AuthContext (session state)
β β βββ pages/
β β β βββ admin/ # Dashboard, Employees, Add/Edit Employee
β β β βββ employee/ # Dashboard, Attendance History
β β β βββ Landing, Login, Activate, 404
β β βββ routes/ # Lazy-loaded route definitions + guards
β β βββ services/ # Axios API client + auth service
β β βββ styles/ # Tailwind v4 design tokens (@theme)
β β βββ App.jsx
β β βββ main.jsx
β βββ .env.example
β
βββ server/ # Express backend
β βββ src/
β β βββ config/ # companyPolicy (office hours)
β β βββ controllers/ # auth, admin, attendance
β β βββ database/ # schema.sql + setup.js (idempotent bootstrap)
β β βββ middleware/ # auth (JWT), adminOnly, validation
β β βββ models/ # Data access layer
β β βββ routes/ # /api/auth, /api/admin, /api/attendance
β β βββ services/ # Business logic
β β βββ validations/ # express-validator schemas
β β βββ app.js # Express app + CORS + error handling
β β βββ server.js # Entry point
β βββ .env.example
β
βββ screenshots/ # README screenshots
βββ README.md
βββ LICENSE
βββ .gitignore
- Node.js 20+ and npm
- PostgreSQL 14+ running locally
git clone https://github.com/Aby020/TrackWise.git
cd TrackWisecd server
npm installOpen a new terminal.
cd client
npm installInside the server folder, copy the example file and fill in your database credentials:
cd server
cp .env.example .envPORT=5000
DATABASE_URL=postgresql://postgres:password@localhost:5432/trackwise_db
JWT_SECRET=your_secret_keyThen inside the client folder:
cd client
cp .env.example .envVITE_API_URL=http://localhost:5000/apiThe schema and admin account are bootstrapped automatically on the first server start β the setup is idempotent, so it is safe to run on every boot. You can also trigger it manually:
cd server
npm run db:setupcd server
npm run devBackend runs on:
http://localhost:5000
cd client
npm run devFrontend runs on:
http://localhost:5173
| Variable | Description | Required |
|---|---|---|
PORT |
Backend server port | No (default: 5000) |
NODE_ENV |
Environment mode | No (default: development) |
DATABASE_URL |
PostgreSQL connection string | Yes* |
DB_HOST / DB_PORT / DB_USER / DB_PASSWORD / DB_NAME |
Individual database variables (used if DATABASE_URL is not set) |
Yes* |
JWT_SECRET |
Secret key for JWT tokens (32+ random bytes) | Yes |
CORS_ORIGIN |
Comma-separated allowed browser origins | No (default: http://localhost:5173) |
ADMIN_EMAIL |
Bootstrap admin email | No (default: admin@trackwise.app) |
ADMIN_EMPLOYEE_ID |
Bootstrap admin employee ID | No (default: ADMIN001) |
ADMIN_PASSWORD |
Bootstrap admin password | No (default: TrackwiseDev2026) |
ATTENDANCE_ENFORCE_HOURS |
Enforce office-hours check-in/check-out (true/false) |
No (default: true) |
*Either DATABASE_URL or all DB_* variables are required.
Generate a strong secret:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"| Variable | Description | Required |
|---|---|---|
VITE_API_URL |
Backend API base URL (includes the /api prefix) |
No (default: http://localhost:5000/api) |
- Ensure PostgreSQL is running and the database exists (see Installation).
- Start the backend:
cd server && npm run devβhttp://localhost:5000 - Start the frontend:
cd client && npm run devβhttp://localhost:5173 - Open
http://localhost:5173in your browser.
The admin account is created automatically on the first server start from your environment variables. Use it to log in, add employees, and explore the dashboard.
β οΈ Development only. These defaults ship for local development. Change them in production by settingADMIN_EMAIL,ADMIN_EMPLOYEE_ID, andADMIN_PASSWORDinserver/.envβ the account is re-synced from these variables on every server start.
| Credential | Value |
|---|---|
| Employee ID | ADMIN001 |
| Password | TrackwiseDev2026 |
admin@trackwise.app |
|
| Role | Admin |
| π¨βπΌ Admin | π€ Employee | |
|---|---|---|
| Sign in | β | β (after activation) |
| Personal attendance dashboard | β | β |
| Check in / check out | β | β |
| Attendance history | β | β |
| Dashboard statistics | β | β |
| Add / edit employees | β | β |
| Activate / deactivate accounts | β | β |
| Monitor pending employees | β | β |
Admin routes are protected by both authenticate (JWT) and adminOnly (role check) middleware β an employee token cannot reach admin endpoints.
Admin creates employee βββΊ status = pending βββΊ Employee activates account
(no password) β (sets own password)
βΌ
status = active βββΊ Can log in & mark attendance
β
ββββΊ Admin can deactivate at any time (login blocked)
Before 8:30 AM βββΊ Check-in blocked (office hours not open)
8:30 AM β 5:00 PM βββΊ Check-in allowed
After 5:00 PM βββΊ Check-out allowed (working day complete)
| Step | Action | Result |
|---|---|---|
| 1 | Employee clicks Start work | working_status β working, check-in timestamp recorded |
| 2 | Employee works through the day | Dashboard shows live status + hours toward the 8-hour target |
| 3 | Employee clicks End work (after 5:00 PM) | working_status β completed, total_hours auto-calculated |
| 4 | Any time | Employee reviews Attendance History month by month |
- Add employee β new account created as
pending - Monitor pending employees until they activate
- Edit profiles as details change
- Deactivate accounts when someone leaves β their login is immediately blocked
All routes return JSON. Mutating routes validate the request body with express-validator. Admin routes require the admin role.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/auth/activate |
Activate a pending account (set password) | β |
POST |
/api/auth/login |
Sign in, returns a JWT | β |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET |
/api/admin/dashboard |
Workforce statistics | Admin |
GET |
/api/admin/employees |
List all employees | Admin |
GET |
/api/admin/employees/:employeeId |
Employee details | Admin |
POST |
/api/admin/employees |
Create a new employee | Admin |
PUT |
/api/admin/employees/:employeeId |
Update employee profile | Admin |
PATCH |
/api/admin/employees/:employeeId/status |
Activate / deactivate account | Admin |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET |
/api/attendance/today |
Today's attendance record | Employee |
GET |
/api/attendance/history |
Attendance history (month-filterable) | Employee |
POST |
/api/attendance/start |
Check in (start work) | Employee |
POST |
/api/attendance/end |
Check out (end work) | Employee |
Example β login:
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"employeeId":"ADMIN001","password":"TrackwiseDev2026"}'Example β protected route (Bearer token):
curl http://localhost:5000/api/admin/dashboard \
-H "Authorization: Bearer <your-jwt-token>"Three tables make up the PostgreSQL schema (server/src/database/schema.sql), applied idempotently on server start.
One row per account β employees and admins live in a single table.
| Column | Type | Notes |
|---|---|---|
id |
SERIAL | Primary key |
employee_id |
VARCHAR(20) | UNIQUE β used for login & activation |
first_name / last_name |
VARCHAR(100) | Employee name |
email |
VARCHAR(150) | UNIQUE |
phone |
VARCHAR(20) | Optional |
department / designation |
VARCHAR(100) | Role within the company |
joining_date |
DATE | Optional |
password |
TEXT | bcrypt hash; NULL while pending |
role |
VARCHAR(20) | admin or employee |
account_status |
VARCHAR(20) | pending β active / inactive |
token_version |
INT | Session invalidation counter |
created_at / updated_at |
TIMESTAMP | Auditing |
One row per employee per working day.
| Column | Type | Notes |
|---|---|---|
id |
SERIAL | Primary key |
user_id |
INT | FK β users(id), ON DELETE CASCADE |
work_date |
DATE | With user_id, forms the UNIQUE constraint |
check_in / check_out |
TIMESTAMP | Punch times |
total_hours |
DECIMAL(5,2) | Auto-calculated on check-out |
working_status |
VARCHAR(20) | inactive / working / completed |
Placeholder domain table reserved for a future leave-management workflow.
idx_users_role ON users(role)
idx_attendance_user_day ON attendance(user_id, work_date DESC)
idx_attendance_workday ON attendance(work_date)
| Feature | Implementation |
|---|---|
| JWT authentication | Signed tokens with { id, employeeId, role } claims and an 8-hour expiry |
| Password hashing | bcrypt with 10 salt rounds β raw passwords are never stored |
| Role-based access control | adminOnly middleware denies employee tokens on admin routes |
| Deny-by-default sessions | account_status gates login; pending and inactive accounts are rejected |
| Input validation | express-validator on every mutating endpoint |
| CORS allow-list | Only configured origins may call the API (CORS_ORIGIN) |
| 401 auto-logout | Axios response interceptor clears the session and redirects to login |
| Token invalidation | token_version supports revoking issued tokens |
| No secrets in code | All configuration via environment variables (.env is git-ignored) |
- π± Mobile application β native iOS & Android companions
- π Advanced attendance analytics β trends, reports, and exports
- π GPS-based attendance tracking β location-verified check-ins
- ποΈ Biometric attendance integration β fingerprint / face recognition
- π§ Email notifications β activation reminders and daily digests
- π Employee performance dashboard β productivity insights
- π³ Docker deployment β containerized server + database
- βοΈ Cloud deployment β production-ready hosting guide
- π API documentation β OpenAPI / Swagger specification
- ποΈ Leave management β end-to-end leave request workflow
- Secure by design β JWT + bcrypt + role-based authorization + validated input, end to end
- Real office-hour enforcement β configurable 9β5 attendance window with early check-in
- Idempotent bootstrapping β schema and admin account self-configure on every start
- Polished design system β Tailwind v4 design tokens with a modern indigo/violet brand
- Reactive session handling β expired tokens log the user out gracefully via a custom event
- Complete role separation β distinct employee and admin experiences with strict access control
- Responsive and modern β mobile-friendly, component-driven React architecture
This project is licensed under the MIT License.
See the LICENSE file for more information.
Backend Developer | Python, Django & Node.js Developer
Passionate about building scalable backend systems, RESTful APIs, modern web applications, and production-ready software using Python, Django, Node.js, Express.js, PostgreSQL, and React.
If you found this project helpful, please consider giving it a β on GitHub.
Your support motivates me to continue building and improving high-quality open-source software.
If you have suggestions, feedback, or would like to collaborate, feel free to connect with me on GitHub or LinkedIn.








