# khanhhuyen25-01/web-fitlife architecture

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

- Interactive diagram: https://gitdiagram.com/khanhhuyen25-01/web-fitlife
- Repository: https://github.com/khanhhuyen25-01/web-fitlife

## Overview

1. FITLIFE is a single-page admin frontend built with Vue 3 and Vite. The repository contains only the client application; there is no backend service, API client layer, or database code in this repo.

2. The app is organized around route-driven pages under `src/pages/admin/*`. Each major business area is a separate view: dashboard, members (`hoivien`), trainers (`huanluyenvien`), schedule/shift management (`lich`), statistics (`solieu`), billing (`hoadon`), activity history (`lichsuhoatdong`), settings (`caidat`), profile, and login.

3. Routing is the main navigation boundary. `src/router/index.js` likely maps URL paths to those page components and decides which layout wrapper to use. The architecture is page-first rather than component-first, which is typical for an admin console.

4. Layout composition is split from business pages. `src/layout/wrapper/Admin/layoutAdmin.vue` provides the authenticated/admin shell, while `src/layout/wrapper/blank.vue` is used for minimal pages such as login. This creates a clear separation between public/auth screens and the admin experience.

5. The admin shell is assembled from reusable chrome components in `src/layout/components/Admin/`: `MenuRocker.vue` is the sidebar/navigation surface, and `TopRocker.vue` is the top header. These components frame all admin pages and likely persist across route changes.

6. `src/main.js` and `src/App.vue` form the application bootstrap layer. `main.js` initializes the Vue app and global assets, while `App.vue` is the root container that renders routed content and/or layout selection.

7. The application is heavily styled through a large static asset bundle in `src/assets/`. This includes custom CSS themes (`app.css`, `dark-theme.css`, `semi-dark.css`, `admin-dark.css`), Bootstrap variants, icon fonts, and many vendor styles/scripts. The UI is therefore theme-driven and relies on imported asset packs rather than handcrafted component libraries alone.

8. A significant part of the frontend capability comes from prepackaged plugins under `src/assets/plugins/`. These include charting and analytics libraries such as ApexCharts, Chart.js, Highcharts, Morris, Sparkline, and vector maps; calendar/date tools like FullCalendar and datetime pickers; table and selection tooling like datatable and Select2; and interaction utilities like perfect-scrollbar and simplebar.

9. The business modules in the README map directly to those plugin categories: dashboards and `solieu` likely use charts and KPI widgets, `lich` uses calendar/timeline controls, and management pages such as members/trainers use tables, filters, forms, and selectors. The asset structure suggests the UI is assembled from static admin-template patterns rather than a custom design system.

10. The `login` page is a separate entry point for authentication UX, but the repository does not show real auth integration. The README’s demo credentials imply login is simulated or stubbed in the frontend, with no external identity provider visible in the code tree.

11. Data flow appears to be local and presentation-oriented within this repo. Pages likely manage view state and render static or mocked administrative data, while any real persistence, approval workflow, or synchronization would need to be provided by an external backend not included here.

12. Overall architecture: route → layout wrapper → admin chrome component(s) → page module → vendor widget/assets. For diagramming, the important boundaries are the route/layout split, the admin vs blank shell, and the dependency on bundled static UI plugins for charts, tables, calendar, and form interactions.

Main entry points: [`src/layout/wrapper/Admin/layoutAdmin.vue`](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/layout/wrapper/Admin/layoutAdmin.vue) (Admin shell), [`src/assets/plugins`](https://github.com/khanhhuyen25-01/web-fitlife/tree/main/src/assets/plugins) (UI plugins), [`src/router/index.js`](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/router/index.js) (router), [`src/App.vue`](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/App.vue) (App.vue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["App Core"]
  node_main["main.js<br/>bootstrap<br/>[main.js]"]
  node_app["App.vue<br/>root shell<br/>[App.vue]"]
  node_router["router<br/>route map<br/>[index.js]"]
end

subgraph group_shell["Admin Shell"]
  node_admin_layout["Admin shell<br/>layout<br/>[layoutAdmin.vue]"]
  node_blank_layout["Blank shell<br/>layout<br/>[blank.vue]"]
  node_menu["Sidebar<br/>chrome<br/>[MenuRocker.vue]"]
  node_topbar["Header<br/>chrome<br/>[TopRocker.vue]"]
end

subgraph group_pages["Admin Pages"]
  node_dashboard["Dashboard<br/>admin page<br/>[index.vue]"]
  node_members["Members<br/>admin page<br/>[index.vue]"]
  node_trainers["Trainers<br/>admin page<br/>[index.vue]"]
  node_schedule["Schedule<br/>admin page<br/>[index.vue]"]
  node_stats["Statistics<br/>admin page<br/>[index.vue]"]
  node_billing["Billing<br/>admin page<br/>[index.vue]"]
  node_activity["Activity log<br/>admin page<br/>[index.vue]"]
  node_settings["Settings<br/>admin page<br/>[index.vue]"]
  node_profile["Profile<br/>admin page<br/>[index.vue]"]
  node_classes["Programs<br/>admin page<br/>[index.vue]"]
  node_login["Login<br/>auth page<br/>[index.vue]"]
end

subgraph group_assets["Assets & Plugins"]
  node_themes["Theme assets<br/>styles"]
  node_plugins["UI plugins<br/>vendor bundle"]
end

node_main -->|"mounts"| node_app
node_app -->|"uses"| node_router
node_router -->|"admin routes"| node_admin_layout
node_router -->|"public routes"| node_blank_layout
node_admin_layout -->|"contains"| node_menu
node_admin_layout -->|"contains"| node_topbar
node_admin_layout -->|"routes to"| node_dashboard
node_admin_layout -->|"routes to"| node_members
node_admin_layout -->|"routes to"| node_trainers
node_admin_layout -->|"routes to"| node_schedule
node_admin_layout -->|"routes to"| node_stats
node_admin_layout -->|"routes to"| node_billing
node_admin_layout -->|"routes to"| node_activity
node_admin_layout -->|"routes to"| node_settings
node_admin_layout -->|"routes to"| node_profile
node_admin_layout -->|"routes to"| node_classes
node_blank_layout -->|"hosts"| node_login
node_dashboard -->|"uses"| node_plugins
node_stats -->|"uses"| node_plugins
node_schedule -->|"uses"| node_plugins
node_members -->|"uses"| node_plugins
node_billing -->|"uses"| node_plugins
node_settings -->|"uses"| node_themes
node_login -->|"uses"| node_themes

click node_main "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/main.js"
click node_app "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/App.vue"
click node_router "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/router/index.js"
click node_admin_layout "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/layout/wrapper/Admin/layoutAdmin.vue"
click node_blank_layout "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/layout/wrapper/blank.vue"
click node_menu "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/layout/components/Admin/MenuRocker.vue"
click node_topbar "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/layout/components/Admin/TopRocker.vue"
click node_dashboard "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/dashboard/index.vue"
click node_members "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/hoivien/index.vue"
click node_trainers "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/huanluyenvien/index.vue"
click node_schedule "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/lich/index.vue"
click node_stats "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/solieu/index.vue"
click node_billing "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/hoadon/index.vue"
click node_activity "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/lichsuhoatdong/index.vue"
click node_settings "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/caidat/index.vue"
click node_profile "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/profile/index.vue"
click node_classes "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/goitap/index.vue"
click node_login "https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/login/index.vue"
click node_themes "https://github.com/khanhhuyen25-01/web-fitlife/tree/main/src/assets"
click node_plugins "https://github.com/khanhhuyen25-01/web-fitlife/tree/main/src/assets/plugins"

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,node_router toneBlue
class node_admin_layout,node_blank_layout,node_menu,node_topbar toneAmber
class node_dashboard,node_members,node_trainers,node_schedule,node_stats,node_billing,node_activity,node_settings,node_profile,node_classes,node_login toneMint
class node_themes,node_plugins toneRose
```

## Components

### App Core

Vue entrypoint, root app, and routing boundary.

- [main.js](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/main.js): bootstrap · Initializes the Vue app. · `src/main.js`
- [App.vue](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/App.vue): root shell · Root container for routed views and layout selection. · `src/App.vue`
- [router](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/router/index.js): route map · Maps URL paths to page components and layouts. · `src/router/index.js`

### Admin Shell

Authenticated layout and persistent chrome.

- [Admin shell](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/layout/wrapper/Admin/layoutAdmin.vue): layout · Authenticated wrapper for admin screens. · `src/layout/wrapper/Admin/layoutAdmin.vue`
- [Blank shell](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/layout/wrapper/blank.vue): layout · Minimal wrapper for public/auth pages. · `src/layout/wrapper/blank.vue`
- [Sidebar](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/layout/components/Admin/MenuRocker.vue): chrome · Primary admin navigation surface. · `src/layout/components/Admin/MenuRocker.vue`
- [Header](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/layout/components/Admin/TopRocker.vue): chrome · Top header for admin pages. · `src/layout/components/Admin/TopRocker.vue`

### Admin Pages

Route-driven business views.

- [Dashboard](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/dashboard/index.vue): admin page · Overview and KPI landing view. · `src/pages/admin/dashboard/index.vue`
- [Members](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/hoivien/index.vue): admin page · Member management view. · `src/pages/admin/hoivien/index.vue`
- [Trainers](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/huanluyenvien/index.vue): admin page · Coach management view. · `src/pages/admin/huanluyenvien/index.vue`
- [Schedule](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/lich/index.vue): admin page · Shift and calendar management. · `src/pages/admin/lich/index.vue`
- [Statistics](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/solieu/index.vue): admin page · Reporting and analytics view. · `src/pages/admin/solieu/index.vue`
- [Billing](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/hoadon/index.vue): admin page · Invoice and payment management. · `src/pages/admin/hoadon/index.vue`
- [Activity log](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/lichsuhoatdong/index.vue): admin page · History of admin actions and events. · `src/pages/admin/lichsuhoatdong/index.vue`
- [Settings](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/caidat/index.vue): admin page · Application configuration screen. · `src/pages/admin/caidat/index.vue`
- [Profile](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/profile/index.vue): admin page · User profile view. · `src/pages/admin/profile/index.vue`
- [Programs](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/goitap/index.vue): admin page · Training or class program management. · `src/pages/admin/goitap/index.vue`
- [Login](https://github.com/khanhhuyen25-01/web-fitlife/blob/main/src/pages/admin/login/index.vue): auth page · Standalone authentication entry point. · `src/pages/admin/login/index.vue`

### Assets & Plugins

Static theme files and vendor widgets.

- [Theme assets](https://github.com/khanhhuyen25-01/web-fitlife/tree/main/src/assets): styles · Global CSS, fonts, and static UI skinning. · `src/assets`
- [UI plugins](https://github.com/khanhhuyen25-01/web-fitlife/tree/main/src/assets/plugins): vendor bundle · Charts, tables, calendar, selectors, and other widgets. · `src/assets/plugins`

## Connections

- main.js → App.vue: mounts · Bootstraps the Vue application.
- App.vue → router: uses · Renders routed content.
- router → Admin shell: admin routes · Wraps authenticated routes in the admin shell.
- router → Blank shell: public routes · Uses the minimal shell for login and similar screens.
- Admin shell → Sidebar: contains · Sidebar is part of the admin shell.
- Admin shell → Header: contains · Header is part of the admin shell.
- Admin shell → Dashboard: routes to · Admin shell hosts the dashboard page.
- Admin shell → Members: routes to · Admin shell hosts member management.
- Admin shell → Trainers: routes to · Admin shell hosts trainer management.
- Admin shell → Schedule: routes to · Admin shell hosts scheduling.
- Admin shell → Statistics: routes to · Admin shell hosts reporting.
- Admin shell → Billing: routes to · Admin shell hosts billing.
- Admin shell → Activity log: routes to · Admin shell hosts activity history.
- Admin shell → Settings: routes to · Admin shell hosts settings.
- Admin shell → Profile: routes to · Admin shell hosts profile.
- Admin shell → Programs: routes to · Admin shell hosts program management.
- Blank shell → Login: hosts · Minimal shell hosts the login page.
- Dashboard → UI plugins: uses · Charts and widgets support dashboard visuals.
- Statistics → UI plugins: uses · Analytics views rely on charting bundles.
- Schedule → UI plugins: uses · Calendar and date-time widgets support scheduling.
- Members → UI plugins: uses · Tables, selectors, and form widgets support management screens.
- Billing → UI plugins: uses · Table and form widgets support invoice workflows.
- Settings → Theme assets: uses · Global styling and vendor CSS shape the UI.
- Login → Theme assets: uses · Auth screen shares the same asset-driven styling.
