How barabari-tech-collective/leave-management-system works
The Barabari Collective Leave Management Portal lets employees apply for leave and track balances and decisions, while vertical leads and admins review requests and manage staff. The workflow runs from role-based React pages through session-authenticated Express routes to leave/user records, with email notifications for applications and decisions. Separate branches cover account provisioning, organizational lifecycle management, and scheduled holiday announcements. Relationships below are limited to source excerpts and README documentation; some frontend pages and integrations are represented at their documented paths, not inspected implementations.
Main entry points: axiosConfig.js HTTP client · app.js Express app · authRoutes.js Authentication routes · leaveController.js Leave workflows
Components 21
Role-based portal
- Role-based routing
frontend/src/routes/AppRoutes.jsx - Session context
frontend/src/context/AuthContext.jsx - Apply for leave
frontend/src/pages/employee/ApplyLeave.jsx - Balance, history, policy
frontend/src/pages/employee - Team review
frontend/src/pages/verticalLead/VerticalLeadDashboard.jsx - Admin overview
frontend/src/pages/admin/AdminDashboard.jsx - Staff lifecycle views
frontend/src/pages/admin/ManageVerticals.jsx - HTTP client
frontend/src/api/axiosConfig.js
Leave services
- Express app
backend/app.js - Authentication routes
backend/routes/authRoutes.js - Leave routes
backend/routes/leaveRoutes.js - Leave workflows
backend/controllers/leaveController.js - Session guard
backend/middleware/authMiddleware.js - Leave records
backend/models/Leave.js
People administration
- User routes
backend/routes/userRoutes.js - User accounts and balances
backend/models/User.js
Email automation
- Holiday scheduler
backend/cron/holidayCron.js - Notification service
backend/services/emailService.js
Other components
- Employee
- Admin / Lead
- Resend email
Connections 28
- Employee → Role-based routing: uses portal
- Admin / Lead → Role-based routing: uses portal
- Role-based routing → Session context: guards routes
frontend/src/routes/AppRoutes.jsx - Session context → HTTP client: fetches session
frontend/src/context/AuthContext.jsx - Apply for leave → HTTP client: submits request
- Balance, history, policy → HTTP client: loads leave data
- Team review → HTTP client: loads team requests
- Admin overview → HTTP client: loads overview
frontend/src/pages/admin/AdminDashboard.jsx - Staff lifecycle views → HTTP client: manages staff
- HTTP client → Express app: HTTP requests
- Express app → Authentication routes: mounts /auth
backend/app.js - Express app → Leave routes: mounts /leave
backend/app.js - Express app → User routes: mounts /users
backend/app.js - Authentication routes → Session guard: guards provisioning
backend/routes/authRoutes.js - Leave routes → Session guard: guards endpoints
backend/routes/leaveRoutes.js - User routes → Session guard: guards endpoints
backend/routes/userRoutes.js - Leave routes → Leave workflows: dispatches workflows
backend/routes/leaveRoutes.js - Leave workflows → Leave records: creates and reads
backend/controllers/leaveController.js - Leave workflows → User accounts and balances: reads and updates
backend/controllers/leaveController.js - User routes → User accounts and balances: manages accounts
backend/routes/userRoutes.js - User routes → Leave records: migrates records
backend/routes/userRoutes.js - Authentication routes → User accounts and balances: authenticates and creates
backend/routes/authRoutes.js - Leave workflows → Notification service: sends leave notices
backend/controllers/leaveController.js - Authentication routes → Notification service: sends welcome email
backend/routes/authRoutes.js - Express app → Holiday scheduler: starts scheduler
backend/app.js - Holiday scheduler → User accounts and balances: finds recipients
backend/cron/holidayCron.js - Holiday scheduler → Notification service: sends holiday notice
backend/cron/holidayCron.js - Notification service → Resend email: dispatches email
backend/services/emailService.js