# kirubaamalar/tanmag architecture

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

- Interactive diagram: https://gitdiagram.com/kirubaamalar/tanmag
- Repository: https://github.com/kirubaamalar/tanmag

## Overview

#### Purpose and deployment model
TANMAG HRMS is a Frappe/Bench-installed HR management app with a separate Vue single-page frontend. The Python app supplies Frappe API endpoints and hooks; the built frontend is served as static assets. Installation enters through the Frappe app package and Bench commands described in `README.md`.
- `hrms_tanmag/__init__.py`
- `hrms_tanmag/hooks.py`
- `pyproject.toml`

#### Backend API boundary
Server functionality is organized by HR domain into Python API modules: authentication, dashboard data, employees, permissions, user permissions, and workflows. These modules are the primary boundary between the Vue UI and Frappe’s document/database, session, and authorization facilities.
- `hrms_tanmag/api/auth.py`
- `hrms_tanmag/api/employee.py`
- `hrms_tanmag/api/workflow.py`

#### Frontend bootstrap and application shell
The frontend is a Vite-built Vue application. `main.js` mounts the app; `App.vue` and layout components establish the authenticated shell, header, sidebar, and page content region. The sidebar is driven by centralized navigation configuration, making navigation/feature visibility a key UI control point.
- `frontend/src/main.js`
- `frontend/src/App.vue`
- `frontend/src/components/layout/AppShell.vue`
- `frontend/src/config/navigation.js`

#### Client routing and access state
Vue Router selects login, dashboard, employee, and settings views. Pinia-style stores separate general application state from authentication state; the auth store is the likely owner of logged-in identity/session state and route-access decisions.
- `frontend/src/router/index.js`
- `frontend/src/stores/auth.js`
- `frontend/src/stores/app.js`
- `frontend/src/views/Auth/Login.vue`

#### API client and domain integrations
Frontend API wrappers mirror backend domains. A shared client/service layer should own request transport, endpoint configuration, and session/error behavior; feature views call domain wrappers rather than directly coupling to backend endpoints.
- `frontend/src/api/client.js`
- `frontend/src/api/auth.js`
- `frontend/src/api/employee.js`
- `frontend/src/services/api.js`

#### Primary HR and administration flows
After login, users enter a dashboard and navigate to employee management or settings. Employee list/form views support HR record workflows. Settings screens administer role permissions, per-user permissions, sidebar assignments, and configurable workflows; these UI domains map directly to corresponding backend API modules.
- `frontend/src/views/Employees/EmployeeList.vue`
- `frontend/src/views/Employees/EmployeeForm.vue`
- `frontend/src/views/Settings/RolePermissionManager.vue`
- `frontend/src/views/Settings/WorkflowList.vue`
- `hrms_tanmag/api/permissions.py`
- `hrms_tanmag/api/user_permissions.py`

#### Build, static delivery, and infrastructure
Node/Vite compiles the Vue source into deployable static files. Built artifacts are present under the Frappe app’s public directory, with an additional repository-level `public/frontend` bundle. Runtime infrastructure is Frappe running under Bench, which hosts Python APIs and static assets; no independent backend service or external SaaS integration is evidenced.
- `frontend/package.json`
- `frontend/vite.config.js`
- `hrms_tanmag/public/frontend/index.html`
- `hrms_tanmag/public/frontend/assets/index-Djq0Q4nD.js`

Main entry points: [`frontend/src/api/client.js`](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/api/client.js) (API client and wrappers), [`hrms_tanmag/__init__.py`](https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/__init__.py) (Frappe app package), [`frontend/src/components/layout/AppShell.vue`](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/components/layout/AppShell.vue) (Authenticated app shell), [`frontend/src/router/index.js`](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/router/index.js) (Client router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Vue Frontend"]
  node_frontend_entry["Vue bootstrap<br/>frontend entry<br/>[main.js]"]
  node_app_shell["Authenticated app shell<br/>Vue layout<br/>[AppShell.vue]"]
  node_navigation["Navigation configuration<br/>UI access config<br/>[navigation.js]"]
  node_router["Client router<br/>Vue Router<br/>[index.js]"]
  node_auth_store["Authentication state<br/>Pinia store<br/>[auth.js]"]
  node_app_store["Application state<br/>Pinia store<br/>[app.js]"]
  node_hr_views["HR and admin views<br/>Vue feature views<br/>[EmployeeList.vue]"]
  node_api_client["API client and wrappers<br/>frontend API layer<br/>[client.js]"]
end

subgraph group_backend["Frappe App"]
  node_backend_app["Frappe app package<br/>Python app<br/>[__init__.py]"]
  node_auth_api["Authentication API<br/>Frappe API module<br/>[auth.py]"]
  node_employee_api["Employee API<br/>Frappe API module<br/>[employee.py]"]
  node_admin_apis["Permissions and workflow APIs<br/>Frappe API modules<br/>[permissions.py]"]
  node_frappe_platform[("Frappe documents and auth<br/>platform services")]
end

subgraph group_runtime["Build &amp; Runtime"]
  node_vite_build{{"Vite frontend build<br/>build pipeline<br/>[vite.config.js]"}}
  node_static_bundle["Deployed frontend bundle<br/>static assets<br/>[index.html]"]
  node_bench{{"Bench / Frappe runtime<br/>application runtime"}}
end

node_frontend_entry -->|"mounts"| node_app_shell
node_frontend_entry -->|"initializes"| node_router
node_app_shell -->|"renders from"| node_navigation
node_router -->|"checks access state"| node_auth_store
node_router -->|"routes to"| node_hr_views
node_app_shell -->|"uses"| node_app_store
node_hr_views -->|"calls"| node_api_client
node_auth_store -->|"authenticates through"| node_api_client
node_api_client -->|"auth requests"| node_auth_api
node_api_client -->|"employee requests"| node_employee_api
node_api_client -->|"administration requests"| node_admin_apis
node_backend_app -->|"exposes"| node_auth_api
node_backend_app -->|"exposes"| node_employee_api
node_backend_app -->|"exposes"| node_admin_apis
node_auth_api -->|"uses sessions and auth"| node_frappe_platform
node_employee_api -->|"uses documents"| node_frappe_platform
node_admin_apis -->|"uses authorization"| node_frappe_platform
node_vite_build -->|"compiles"| node_static_bundle
node_static_bundle -->|"served by"| node_bench
node_backend_app -->|"installed in"| node_bench

click node_frontend_entry "https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/main.js"
click node_app_shell "https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/components/layout/AppShell.vue"
click node_navigation "https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/config/navigation.js"
click node_router "https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/router/index.js"
click node_auth_store "https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/stores/auth.js"
click node_app_store "https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/stores/app.js"
click node_hr_views "https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/views/Employees/EmployeeList.vue"
click node_api_client "https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/api/client.js"
click node_backend_app "https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/__init__.py"
click node_auth_api "https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/api/auth.py"
click node_employee_api "https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/api/employee.py"
click node_admin_apis "https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/api/permissions.py"
click node_vite_build "https://github.com/kirubaamalar/tanmag/blob/develop/frontend/vite.config.js"
click node_static_bundle "https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/public/frontend/index.html"

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_frontend_entry,node_app_shell,node_navigation,node_router,node_auth_store,node_app_store,node_hr_views,node_api_client toneBlue
class node_backend_app,node_auth_api,node_employee_api,node_admin_apis,node_frappe_platform toneAmber
class node_vite_build,node_static_bundle,node_bench toneMint
```

## Components

### Vue Frontend

Vite-built single-page application.

- [Vue bootstrap](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/main.js): frontend entry · `frontend/src/main.js`
- [Authenticated app shell](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/components/layout/AppShell.vue): Vue layout · Provides header, sidebar, and page region. · `frontend/src/components/layout/AppShell.vue`
- [Navigation configuration](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/config/navigation.js): UI access config · Drives sidebar feature visibility. · `frontend/src/config/navigation.js`
- [Client router](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/router/index.js): Vue Router · Selects login, dashboard, employee, and settings views. · `frontend/src/router/index.js`
- [Authentication state](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/stores/auth.js): Pinia store · Owns identity, session state, and route access. · `frontend/src/stores/auth.js`
- [Application state](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/stores/app.js): Pinia store · `frontend/src/stores/app.js`
- [HR and admin views](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/views/Employees/EmployeeList.vue): Vue feature views · Employee workflows and administration settings. · `frontend/src/views/Employees/EmployeeList.vue`
- [API client and wrappers](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/src/api/client.js): frontend API layer · Centralizes transport, session handling, and domain calls. · `frontend/src/api/client.js`

### Frappe App

HRMS APIs and Frappe integration.

- [Frappe app package](https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/__init__.py): Python app · Bench-installed HRMS application and hook entry point. · `hrms_tanmag/__init__.py`
- [Authentication API](https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/api/auth.py): Frappe API module · `hrms_tanmag/api/auth.py`
- [Employee API](https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/api/employee.py): Frappe API module · `hrms_tanmag/api/employee.py`
- [Permissions and workflow APIs](https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/api/permissions.py): Frappe API modules · Supports role, user permission, sidebar, and workflow administration. · `hrms_tanmag/api/permissions.py`
- **Frappe documents and auth**: platform services · Document storage, sessions, and authorization facilities.

### Build & Runtime

- [Vite frontend build](https://github.com/kirubaamalar/tanmag/blob/develop/frontend/vite.config.js): build pipeline · `frontend/vite.config.js`
- [Deployed frontend bundle](https://github.com/kirubaamalar/tanmag/blob/develop/hrms_tanmag/public/frontend/index.html): static assets · Compiled SPA served from the Frappe app public directory. · `hrms_tanmag/public/frontend/index.html`
- **Bench / Frappe runtime**: application runtime · Hosts APIs and static frontend assets.

## Connections

- Vue bootstrap → Authenticated app shell: mounts
- Vue bootstrap → Client router: initializes
- Authenticated app shell → Navigation configuration: renders from
- Client router → Authentication state: checks access state
- Client router → HR and admin views: routes to
- Authenticated app shell → Application state: uses
- HR and admin views → API client and wrappers: calls
- Authentication state → API client and wrappers: authenticates through
- API client and wrappers → Authentication API: auth requests
- API client and wrappers → Employee API: employee requests
- API client and wrappers → Permissions and workflow APIs: administration requests
- Frappe app package → Authentication API: exposes
- Frappe app package → Employee API: exposes
- Frappe app package → Permissions and workflow APIs: exposes
- Authentication API → Frappe documents and auth: uses sessions and auth
- Employee API → Frappe documents and auth: uses documents
- Permissions and workflow APIs → Frappe documents and auth: uses authorization
- Vite frontend build → Deployed frontend bundle: compiles
- Deployed frontend bundle → Bench / Frappe runtime: served by
- Frappe app package → Bench / Frappe runtime: installed in
