# ksazim/skillify-hrm-frontend architecture

> Architecture diagram of the GitHub repository ksazim/skillify-hrm-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ksazim/skillify-hrm-frontend
- Repository: https://github.com/ksazim/skillify-hrm-frontend

## Overview

1. **What this repo is**
   - A single-page admin frontend built with **Vue 3** and **Pinia** for an HRM-style dashboard.
   - The app is organized as a feature-driven admin shell with many modules: HR, projects, announcements, products/orders, company setup, and system settings.

2. **Top-level application shell**
   - `src/main.js` is the app entry point.
   - `src/App.vue` is the root component mounted into `public/index.html`.
   - `src/routes/index.js` appears to be the route composition point, with feature route files split by domain.

3. **Routing boundary**
   - Routing is separated into modules under `src/routes/`:
     - `admin.js` for dashboard/admin pages
     - `attendance.js`, `company.js`, `employee.js`, `leave.js`, `payroll.js`, `user.js`
   - This suggests the UI is navigated entirely through client-side routing, with each feature owning its own route subtree.

4. **Admin layout system**
   - `src/admin/layouts/` contains reusable layout shells:
     - `LayoutOne.vue`, `LayoutTwo.vue`
     - shared chrome in `HeaderComponent.vue`, `SidebarComponent.vue`, `FooterComponent.vue`
   - These layouts define the main navigation and page framing for the admin experience, while individual modules supply the content.

5. **Feature modules as the core domain layer**
   - Most business logic lives under `src/admin/modules/`.
   - The repo is organized by domain rather than by technical layer:
     - HR: employee, attendance, leave, payroll, company, auth, user
     - Projects: projects, tasks, milestones, team assignments
     - Business/admin: products, categories, orders, subscriptions, flash sales
     - Communications: announcements, notice board
     - Website/config: carousel, FAQ, country
   - This structure makes each module a self-contained UI + data-management boundary.

6. **Reusable CRUD UI building blocks**
   - Shared module components live in `src/admin/modules/components/`.
   - Notable cross-cutting pieces:
     - `CrudLayout.vue`
     - `TableComponent.vue`
     - `PaginationComponent.vue`
     - `FilterComponent.vue`
     - modal components for actions, invoices, notifications
   - This indicates a repeated CRUD interaction model across most modules: list, filter, paginate, edit/create via modal or form.

7. **State management and shared stores**
   - `src/store/` contains Pinia stores, including:
     - `auth.js` for login/session state
     - `crud.js` and `crud-backup.js` for generic data operations
     - `pagination.js` for paging state
     - `appConfig.js`, `system.js`, `common.js`, `company.js`
   - The architecture centralizes API/data concerns in stores, while components focus on rendering and user interaction.

8. **Authorization and app configuration**
   - `src/directives/can.js` suggests permission-based UI gating, likely used to hide/show actions by role.
   - `src/composables/useAppConfig.js` and `src/store/appConfig.js` point to a shared configuration layer.
   - This is important for diagrams because access control and configuration are cross-cutting concerns, not isolated to one feature.

9. **Backend/API boundary**
   - The README shows API endpoints configured through `.env`:
     - `VUE_APP_BASE_API`
     - `VUE_APP_BASE_URL`
   - The app is designed to talk to a backend service, but the README also says it can run in **mock mode** with hardcoded/default data and mock login.
   - So the frontend has a clear external boundary to an API/storage backend, but can also operate without it during development.

10. **Operational modes and dependencies**
   - The project uses standard Vue tooling: **Vue CLI** config (`vue.config.js`), Babel, and pnpm.
   - `dist.zip` and backup/copy files in the tree suggest active iteration and some duplicated module variants, which is useful to treat as non-canonical or legacy paths in an architecture diagram.
   - The main architectural pattern remains stable: route -> layout -> feature module -> shared CRUD components -> Pinia store -> API/mock data.

11. **How data typically flows**
   - User navigation enters through route files.
   - Routes mount a layout shell, then a module page.
   - The module uses shared CRUD/table/filter/pagination components.
   - Those components dispatch actions through Pinia stores.
   - Stores either call the backend API or return mock data depending on environment/mode.
   - Permission directives and auth state constrain which actions/pages are available.

12. **Best way to diagram this repo**
   - Draw one outer **Vue SPA shell**.
   - Inside it, show:
     - **Routing layer**
     - **Admin layouts**
     - **Feature modules by domain**
     - **Shared CRUD UI components**
     - **Pinia stores**
     - **Auth/permission/config cross-cutting services**
   - Outside the app boundary, show an **API/storage backend** and note **mock mode** as an alternate path used in development.

Main entry points: [`src/routes/admin.js`](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/routes/admin.js) (Admin routes), [`src/admin/modules/components/CrudLayout.vue`](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/components/CrudLayout.vue) (CRUD UI), [`src/routes/employee.js`](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/routes/employee.js) (HR routes), [`src/store/crud.js`](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/store/crud.js) (Pinia stores)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["SPA shell"]
  node_main(("Main entry<br/>Vue bootstrap<br/>[main.js]"))
  node_app_root["App shell<br/>Root component<br/>[App.vue]"]
end

subgraph group_routing["Routing"]
  node_route_index["Route map<br/>Route composition<br/>[index.js]"]
  node_route_admin["Admin routes<br/>Route subtree<br/>[admin.js]"]
  node_route_hr["HR routes<br/>Route subtree<br/>[employee.js]"]
end

subgraph group_layouts["Admin layouts"]
  node_layout_one["Layout one<br/>Admin shell<br/>[LayoutOne.vue]"]
  node_layout_two["Layout two<br/>Admin shell<br/>[LayoutTwo.vue]"]
  node_header["Header<br/>Chrome component"]
  node_sidebar["Sidebar<br/>Chrome component"]
end

subgraph group_features["Feature modules"]
  node_dashboard["Dashboard<br/>Admin page<br/>[DashboardPage.vue]"]
  node_login["Login<br/>Auth page<br/>[LoginPage.vue]"]
  node_hr_employee["Employees<br/>HR module"]
  node_hr_attendance["Attendance<br/>HR module"]
  node_hr_leave["Leave<br/>HR module"]
  node_hr_payroll["Payroll<br/>HR module<br/>[PayrollModule.vue]"]
  node_projects["Projects<br/>Work module<br/>[ProjecTs.vue]"]
  node_commerce["Catalog & orders<br/>Commerce module<br/>[ProductModule.vue]"]
  node_announcements["Announcements<br/>Comms module"]
  node_website["Website setup<br/>Config module<br/>[CarouselModule.vue]"]
end

subgraph group_shared["Shared UI"]
  node_crud_ui["CRUD UI<br/>Shared components<br/>[CrudLayout.vue]"]
  node_table_ui["Tables<br/>Shared components<br/>[TableComponent.vue]"]
end

subgraph group_state["State"]
  node_stores[("Pinia stores<br/>State layer<br/>[crud.js]")]
  node_auth_store[("Auth store<br/>Session state<br/>[auth.js]")]
end

subgraph group_crosscutting["Cross-cutting"]
  node_app_config{{"App config<br/>Config layer<br/>[appConfig.js]"}}
  node_permission{{"Permissions<br/>Directive<br/>[can.js]"}}
end

subgraph group_external["Backend boundary"]
  node_backend[("API backend<br/>Remote service")]
  node_mock_mode[("Mock mode<br/>Local fallback<br/>[README.md]")]
end

node_main -->|"mounts"| node_app_root
node_app_root -->|"installs"| node_route_index
node_route_index -->|"includes"| node_route_admin
node_route_index -->|"includes"| node_route_hr
node_route_admin -->|"uses"| node_layout_one
node_route_admin -->|"uses"| node_layout_two
node_route_hr -->|"uses"| node_layout_one
node_layout_one -->|"composes"| node_header
node_layout_one -->|"composes"| node_sidebar
node_layout_two -->|"composes"| node_header
node_layout_two -->|"composes"| node_sidebar
node_route_admin -->|"mounts"| node_dashboard
node_route_admin -->|"mounts"| node_login
node_route_hr -->|"mounts"| node_hr_employee
node_route_hr -->|"mounts"| node_hr_attendance
node_route_hr -->|"mounts"| node_hr_leave
node_route_hr -->|"mounts"| node_hr_payroll
node_route_admin -->|"mounts"| node_projects
node_route_admin -->|"mounts"| node_commerce
node_route_admin -->|"mounts"| node_announcements
node_route_admin -->|"mounts"| node_website
node_hr_employee -->|"uses"| node_crud_ui
node_hr_attendance -->|"uses"| node_crud_ui
node_hr_leave -->|"uses"| node_crud_ui
node_hr_payroll -->|"uses"| node_crud_ui
node_projects -->|"uses"| node_table_ui
node_commerce -->|"uses"| node_crud_ui
node_announcements -->|"uses"| node_crud_ui
node_crud_ui -->|"dispatches to"| node_stores
node_table_ui -->|"dispatches to"| node_stores
node_stores -->|"includes"| node_auth_store
node_stores -->|"includes"| node_app_config
node_stores -->|"fetches from"| node_backend
node_stores -.->|"falls back to"| node_mock_mode
node_permission -->|"guards"| node_dashboard
node_permission -->|"guards"| node_hr_employee
node_auth_store -->|"drives"| node_permission
node_app_config -->|"configures"| node_backend

click node_main "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/main.js"
click node_app_root "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/App.vue"
click node_route_index "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/routes/index.js"
click node_route_admin "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/routes/admin.js"
click node_route_hr "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/routes/employee.js"
click node_layout_one "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/layouts/LayoutOne.vue"
click node_layout_two "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/layouts/LayoutTwo.vue"
click node_header "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/layouts/components/HeaderComponent.vue"
click node_sidebar "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/layouts/components/SidebarComponent.vue"
click node_dashboard "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/DashboardPage.vue"
click node_login "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/LoginPage.vue"
click node_hr_employee "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/employee/EmployeeManagement.vue"
click node_hr_attendance "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/attendance/EmployeeAttendance.vue"
click node_hr_leave "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/leave/LeaveManagement.vue"
click node_hr_payroll "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/payroll/PayrollModule.vue"
click node_projects "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/projects/ProjecTs.vue"
click node_commerce "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/ProductModule.vue"
click node_announcements "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/announcements/NoticeManagement.vue"
click node_website "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/website/CarouselModule.vue"
click node_crud_ui "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/components/CrudLayout.vue"
click node_table_ui "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/components/TableComponent.vue"
click node_stores "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/store/crud.js"
click node_auth_store "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/store/auth.js"
click node_app_config "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/store/appConfig.js"
click node_permission "https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/directives/can.js"
click node_mock_mode "https://github.com/ksazim/skillify-hrm-frontend/blob/main/README.md"

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_main,node_app_root,node_app_config,node_permission toneBlue
class node_route_index,node_route_admin,node_route_hr,node_backend,node_mock_mode toneAmber
class node_layout_one,node_layout_two,node_header,node_sidebar toneMint
class node_dashboard,node_login,node_hr_employee,node_hr_attendance,node_hr_leave,node_hr_payroll,node_projects,node_commerce,node_announcements,node_website toneRose
class node_crud_ui,node_table_ui toneIndigo
class node_stores,node_auth_store toneTeal
```

## Components

### SPA shell

Vue application entry and root mount

- [Main entry](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/main.js): Vue bootstrap · Application bootstrap and global initialization · `src/main.js`
- [App shell](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/App.vue): Root component · Top-level mounted SPA component · `src/App.vue`

### Routing

Client-side route composition and feature route subtrees

- [Route map](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/routes/index.js): Route composition · Central route composition point · `src/routes/index.js`
- [Admin routes](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/routes/admin.js): Route subtree · Dashboard and admin page routes · `src/routes/admin.js`
- [HR routes](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/routes/employee.js): Route subtree · Employee, attendance, leave, payroll, and user routes · `src/routes/employee.js`

### Admin layouts

Reusable page shells and chrome

- [Layout one](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/layouts/LayoutOne.vue): Admin shell · Primary admin page frame · `src/admin/layouts/LayoutOne.vue`
- [Layout two](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/layouts/LayoutTwo.vue): Admin shell · Alternative admin page frame · `src/admin/layouts/LayoutTwo.vue`
- [Header](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/layouts/components/HeaderComponent.vue): Chrome component · Top navigation and header chrome · `src/admin/layouts/components/HeaderComponent.vue`
- [Sidebar](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/layouts/components/SidebarComponent.vue): Chrome component · Main navigation sidebar · `src/admin/layouts/components/SidebarComponent.vue`

### Feature modules

Domain-oriented UI and workflow modules

- [Dashboard](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/DashboardPage.vue): Admin page · Landing dashboard for admin users · `src/admin/modules/DashboardPage.vue`
- [Login](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/LoginPage.vue): Auth page · Authentication entry page · `src/admin/modules/LoginPage.vue`
- [Employees](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/employee/EmployeeManagement.vue): HR module · Employee management boundary · `src/admin/modules/employee/EmployeeManagement.vue`
- [Attendance](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/attendance/EmployeeAttendance.vue): HR module · Attendance tracking and history · `src/admin/modules/attendance/EmployeeAttendance.vue`
- [Leave](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/leave/LeaveManagement.vue): HR module · Leave requests and leave types · `src/admin/modules/leave/LeaveManagement.vue`
- [Payroll](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/payroll/PayrollModule.vue): HR module · Payroll operations and records · `src/admin/modules/payroll/PayrollModule.vue`
- [Projects](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/projects/ProjecTs.vue): Work module · Projects, tasks, milestones, and assignments · `src/admin/modules/projects/ProjecTs.vue`
- [Catalog & orders](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/ProductModule.vue): Commerce module · Products, categories, orders, subscriptions, flash sales · `src/admin/modules/ProductModule.vue`
- [Announcements](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/announcements/NoticeManagement.vue): Comms module · Notice board and announcement management · `src/admin/modules/announcements/NoticeManagement.vue`
- [Website setup](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/website/CarouselModule.vue): Config module · Carousel, FAQ, and country setup · `src/admin/modules/website/CarouselModule.vue`

### Shared UI

Reusable CRUD and form building blocks

- [CRUD UI](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/components/CrudLayout.vue): Shared components · Reusable list, form, modal, and pagination primitives · `src/admin/modules/components/CrudLayout.vue`
- [Tables](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/admin/modules/components/TableComponent.vue): Shared components · Tabular rendering and row actions · `src/admin/modules/components/TableComponent.vue`

### State

Pinia stores for auth, data, and app state

- [Pinia stores](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/store/crud.js): State layer · Auth, CRUD, pagination, and domain state · `src/store/crud.js`
- [Auth store](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/store/auth.js): Session state · Login and session state · `src/store/auth.js`

### Cross-cutting

Authorization and configuration concerns

- [App config](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/store/appConfig.js): Config layer · Shared app configuration and environment wiring · `src/store/appConfig.js`
- [Permissions](https://github.com/ksazim/skillify-hrm-frontend/blob/main/src/directives/can.js): Directive · Role-based UI gating · `src/directives/can.js`

### Backend boundary

API and mock data/runtime boundary

- **API backend**: Remote service · Configured backend API and storage boundary
- [Mock mode](https://github.com/ksazim/skillify-hrm-frontend/blob/main/README.md): Local fallback · Development fallback with default or hardcoded data · `README.md`

## Connections

- Main entry → App shell: mounts · Bootstraps the root Vue component
- App shell → Route map: installs · Root app wires client-side routing
- Route map → Admin routes: includes · Composes admin route subtree
- Route map → HR routes: includes · Composes HR-related route subtree
- Admin routes → Layout one: uses · Admin pages render inside the primary shell
- Admin routes → Layout two: uses · Some views render inside an alternate shell
- HR routes → Layout one: uses · HR pages render in the admin shell
- Layout one → Header: composes · Shell includes header chrome
- Layout one → Sidebar: composes · Shell includes sidebar navigation
- Layout two → Header: composes · Alternate shell reuses header chrome
- Layout two → Sidebar: composes · Alternate shell reuses sidebar chrome
- Admin routes → Dashboard: mounts · Route entry to dashboard page
- Admin routes → Login: mounts · Route entry to authentication page
- HR routes → Employees: mounts · Employee management page subtree
- HR routes → Attendance: mounts · Attendance page subtree
- HR routes → Leave: mounts · Leave management page subtree
- HR routes → Payroll: mounts · Payroll page subtree
- Admin routes → Projects: mounts · Project workflow pages
- Admin routes → Catalog & orders: mounts · Catalog and order management pages
- Admin routes → Announcements: mounts · Announcement and notice pages
- Admin routes → Website setup: mounts · Site configuration pages
- Employees → CRUD UI: uses · Employee screens rely on shared CRUD patterns
- Attendance → CRUD UI: uses · Attendance screens rely on shared CRUD patterns
- Leave → CRUD UI: uses · Leave screens rely on shared CRUD patterns
- Payroll → CRUD UI: uses · Payroll screens rely on shared CRUD patterns
- Projects → Tables: uses · Project views rely on tables and row actions
- Catalog & orders → CRUD UI: uses · Commerce management uses shared CRUD primitives
- Announcements → CRUD UI: uses · Announcements use the common admin interaction model
- CRUD UI → Pinia stores: dispatches to · Shared components read and update global state
- Tables → Pinia stores: dispatches to · List views coordinate through Pinia stores
- Pinia stores → Auth store: includes · Auth state is a core store
- Pinia stores → App config: includes · Configuration state is shared across modules
- Pinia stores → API backend: fetches from · Primary path to remote API and persistence
- Pinia stores → Mock mode: falls back to · Development and demo fallback path
- Permissions → Dashboard: guards · Permissions can hide or reveal admin actions
- Permissions → Employees: guards · Role checks apply across feature pages
- Auth store → Permissions: drives · Session state informs access control
- App config → API backend: configures · Environment variables define the API boundary
