# onetalentteam/hrm-project-temp architecture

> Architecture diagram of the GitHub repository onetalentteam/hrm-project-temp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/onetalentteam/hrm-project-temp
- Repository: https://github.com/onetalentteam/hrm-project-temp

## Overview

##### Project type and purpose
- This is a front-end monorepo containing two single-page applications (SPAs) built with React + TypeScript + Vite:
– An “Admin” SPA under src/admin for HR management (attendance, recruitment, tasks, teams, etc.)
– A “Client” SPA under src/client for public-facing career pages, sign-in, forgot-password, home, etc.
- It relies on a shared API service layer (src/api) to communicate with backend REST endpoints (auth, attendance, project, user, etc.).

##### File structure
- Top-level:
– public/: static assets (PDFs, favicon)
– src/:
· admin/: all admin pages, layouts, components, React Query hooks for data
· client/: all client pages, shared UI components, layouts, React Query hooks
· api/: axios configuration and typed services for each resource
· components/: design-system and general UI building blocks
· hooks/, lib/, types/: shared logic and typings
· main.tsx & vite.config.ts: entrypoints and build configuration
- Patterns & conventions:
– Component-based design in React, Atomic-style under components/ui
– Data fetching via custom hooks (useXxxQuery) and React-Query
– Modular pages for each feature (attendance, recruitment/jobs/applications/letters/posts, etc.)
– Monorepo style with shared code for both SPAs

##### Key insights from README
- Uses Vite as build tool with Fast Refresh (plugin-react or plugin-react-swc)
- ESLint and Prettier configured for TypeScript + React

## Diagram (Mermaid)

```mermaid
flowchart TD
    DeveloperEnv["Developer Environment"]:::infra
    DevServer["Vite Dev Server"]:::infra
    DeveloperEnv -->|"develop"| DevServer

    subgraph "Frontend Applications"
        AdminSPA["Admin SPA"]:::frontend
        ClientSPA["Client SPA"]:::frontend
    end
    DevServer --> AdminSPA
    DevServer --> ClientSPA

    subgraph "Shared Layer"
        APIService["API Service Layer"]:::shared
        UIComponents["UI Components"]:::shared
        GenComponents["General Components"]:::shared
        Hooks["Shared React Hooks"]:::shared
        Lib["Utility Library"]:::shared
        Types["Type Definitions"]:::shared
    end

    AdminSPA -->|"uses UI Components"| UIComponents
    AdminSPA -->|"uses General Components"| GenComponents
    AdminSPA -->|"uses Hooks"| Hooks
    AdminSPA -->|"calls API"| APIService

    ClientSPA -->|"uses UI Components"| UIComponents
    ClientSPA -->|"uses General Components"| GenComponents
    ClientSPA -->|"uses Hooks"| Hooks
    ClientSPA -->|"calls API"| APIService

    AdminSPA --> AdminRoutesNode["Admin Routes Config"]:::shared
    AdminSPA --> AdminLayoutNode["Admin Layout"]:::shared
    ClientSPA --> ClientRoutesNode["Client Routes Config"]:::shared
    ClientSPA --> ClientLayoutNode["Client Layout"]:::shared

    DevServer --> AppEntry["App Entrypoint"]:::shared
    DevServer --> ViteConfigNode["Vite Config"]:::shared

    APIService -->|"HTTP (Axios)"| AuthService["Auth Service"]:::backend

    subgraph "HR Microservices"
        Attendance["Attendance Service"]:::backend
        Recruitment["Recruitment Service"]:::backend
        Projects["Projects Service"]:::backend
        Tasks["Tasks Service"]:::backend
        Teams["Teams Service"]:::backend
        Users["Users Service"]:::backend
        Workshifts["Workshifts Service"]:::backend
        Settings["Settings Service"]:::backend
        Logs["Logs Service"]:::backend
    end

    APIService -->|"HTTP (Axios)"| Attendance
    APIService -->|"HTTP (Axios)"| Recruitment
    APIService -->|"HTTP (Axios)"| Projects
    APIService -->|"HTTP (Axios)"| Tasks
    APIService -->|"HTTP (Axios)"| Teams
    APIService -->|"HTTP (Axios)"| Users
    APIService -->|"HTTP (Axios)"| Workshifts
    APIService -->|"HTTP (Axios)"| Settings
    APIService -->|"HTTP (Axios)"| Logs

    subgraph Infrastructure
        DB["Database"]:::infra
        FileStorage["File Storage"]:::infra
        StaticAssets["Static Assets"]:::infra
        CDN["CDN/Static Host"]:::infra
    end

    Attendance -->|"Reads/Writes"| DB
    Recruitment -->|"Reads/Writes"| DB
    Projects -->|"Reads/Writes"| DB
    Tasks -->|"Reads/Writes"| DB
    Teams -->|"Reads/Writes"| DB
    Users -->|"Reads/Writes"| DB
    Workshifts -->|"Reads/Writes"| DB
    Settings -->|"Reads/Writes"| DB
    Logs -->|"Reads/Writes"| DB

    Attendance -->|"uploads/downloads"| FileStorage
    Recruitment -->|"uploads/downloads"| FileStorage
    Projects -->|"uploads/downloads"| FileStorage
    Tasks -->|"uploads/downloads"| FileStorage
    Teams -->|"uploads/downloads"| FileStorage
    Users -->|"uploads/downloads"| FileStorage
    Workshifts -->|"uploads/downloads"| FileStorage
    Settings -->|"uploads/downloads"| FileStorage
    Logs -->|"uploads/downloads"| FileStorage

    DevServer -->|"build"| StaticAssets
    StaticAssets --> CDN

    %% Click Events
    click AdminSPA "https://github.com/onetalentteam/hrm-project-temp/tree/web-ui/src/admin"
    click ClientSPA "https://github.com/onetalentteam/hrm-project-temp/tree/web-ui/src/client"
    click APIService "https://github.com/onetalentteam/hrm-project-temp/tree/web-ui/src/api"
    click UIComponents "https://github.com/onetalentteam/hrm-project-temp/tree/web-ui/src/components/ui"
    click GenComponents "https://github.com/onetalentteam/hrm-project-temp/tree/web-ui/src/components"
    click Hooks "https://github.com/onetalentteam/hrm-project-temp/tree/web-ui/src/hooks"
    click Lib "https://github.com/onetalentteam/hrm-project-temp/tree/web-ui/src/lib"
    click Types "https://github.com/onetalentteam/hrm-project-temp/tree/web-ui/src/types"
    click AdminRoutesNode "https://github.com/onetalentteam/hrm-project-temp/blob/web-ui/src/routes/admin-routes.tsx"
    click ClientRoutesNode "https://github.com/onetalentteam/hrm-project-temp/blob/web-ui/src/routes/client-routes.tsx"
    click AdminLayoutNode "https://github.com/onetalentteam/hrm-project-temp/blob/web-ui/src/admin/layout.tsx"
    click ClientLayoutNode "https://github.com/onetalentteam/hrm-project-temp/blob/web-ui/src/client/layout.tsx"
    click AppEntry "https://github.com/onetalentteam/hrm-project-temp/blob/web-ui/src/main.tsx"
    click ViteConfigNode "https://github.com/onetalentteam/hrm-project-temp/blob/web-ui/vite.config.ts"

    classDef frontend fill:#add8e6,stroke:#000,stroke-width:1px
    classDef shared fill:#90ee90,stroke:#000,stroke-width:1px
    classDef backend fill:#ffcc99,stroke:#000,stroke-width:1px
    classDef infra fill:#d3d3d3,stroke:#000,stroke-width:1px
```
