How purushottamjanjire/crewboard works
1. CrewBoard is a two-tier full-stack system split into a React frontend and a Spring Boot backend. The frontend lives in CrewFrontend/; the backend lives in crewboard-backend/. The boundary between them is a REST API, with JWT-based authentication controlling access.
2. The frontend is a Vite-based React app (main.jsx, App.jsx, vite.config.js) with feature-oriented components under src/components. The UI is organized around major workflows: authentication (Login, SignUp), admin operations (Dashboard, EmployeeList, AddEmployee, LeaveRequests, PayrollList, AttendanceSummary), and employee self-service (EmpHome, EmpDashboard, EmpProfile, ApplyLeave, EmpAttendanceCard).
3. Frontend state and navigation appear to be driven by page-level components rather than a deep store architecture. Navbar and App likely provide the shell and route composition, while smaller components such as UpdateEmployeeModal, PendingLeaves, PendingRequests, and TotalEmployees represent focused UI slices for specific business tasks.
4. Styling is component-scoped and split into many CSS files in src/styles, mirroring the component structure. That suggests the app is largely presentational and organized by feature screens, not by a shared design system or heavy CSS framework abstraction, even though Bootstrap is listed in the stack.
5. The backend is a layered Spring Boot application with clear separation between controllers, services, repositories, entities, and cross-cutting security/configuration. That is the main architectural backbone for the server: controllers expose HTTP endpoints, services hold business rules, repositories handle persistence, and entities map to database records.
6. The backend’s domain model is centered on workforce management: Employee, Attendance, Leave, Payroll, and User. The matching repositories (EmployeeRepo, AttendanceRepo, LeaveRepo, PayRollRepo, UserRepository) indicate a MySQL-backed CRUD-style persistence layer using Spring Data JPA.
7. The API surface is split by business capability. EmployeeController, AttendanceController, LeaveController, PayrollController, and UserController provide feature-specific endpoints, while PublicController and HealthChek expose non-secured or operational routes. This separation is useful for drawing distinct admin, employee, and public/API-health boundaries.
8. Security is a major architectural boundary. SecurityConfig, JwtFilter, JwtUtil, UserDetailServiceImpl, and UserService together implement JWT login/authentication and role-based access control for admin versus employee access. In diagram terms, every protected request flows through the JWT filter before reaching the controllers.
9. There is also an email/notification side path in the backend. MailService and BirthdayMailSender indicate backend-triggered outbound email integration, likely used for notifications or scheduled employee-related communication. This is separate from the main request/response path but still part of the server’s business workflow.
10. Data flow is straightforward: the React UI sends requests to backend REST endpoints; controllers delegate to services; services coordinate business logic and persistence through repositories; repositories read/write MySQL; responses return to the UI for dashboard updates and form feedback. For architecture diagrams, the key boundaries are: browser/UI, API/security layer, business services, persistence layer, and external email/MySQL dependencies.
Main entry points: EmployeeService.java Domain Services · Dashboard.jsx Admin Screens · App.jsx App Shell · SecurityConfig.java Security Layer
Components 19
Frontend
React/Vite UI for admin and employee workflows
- App Shell · Vite entry and top-level route composition
CrewFrontend/src/components/App.jsx - Navbar · Shared navigation and access points
CrewFrontend/src/components/Navbar.jsx - Auth Screens · Login and sign-up pages
CrewFrontend/src/components/Login.jsx - Admin Screens · Dashboard and workforce management pages
CrewFrontend/src/components/Dashboard.jsx - Employee Screens · Self-service pages for attendance, leave, and profile
CrewFrontend/src/components/EmpHome.jsx - Task Widgets · Focused tables, summaries, and modals for dashboard actions
CrewFrontend/src/components/UpdateEmployeeModal.jsx - Stylesheets · Component-scoped styling mirrored across screens
CrewFrontend/src/styles/App.css
Backend
Spring Boot API, security, business logic, and persistence
- Security Layer · JWT filter, token utilities, and access control configuration
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/configuration/SecurityConfig.java - User API · User login and identity management flow
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/UserController.java - Employee API · Employee CRUD and profile-related endpoints
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/EmployeeController.java - Attendance API · Attendance capture and summary endpoints
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/AttendanceController.java - Leave API · Leave requests, approvals, and records
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/LeaveController.java - Payroll API · Payroll listing and payment history endpoints
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/PayrollController.java - Domain Services · Employee, attendance, leave, and payroll orchestration
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/EmployeeService.java - Mail Jobs · Outbound email and scheduled birthday messaging
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/MailService.java - Repositories · Spring Data access for workforce entities
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/repository/EmployeeRepo.java - Domain Model · Employee, attendance, leave, payroll, and user records
crewboard-backend/src/main/java/com/crewboard/crewboard_backend/entity/Employee.java
Data & External
Primary storage and outbound integrations
- MySQL · Primary persistence store for workforce data
crewboard-backend/src/main/resources/application.properties - Email System · Outbound email delivery target
Connections 29
- App Shell → Navbar: renders · The shell composes shared navigation
- App Shell → Auth Screens: routes to · Public access pages for login and registration
- App Shell → Admin Screens: routes to · Admin workflow screens
- App Shell → Employee Screens: routes to · Employee self-service screens
- Admin Screens → Task Widgets: uses · Dashboard pages rely on focused widgets
- Employee Screens → Task Widgets: uses · Employee pages reuse compact UI slices
- App Shell → Stylesheets: styles with · Screens are backed by component-scoped CSS
- Auth Screens → User API: calls · Login and signup communicate with user endpoints
- Admin Screens → Employee API: calls · Admin screens manage employee records
- Admin Screens → Leave API: calls · Admin screens process leave requests
- Admin Screens → Payroll API: calls · Admin screens view payroll data
- Admin Screens → Attendance API: calls · Admin dashboards read attendance summaries
- Employee Screens → Attendance API: calls · Employees submit or view attendance
- Employee Screens → Leave API: calls · Employees apply for leave
- Security Layer → User API: protects · JWT-based access control gates user operations
- Security Layer → Employee API: protects · Protected requests reach employee endpoints through security
- Security Layer → Attendance API: protects · Protected requests reach attendance endpoints through security
- Security Layer → Leave API: protects · Protected requests reach leave endpoints through security
- Security Layer → Payroll API: protects · Protected requests reach payroll endpoints through security
- User API → Domain Services: delegates · Controllers forward authentication and user logic
- Employee API → Domain Services: delegates · Employee requests are handled by services
- Attendance API → Domain Services: delegates · Attendance requests are handled by services
- Leave API → Domain Services: delegates · Leave requests are handled by services
- Payroll API → Domain Services: delegates · Payroll requests are handled by services
- Domain Services → Repositories: reads/writes · Business logic persists through repositories
- Repositories → Domain Model: maps · Repositories operate on JPA entities
- Domain Model → MySQL: stored in · Primary system of record
- Mail Jobs → Email System: sends · Notification and birthday email delivery
- Domain Services → Mail Jobs: triggers · Business events can initiate notifications