How sakshi-rathi-work/shiftsync-mern works
ShiftSync is a multi-tenant workforce scheduling platform. Managers build and publish weekly rosters, while employees view shifts and submit leave or swap requests; managers review those requests. The backend also supports labor-rule compliance, conflict checks, audit history, notifications, team and user administration, and dashboard views. The frontend calls the Express API through a shared client, and the backend uses Prisma-backed MySQL plus optional Redis. Some feature wiring is documented in the README but its implementation was not sampled, so those links are intentionally omitted.
Main entry points: index.ts Express application · layout.tsx ShiftSync UI · api-client.ts API client · authRoutes.ts Authentication routes
Components 28
Web application
- ShiftSync UI
frontend/app/(app)/layout.tsx - Roster builder
frontend/app/(app)/roster/page.tsx - Leave requests
frontend/app/(app)/leave-requests/page.tsx - Swap requests
frontend/app/(app)/swap-requests/page.tsx - API client
frontend/lib/api-client.ts
API and identity
- Express application
backend/src/index.ts - Authentication routes
backend/src/routes/authRoutes.ts - Authentication service
backend/src/services/authService.ts - Authentication middleware
backend/src/middleware/authenticate.ts
Scheduling and compliance
- Roster routes
backend/src/routes/rosterRoutes.ts - Roster controller
backend/src/controllers/rosterController.ts - Roster service
backend/src/services/rosterService.ts - Conflict rule engine
backend/src/services/ruleEngineService.ts - Detection strategies
backend/src/rules/ConflictDetectionStrategy.ts - Labor rules
backend/src/controllers/laborRuleController.ts
Workforce workflows
- Leave workflow
backend/src/controllers/leaveController.ts - Swap workflow
backend/src/controllers/swapController.ts - Teams and users
backend/src/controllers/teamsController.ts
Persistence and operations
- Audit history
backend/src/controllers/auditLogController.ts - Notifications
backend/src/controllers/notificationController.ts - Dashboard
backend/src/controllers/dashboardController.ts - Roster and shifts
backend/src/db/rosterRepository.ts - User records
backend/src/db/userRepository.ts - Prisma database access
backend/src/config/prisma.ts - MySQL
- Redis
backend/src/config/redis.ts
Other components
- Employee
- Operations manager
Connections 29
- Employee → ShiftSync UI: uses
- Operations manager → ShiftSync UI: uses
- ShiftSync UI → Roster builder: opens
- ShiftSync UI → Leave requests: opens
- ShiftSync UI → Swap requests: opens
- Roster builder → API client: requests data
- Leave requests → API client: requests data
- Swap requests → API client: requests data
- API client → Express application: HTTP requests
- Express application → Authentication routes: mounts
- Express application → Roster routes: mounts
- Express application → Leave workflow: mounts
- Express application → Swap workflow: mounts
- Express application → Teams and users: mounts
- Express application → Labor rules: mounts
- Express application → Audit history: mounts
- Express application → Notifications: mounts
- Express application → Dashboard: mounts
- Authentication routes → Authentication service: delegates
- Authentication routes → Authentication middleware: protects routes
- Authentication service → User records: reads and updates
- Roster routes → Roster controller: dispatches
- Roster controller → Roster service: delegates
- Roster service → Roster and shifts: accesses roster data
- Conflict rule engine → Detection strategies: runs checks
- Roster and shifts → Prisma database access: queries
- User records → Prisma database access: queries
- Prisma database access → MySQL: reads and writes
- Express application → Redis: rate limits