How njsai/attendance-manager works
This is a multi-tenant attendance and HR SaaS: users sign in and work through role-specific dashboards for attendance, employee records, leave, payroll, and related company operations; super-admins manage subscriptions and platform security. The React application routes users to those experiences, while an Express API exposes the domain routes and uses PostgreSQL-backed session and application data. The README documents additional HR and administration capabilities. Some route modules and frontend pages were not sampled, so their internal behavior and specific API calls are not asserted.
Main entry points: index.ts Route registry · App.tsx Role-based router · app.ts Express application · payroll.ts Payroll schema
Components 24
Web application
- Role-based router
artifacts/attendance-system/src/App.tsx - Login
artifacts/attendance-system/src/pages/Login.tsx - Employee pages
artifacts/attendance-system/src/pages/employee - Admin pages
artifacts/attendance-system/src/pages/admin - Super-admin pages
artifacts/attendance-system/src/pages/super-admin
API and security
- Express application
artifacts/api-server/src/app.ts - Route registry
artifacts/api-server/src/routes/index.ts - Authentication routes
artifacts/api-server/src/routes/auth.ts - Auth utilities
artifacts/api-server/src/lib/auth.ts - Security middleware
artifacts/api-server/src/middleware/security.ts - Security services
artifacts/api-server/src/lib/security.ts
Workforce operations
- Attendance
artifacts/api-server/src/routes/attendance.ts - Employee management
artifacts/api-server/src/routes/employees.ts - Payroll
artifacts/api-server/src/routes/payroll.ts - Other HR routes
artifacts/api-server/src/routes
Platform administration
- Company setup
artifacts/api-server/src/routes/setup.ts - Subscriptions
artifacts/api-server/src/routes/subscriptions.ts - Super-admin operations
artifacts/api-server/src/routes/super-admin.ts
Persistent data
- Company schema
lib/db/src/schema/companies.ts - Employee schema
lib/db/src/schema/employees.ts - Attendance schema
lib/db/src/schema/attendance.ts - Payroll schema
lib/db/src/schema/payroll.ts - PostgreSQL
Other components
- Staff and admins
Connections 30
- Staff and admins → Role-based router: uses
artifacts/attendance-system/src/App.tsx - Role-based router → Login: routes to
artifacts/attendance-system/src/App.tsx - Role-based router → Employee pages: routes to
artifacts/attendance-system/src/App.tsx - Role-based router → Admin pages: routes to
artifacts/attendance-system/src/App.tsx - Role-based router → Super-admin pages: routes to
artifacts/attendance-system/src/App.tsx - Role-based router → Express application: calls API
- Express application → Route registry: mounts routes
artifacts/api-server/src/app.ts - Express application → Security middleware: applies
artifacts/api-server/src/app.ts - Express application → Security services: migrates passwords
artifacts/api-server/src/app.ts - Route registry → Authentication routes: registers
artifacts/api-server/src/routes/index.ts - Route registry → Attendance: registers
artifacts/api-server/src/routes/index.ts - Route registry → Employee management: registers
artifacts/api-server/src/routes/index.ts - Route registry → Payroll: registers
artifacts/api-server/src/routes/index.ts - Route registry → Other HR routes: registers
artifacts/api-server/src/routes/index.ts - Route registry → Company setup: registers
artifacts/api-server/src/routes/index.ts - Route registry → Subscriptions: registers
artifacts/api-server/src/routes/index.ts - Route registry → Super-admin operations: registers
artifacts/api-server/src/routes/index.ts - Authentication routes → Auth utilities: uses
artifacts/api-server/src/routes/auth.ts - Authentication routes → Security services: uses
artifacts/api-server/src/routes/auth.ts - Security middleware → Security services: uses
artifacts/api-server/src/middleware/security.ts - Attendance → Auth utilities: uses
artifacts/api-server/src/routes/attendance.ts - Payroll → Auth utilities: uses
artifacts/api-server/src/routes/payroll.ts - Payroll → PostgreSQL: reads and writes
- Company schema → PostgreSQL: defines tables
- Employee schema → Company schema: references
lib/db/src/schema/employees.ts - Employee schema → PostgreSQL: defines tables
- Attendance schema → PostgreSQL: defines tables
- Payroll schema → Company schema: references
lib/db/src/schema/payroll.ts - Payroll schema → Employee schema: references
lib/db/src/schema/payroll.ts - Payroll schema → PostgreSQL: defines tables