How aryankarmani/omnihr-backend works
OmniHR is a multi-tenant HR SaaS backend. A company user reaches HR functions through the Express API, where routes apply authentication and dispatch to domain controllers; those controllers manage tenant data and, where shown, trigger notifications, audit records, or email. Public landing-page requests support demo leads and paid company onboarding, while a separate super-admin API manages platform companies, plans, subscriptions, and payments. The tree also documents attendance, leave, payroll, reporting, and employee-management capabilities. Several route/controller implementations are unsampled, so those links are not inferred.
Main entry points: app.ts Express app · employee.controller.ts Employee management · attendance.controller.ts Attendance management · mail.ts Email delivery
Components 27
API entry
- Express app
src/app.ts - Employee routes
src/routes/employee.routes.ts - Attendance routes
src/routes/attendance.routes.ts - Master-data routes
src/routes/masters.routes.ts - Report routes
src/routes/report.routes.ts - Public routes
src/routes/public.routes.ts - Super-admin routes
src/routes/superadmin.routes.ts
HR operations
- Employee management
src/controllers/employee.controller.ts - Attendance management
src/controllers/attendance.controller.ts - HR master data
src/controllers/masters.controller.ts - Leave management
src/controllers/leave.controller.ts - Payroll
src/controllers/payroll.controller.ts - Reporting
src/controllers/report.controller.ts - Team management
src/controllers/team.controller.ts
Platform SaaS
- Paid onboarding
src/controllers/public.onboarding.controller.ts - Demo requests
src/controllers/demoRequest.controller.ts - Platform administration
src/routes/superadmin.routes.ts - Subscription notices
src/services/subscriptionNotification.service.ts
Shared services
- Application database
- Tenant authentication
src/middleware/auth.ts - Super-admin auth
src/middleware/superadmin.auth.ts - In-app notifications
src/utils/notification.ts - Audit logging
src/utils/auditLog.ts - Email delivery
src/utils/mail.ts - Team scope
src/utils/teamScope.ts - Push delivery
src/controllers/pushNotification.controller.ts
Other components
- API client
Connections 37
- API client → Express app: sends requests
- Express app → Employee routes: mounts API
src/app.ts - Express app → Attendance routes: mounts API
src/app.ts - Express app → Master-data routes: mounts API
src/app.ts - Express app → Report routes: mounts API
src/app.ts - Express app → Public routes: mounts API
src/app.ts - Express app → Super-admin routes: mounts API
src/app.ts - Express app → Leave management: mounts routes
src/app.ts - Express app → Payroll: mounts routes
src/app.ts - Express app → Team management: mounts routes
src/app.ts - Employee routes → Employee management: dispatches
src/routes/employee.routes.ts - Employee routes → Tenant authentication: authenticates
src/routes/employee.routes.ts - Attendance routes → Attendance management: dispatches
src/routes/attendance.routes.ts - Attendance routes → Tenant authentication: authenticates
src/routes/attendance.routes.ts - Master-data routes → HR master data: dispatches
src/routes/masters.routes.ts - Master-data routes → Tenant authentication: authenticates
src/routes/masters.routes.ts - Report routes → Reporting: dispatches
src/routes/report.routes.ts - Public routes → Paid onboarding: dispatches
src/routes/public.routes.ts - Public routes → Demo requests: dispatches
src/routes/public.routes.ts - Super-admin routes → Platform administration: routes requests
src/routes/superadmin.routes.ts - Super-admin routes → Super-admin auth: authenticates
src/routes/superadmin.routes.ts - Employee management → Application database: reads and writes
src/controllers/employee.controller.ts - Attendance management → Application database: reads and writes
src/controllers/attendance.controller.ts - HR master data → Application database: reads and writes
src/controllers/masters.controller.ts - Attendance management → Team scope: checks team scope
src/controllers/attendance.controller.ts - Employee management → Team scope: checks team scope
src/controllers/employee.controller.ts - Attendance management → In-app notifications: creates notifications
src/controllers/attendance.controller.ts - Employee management → In-app notifications: creates notifications
src/controllers/employee.controller.ts - Attendance management → Audit logging: records actions
src/controllers/attendance.controller.ts - Employee management → Audit logging: records actions
src/controllers/employee.controller.ts - Attendance management → Push delivery: sends push
src/controllers/attendance.controller.ts - Employee management → Email delivery: sends welcome email
src/controllers/employee.controller.ts - Paid onboarding → Email delivery: sends email
src/controllers/public.onboarding.controller.ts - Demo requests → Email delivery: sends email
src/controllers/demoRequest.controller.ts - Express app → Subscription notices: starts checker
src/app.ts - Subscription notices → Application database: updates subscription
src/services/subscriptionNotification.service.ts - Subscription notices → Email delivery: sends notices
src/services/subscriptionNotification.service.ts