# mhmmdvg/vehicle-list architecture

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

- Interactive diagram: https://gitdiagram.com/mhmmdvg/vehicle-list
- Repository: https://github.com/mhmmdvg/vehicle-list

## Overview

##### Project type and purpose
- This is a Vue 3 single-page application (SPA) written in TypeScript and built with Vite.
- It provides a dashboard-style UI for vehicle management, jobs, authentication, settings, etc.

##### File structure
- Top-level: configuration & metadata (`package.json`, `tsconfig*.json`, `vite.config.ts`, `vercel.json`), entry HTML (`index.html`), lock file (`bun.lockb`), and a `public` folder for static assets.
- `src/` holds the application code:
- `main.ts` – bootstraps the Vue app and mounts `App.vue`.
- `App.vue` – root component.
- `views/` – page-level components (e.g. DashboardView, JobView, LoginView, SettingsView, VehicleView).
- `components/ui/` – reusable UI primitives (Card, Checkbox, Input) and layout components (AppBar, Sidebar, SidebarLayout).
- `composables/` – Composition API logic (e.g. `useAuth.ts`, `useVehicle.ts`).
- `stores/` – client-side state (e.g. `vehicleStore.ts`).
- `libs/` – low-level utilities and API client (`axios.ts`, `constants.ts`, `utils.ts`).
- `models/` – TypeScript interfaces for domain objects (Auth, NavModel, Vehicle).

##### README
- Confirms this is a starter template for Vue 3 + TypeScript + Vite.
- No backend code in repo—communication with a remote API is abstracted via `libs/axios.ts`.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Infrastructure
    subgraph "Infrastructure" 
        direction TB
        Vite["Vite Dev/Prod Server"]:::infra
        StaticAssets["Static Assets"]:::infra
        subgraph "Icons"
            direction TB
            IconsIndex["index.ts"]:::infra
            ChecklistIcon["Checklist.vue"]:::infra
            ClockIcon["Clock.vue"]:::infra
            EngineIcon["Engine.vue"]:::infra
            GridIcon["Grid.vue"]:::infra
            HamburgerIcon["Hamburger.vue"]:::infra
            LogoutIcon["Logout.vue"]:::infra
            MinimizeIcon["Minimize.vue"]:::infra
            SettingsIcon["Settings.vue"]:::infra
        end
    end

    %% Application Layers
    subgraph "Entry & Bootstrapping" 
        direction TB
        HTML["index.html"]:::infra
        MainTS["src/main.ts"]:::infra
    end

    subgraph "Root Component" 
        direction TB
        AppVue["src/App.vue"]:::presentation
    end

    subgraph "Views (Pages)" 
        direction TB
        Dashboard["DashboardView.vue"]:::presentation
        Job["JobView.vue"]:::presentation
        Login["LoginView.vue"]:::presentation
        Settings["SettingsView.vue"]:::presentation
        VehicleView["VehicleView.vue"]:::presentation
    end

    subgraph "UI Components" 
        direction TB
        Card["Card.vue"]:::presentation
        Checkbox["Checkbox.vue"]:::presentation
        Input["Input.vue"]:::presentation
    end

    subgraph "Layout Components" 
        direction TB
        AppBar["AppBar.vue"]:::presentation
        Sidebar["Sidebar.vue"]:::presentation
        SidebarLayout["SidebarLayout.vue"]:::presentation
    end

    subgraph "Composables & State" 
        direction TB
        UseAuth["useAuth.ts"]:::logic
        UseVehicle["useVehicle.ts"]:::logic
        VehicleStore["vehicleStore.ts"]:::logic
    end

    subgraph "API Client & Utilities" 
        direction TB
        Axios["axios.ts"]:::data
        Constants["constants.ts"]:::data
        Utils["utils.ts"]:::data
    end

    subgraph "Domain Models" 
        direction TB
        AuthModel["Auth.ts"]:::data
        NavModel["NavModel.ts"]:::data
        VehicleModel["Vehicle.ts"]:::data
    end

    ExternalAPI["External API / Backend"]:::infra

    %% Connections
    Browser["Browser/Client"]:::infra -->|requests| Vite
    Vite -->|serves| HTML
    HTML -->|bootstraps| MainTS
    MainTS -->|mounts| AppVue
    AppVue -->|renders via router| Dashboard
    AppVue -->|renders via router| Job
    AppVue -->|renders via router| Login
    AppVue -->|renders via router| Settings
    AppVue -->|renders via router| VehicleView

    Dashboard -->|uses| Card
    Dashboard -->|uses| Checkbox
    Dashboard -->|uses| Input
    Job -->|uses| Card
    Login -->|uses| Input
    Settings -->|uses| Checkbox
    VehicleView -->|uses| Card

    Dashboard -->|layout| SidebarLayout
    Job -->|layout| SidebarLayout
    Settings -->|layout| SidebarLayout
    VehicleView -->|layout| SidebarLayout

    SidebarLayout -->|contains| AppBar
    SidebarLayout -->|contains| Sidebar

    Card -->|calls| UseVehicle
    Job -->|calls| UseAuth
    Login -->|calls| UseAuth
    Settings -->|calls| UseAuth
    VehicleView -->|calls| UseVehicle

    UseAuth -->|updates| VehicleStore
    UseVehicle -->|updates| VehicleStore
    VehicleStore -->|uses| Axios
    VehicleStore -->|uses| Constants
    VehicleStore -->|uses| Utils

    Axios -->|calls| ExternalAPI
    Constants -->|provides| VehicleStore
    Utils -->|provides| UseAuth

    VehicleStore -->|depends on| AuthModel
    VehicleStore -->|depends on| NavModel
    VehicleStore -->|depends on| VehicleModel

    Card -->|loads icons/images| StaticAssets
    Checkbox -->|loads icons/images| StaticAssets
    Input -->|loads icons/images| StaticAssets

    IconsIndex -->|exports| ChecklistIcon
    IconsIndex -->|exports| ClockIcon
    IconsIndex -->|exports| EngineIcon
    IconsIndex -->|exports| GridIcon
    IconsIndex -->|exports| HamburgerIcon
    IconsIndex -->|exports| LogoutIcon
    IconsIndex -->|exports| MinimizeIcon
    IconsIndex -->|exports| SettingsIcon

    %% Click Events
    click HTML "https://github.com/mhmmdvg/vehicle-list/blob/main/index.html"
    click MainTS "https://github.com/mhmmdvg/vehicle-list/blob/main/src/main.ts"
    click AppVue "https://github.com/mhmmdvg/vehicle-list/blob/main/src/App.vue"
    click Dashboard "https://github.com/mhmmdvg/vehicle-list/blob/main/src/views/DashboardView.vue"
    click Job "https://github.com/mhmmdvg/vehicle-list/blob/main/src/views/JobView.vue"
    click Login "https://github.com/mhmmdvg/vehicle-list/blob/main/src/views/LoginView.vue"
    click Settings "https://github.com/mhmmdvg/vehicle-list/blob/main/src/views/SettingsView.vue"
    click VehicleView "https://github.com/mhmmdvg/vehicle-list/blob/main/src/views/VehicleView.vue"
    click Card "https://github.com/mhmmdvg/vehicle-list/blob/main/src/components/ui/Card.vue"
    click Checkbox "https://github.com/mhmmdvg/vehicle-list/blob/main/src/components/ui/Checkbox.vue"
    click Input "https://github.com/mhmmdvg/vehicle-list/blob/main/src/components/ui/Input.vue"
    click AppBar "https://github.com/mhmmdvg/vehicle-list/blob/main/src/components/ui/sidebar/AppBar.vue"
    click Sidebar "https://github.com/mhmmdvg/vehicle-list/blob/main/src/components/ui/sidebar/Sidebar.vue"
    click SidebarLayout "https://github.com/mhmmdvg/vehicle-list/blob/main/src/components/ui/sidebar/SidebarLayout.vue"
    click UseAuth "https://github.com/mhmmdvg/vehicle-list/blob/main/src/composables/useAuth.ts"
    click UseVehicle "https://github.com/mhmmdvg/vehicle-list/blob/main/src/composables/useVehicle.ts"
    click VehicleStore "https://github.com/mhmmdvg/vehicle-list/blob/main/src/stores/vehicleStore.ts"
    click Axios "https://github.com/mhmmdvg/vehicle-list/blob/main/src/libs/axios.ts"
    click Constants "https://github.com/mhmmdvg/vehicle-list/blob/main/src/libs/constants.ts"
    click Utils "https://github.com/mhmmdvg/vehicle-list/blob/main/src/libs/utils.ts"
    click AuthModel "https://github.com/mhmmdvg/vehicle-list/blob/main/src/models/Auth.ts"
    click NavModel "https://github.com/mhmmdvg/vehicle-list/blob/main/src/models/NavModel.ts"
    click VehicleModel "https://github.com/mhmmdvg/vehicle-list/blob/main/src/models/Vehicle.ts"
    click StaticAssets "https://github.com/mhmmdvg/vehicle-list/tree/main/public/"
    click IconsIndex "https://github.com/mhmmdvg/vehicle-list/blob/main/src/assets/icons/index.ts"
    click ChecklistIcon "https://github.com/mhmmdvg/vehicle-list/blob/main/src/assets/icons/Checklist.vue"
    click ClockIcon "https://github.com/mhmmdvg/vehicle-list/blob/main/src/assets/icons/Clock.vue"
    click EngineIcon "https://github.com/mhmmdvg/vehicle-list/blob/main/src/assets/icons/Engine.vue"
    click GridIcon "https://github.com/mhmmdvg/vehicle-list/blob/main/src/assets/icons/Grid.vue"
    click HamburgerIcon "https://github.com/mhmmdvg/vehicle-list/blob/main/src/assets/icons/Hamburger.vue"
    click LogoutIcon "https://github.com/mhmmdvg/vehicle-list/blob/main/src/assets/icons/Logout.vue"
    click MinimizeIcon "https://github.com/mhmmdvg/vehicle-list/blob/main/src/assets/icons/Minimize.vue"
    click SettingsIcon "https://github.com/mhmmdvg/vehicle-list/blob/main/src/assets/icons/Settings.vue"

    %% Styles
    classDef presentation fill:#e2f8e9,stroke:#2e7d32,stroke-width:1px
    classDef logic fill:#e3f2fd,stroke:#1565c0,stroke-width:1px
    classDef data fill:#fff3e0,stroke:#ef6c00,stroke-width:1px
    classDef infra fill:#eeeeee,stroke:#9e9e9e,stroke-width:1px
```
