# purushottamjanjire/crewboard architecture

> Architecture diagram of the GitHub repository purushottamjanjire/crewboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/purushottamjanjire/crewboard
- Repository: https://github.com/purushottamjanjire/crewboard

## Overview

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: [`crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/EmployeeService.java`](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/EmployeeService.java) (Domain Services), [`CrewFrontend/src/components/Dashboard.jsx`](https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/Dashboard.jsx) (Admin Screens), [`CrewFrontend/src/components/App.jsx`](https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/App.jsx) (App Shell), [`crewboard-backend/src/main/java/com/crewboard/crewboard_backend/configuration/SecurityConfig.java`](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/configuration/SecurityConfig.java) (Security Layer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_ui_shell["App Shell<br/>React shell<br/>[App.jsx]"]
  node_ui_nav["Navbar<br/>navigation<br/>[Navbar.jsx]"]
  node_ui_auth["Auth Screens<br/>auth UI<br/>[Login.jsx]"]
  node_ui_admin["Admin Screens<br/>admin UI<br/>[Dashboard.jsx]"]
  node_ui_employee["Employee Screens<br/>employee UI<br/>[EmpHome.jsx]"]
  node_ui_modals["Task Widgets<br/>UI widgets"]
  node_ui_styles["Stylesheets<br/>css assets<br/>[App.css]"]
end

subgraph group_backend["Backend"]
  node_api_security["Security Layer<br/>jwt security"]
  node_api_user["User API<br/>auth/user service"]
  node_api_employee["Employee API<br/>employee endpoint"]
  node_api_attendance["Attendance API<br/>attendance endpoint"]
  node_api_leave["Leave API<br/>leave endpoint"]
  node_api_payroll["Payroll API<br/>payroll endpoint"]
  node_svc_core["Domain Services<br/>business logic"]
  node_svc_mail["Mail Jobs<br/>notification service<br/>[MailService.java]"]
  node_repo_layer["Repositories<br/>[EmployeeRepo.java]"]
  node_domain_model[("Domain Model<br/>entities<br/>[Employee.java]")]
end

subgraph group_data["Data & External"]
  node_db_mysql[("MySQL<br/>relational db")]
  node_external_mail["Email System<br/>external service"]
end

node_ui_shell -->|"renders"| node_ui_nav
node_ui_shell -->|"routes to"| node_ui_auth
node_ui_shell -->|"routes to"| node_ui_admin
node_ui_shell -->|"routes to"| node_ui_employee
node_ui_admin -->|"uses"| node_ui_modals
node_ui_employee -->|"uses"| node_ui_modals
node_ui_shell -->|"styles with"| node_ui_styles
node_ui_auth -->|"calls"| node_api_user
node_ui_admin -->|"calls"| node_api_employee
node_ui_admin -->|"calls"| node_api_leave
node_ui_admin -->|"calls"| node_api_payroll
node_ui_admin -->|"calls"| node_api_attendance
node_ui_employee -->|"calls"| node_api_attendance
node_ui_employee -->|"calls"| node_api_leave
node_api_security -->|"protects"| node_api_user
node_api_security -->|"protects"| node_api_employee
node_api_security -->|"protects"| node_api_attendance
node_api_security -->|"protects"| node_api_leave
node_api_security -->|"protects"| node_api_payroll
node_api_user -->|"delegates"| node_svc_core
node_api_employee -->|"delegates"| node_svc_core
node_api_attendance -->|"delegates"| node_svc_core
node_api_leave -->|"delegates"| node_svc_core
node_api_payroll -->|"delegates"| node_svc_core
node_svc_core -->|"reads/writes"| node_repo_layer
node_repo_layer -->|"maps"| node_domain_model
node_domain_model -->|"stored in"| node_db_mysql
node_svc_mail -->|"sends"| node_external_mail
node_svc_core -.->|"triggers"| node_svc_mail

click node_ui_shell "https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/App.jsx"
click node_ui_nav "https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/Navbar.jsx"
click node_ui_auth "https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/Login.jsx"
click node_ui_admin "https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/Dashboard.jsx"
click node_ui_employee "https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/EmpHome.jsx"
click node_ui_modals "https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/UpdateEmployeeModal.jsx"
click node_ui_styles "https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/styles/App.css"
click node_api_security "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/configuration/SecurityConfig.java"
click node_api_user "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/UserController.java"
click node_api_employee "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/EmployeeController.java"
click node_api_attendance "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/AttendanceController.java"
click node_api_leave "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/LeaveController.java"
click node_api_payroll "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/PayrollController.java"
click node_svc_core "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/EmployeeService.java"
click node_svc_mail "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/MailService.java"
click node_repo_layer "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/repository/EmployeeRepo.java"
click node_domain_model "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/entity/Employee.java"
click node_db_mysql "https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/resources/application.properties"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui_shell,node_ui_nav,node_ui_auth,node_ui_admin,node_ui_employee,node_ui_modals,node_ui_styles toneBlue
class node_api_security,node_api_user,node_api_employee,node_api_attendance,node_api_leave,node_api_payroll,node_svc_core,node_svc_mail,node_repo_layer,node_domain_model toneAmber
class node_db_mysql,node_external_mail toneMint
```

## Components

### Frontend

React/Vite UI for admin and employee workflows

- [App Shell](https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/App.jsx): React shell · Vite entry and top-level route composition · `CrewFrontend/src/components/App.jsx`
- [Navbar](https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/Navbar.jsx): navigation · Shared navigation and access points · `CrewFrontend/src/components/Navbar.jsx`
- [Auth Screens](https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/Login.jsx): auth UI · Login and sign-up pages · `CrewFrontend/src/components/Login.jsx`
- [Admin Screens](https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/Dashboard.jsx): admin UI · Dashboard and workforce management pages · `CrewFrontend/src/components/Dashboard.jsx`
- [Employee Screens](https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/EmpHome.jsx): employee UI · Self-service pages for attendance, leave, and profile · `CrewFrontend/src/components/EmpHome.jsx`
- [Task Widgets](https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/components/UpdateEmployeeModal.jsx): UI widgets · Focused tables, summaries, and modals for dashboard actions · `CrewFrontend/src/components/UpdateEmployeeModal.jsx`
- [Stylesheets](https://github.com/purushottamjanjire/crewboard/blob/main/CrewFrontend/src/styles/App.css): css assets · Component-scoped styling mirrored across screens · `CrewFrontend/src/styles/App.css`

### Backend

Spring Boot API, security, business logic, and persistence

- [Security Layer](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/configuration/SecurityConfig.java): jwt security · JWT filter, token utilities, and access control configuration · `crewboard-backend/src/main/java/com/crewboard/crewboard_backend/configuration/SecurityConfig.java`
- [User API](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/UserController.java): auth/user service · User login and identity management flow · `crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/UserController.java`
- [Employee API](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/EmployeeController.java): employee endpoint · Employee CRUD and profile-related endpoints · `crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/EmployeeController.java`
- [Attendance API](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/AttendanceController.java): attendance endpoint · Attendance capture and summary endpoints · `crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/AttendanceController.java`
- [Leave API](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/LeaveController.java): leave endpoint · Leave requests, approvals, and records · `crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/LeaveController.java`
- [Payroll API](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/PayrollController.java): payroll endpoint · Payroll listing and payment history endpoints · `crewboard-backend/src/main/java/com/crewboard/crewboard_backend/controller/PayrollController.java`
- [Domain Services](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/EmployeeService.java): business logic · Employee, attendance, leave, and payroll orchestration · `crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/EmployeeService.java`
- [Mail Jobs](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/MailService.java): notification service · Outbound email and scheduled birthday messaging · `crewboard-backend/src/main/java/com/crewboard/crewboard_backend/service/MailService.java`
- [Repositories](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/repository/EmployeeRepo.java): jpa repositories · Spring Data access for workforce entities · `crewboard-backend/src/main/java/com/crewboard/crewboard_backend/repository/EmployeeRepo.java`
- [Domain Model](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/java/com/crewboard/crewboard_backend/entity/Employee.java): entities · 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](https://github.com/purushottamjanjire/crewboard/blob/main/crewboard-backend/src/main/resources/application.properties): relational db · Primary persistence store for workforce data · `crewboard-backend/src/main/resources/application.properties`
- **Email System**: external service · Outbound email delivery target

## Connections

- 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
