Employee-Management-Fullstack-App

Employee Management System Architecture

This document captures the current architecture of the Employee Management System so that contributors and operators can understand how the solution is structured today, which guarantees are already implemented, and where further hardening is required. The description below is based solely on the source code and infrastructure assets that live in this repository.


1. Solution Overview


2. Frontend Architecture (frontend/)

2.1 Application shell

2.2 Component breakdown

flowchart LR
    Router[React Router
    `src/App.js`] -->|renders| Landing[LandingPage]
    Router --> Dashboard
    Router --> Employees[EmployeeList]
    Router --> Departments[DepartmentList]
    Router --> Forms[EmployeeForm / DepartmentForm]
    Router --> Auth[Auth Pages]

    subgraph Services
        EmpSvc[employeeService.js]
        DeptSvc[departmentService.js]
    end

    Dashboard -->|axios| EmpSvc
    Employees -->|axios| EmpSvc
    Departments -->|axios| DeptSvc
    Forms -->|axios| EmpSvc
    Forms -->|axios| DeptSvc

2.3 Data access layer

2.4 Styling and UX

2.5 Testing


3. Backend Architecture (backend/)

3.1 Application entry

3.2 Domain model & persistence

3.3 Service layer

3.4 API layer

sequenceDiagram
    participant UI as React Client
    participant Ctrl as EmployeeController
    participant Svc as EmployeeService
    participant Repo as EmployeeRepository
    participant DB as MySQL

    UI->>Ctrl: GET /api/employees
    Ctrl->>Svc: getAllEmployees()
    Svc->>Repo: findAllWithDepartments()
    Repo->>DB: SELECT employees JOIN departments
    DB-->>Repo: Row set
    Repo-->>Svc: List<Employee>
    Svc-->>Ctrl: List<Employee>
    Ctrl-->>UI: 200 OK (JSON)

3.5 Configuration & environment

3.6 Security posture

3.7 Testing

3.8 Observability & logging


4. Data & Integrations

graph TD
    A[React Frontend] -->|HTTP| B[Spring Boot Backend]
    B -->|JDBC| C[MySQL Database]
    B -->|MongoDB Driver| D[MongoDB - optional]
    A -->|Fetch API / Axios| B
    B -->|Swagger UI| E[OpenAPI Documentation]
    B -->|JWT Tokens| F[Authentication - not enforced]
    F -->|User Credentials| B
    B -->|Data Seeding| C

5. DevOps, Delivery & Runtime Options

5.1 Local orchestration

5.2 Kubernetes manifests

5.3 Terraform stack

flowchart LR
    DevEnv[Developer Workstation]
    Jenkins[Jenkins Pipeline]
    ECR[ECR Repositories]
    EKS[EKS Cluster]
    RDS[(RDS MySQL)]

    DevEnv -->|git push| Jenkins
    Jenkins -->|docker build & push| ECR
    ECR -->|pull images| EKS
    EKS -->|JDBC 3306| RDS

    subgraph Local Tooling
        Compose[Docker Compose]
        Scripts[Makefile + scripts]
    end
    DevEnv --> Compose
    DevEnv --> Scripts

    subgraph AWS
        VPC[VPC & Subnets]
        VPC --> EKS
        VPC --> RDS
    end
    Jenkins -->|terraform apply| VPC

5.4 CI/CD

5.5 Ancillary assets


6. Security & Compliance Considerations

flowchart TD
    A[Public Internet] -->|HTTP| B[Load Balancer / Nginx]
    B -->|HTTP| C[Spring Boot Backend]
    C -->|JDBC| D[MySQL Database]
    C -->|MongoDB Driver| E[MongoDB - optional]

    subgraph Security Layers
        F[WAF / Firewall]
        G[Authentication & Authorization]
        H[Secrets Management]
        I[Database Migrations]
        J[Data Seeding Controls]
        K[CORS Policies]
    end

    A --> F
    F --> B
    B --> G
    C --> H
    C --> I
    C --> J
    C --> K

7. Reference Map

Capability Primary Location
React SPA frontend/src
API controllers backend/src/main/java/com/example/employeemanagement/controller
Services backend/src/main/java/com/example/employeemanagement/service
Repositories backend/src/main/java/com/example/employeemanagement/repository
Entities backend/src/main/java/com/example/employeemanagement/model
Security configuration backend/src/main/java/com/example/employeemanagement/security
Data seeding backend/src/main/java/com/example/employeemanagement/config/DataInitializer.java
Docker Compose docker-compose.yml
Kubernetes manifests kubernetes/
Terraform AWS stack terraform/
Scripts & automation scripts/ and Makefile

Document version: 2024-06-10 Author: Son Nguyen Version: 1.0.0