Enterprise HR Platform
DOPA Faculty Management System
Payroll, scheduling, and role-based access for a coaching institute's entire faculty operation.
Overview
Problem
Faculty payroll, scheduling, and staff records were spread across spreadsheets and manual approvals, with no single source of truth.
Solution
One platform where payroll, scheduling, and staff records live together, gated by role-based access so each role sees exactly what it needs.
Architecture
Client
Next.js App Router UI, server components for data-heavy views.
API
Route handlers enforcing auth + RBAC checks before touching data.
Auth
JWT sessions with role claims; middleware guards protected routes.
Data
MongoDB schemas for staff, schedules, payroll runs, and audit history.
Feature Breakdown
- Role-scoped dashboards for admin, coordinator, and faculty accounts
- Auditable payroll runs generated from logged schedules and attendance
- Faculty scheduling with conflict detection across time slots
Implementation Detail
export async function withRole(role: Role, handler: Handler) {
return async (req: Request) => {
const session = await getSession(req);
if (!session || !session.roles.includes(role)) {
return Response.json({ error: "Forbidden" }, { status: 403 });
}
return handler(req, session);
};
}Challenge & Solution
Payroll figures needed to be trustworthy, and different roles needed different views of the same data without separate codebases.
Payroll runs are computed from immutable schedule snapshots and stored as an auditable record; RBAC middleware scopes queries and UI from one role definition, checked at the API layer.
Results
- Payroll and scheduling run out of one system instead of three cross-checked spreadsheets.
- Every payroll figure has an audit trail back to its source data.