# iabacus2024dev/frontend architecture

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

- Interactive diagram: https://gitdiagram.com/iabacus2024dev/frontend
- Repository: https://github.com/iabacus2024dev/frontend

## Overview

##### Main Components
- Application Entry Point: Represent the “index.html” and “src/main.js” which bootstrap the Vue application.
- UI Layers:
- Vue Components (inside src/components) broken down by feature domains (login, employee, partners, permission, profile, project, searchbar, table, and tree).
- Layouts (src/layouts) that guide the page structure (e.g., DefaultLayout.vue, LoginLayout.vue).
- Views (src/views) that act as pages – each grouping UI components for different application features (HomePage, LoginPage, EmployeePage, etc.).
- Routing & State Management:
- Router (src/router/index.js) which defines the navigation routes between views.
- Stores (src/stores) that manage global state (e.g., counter.js, dialogStore.js, roleStore.js, member.js).
- API & Data Abstraction:
- Adapters (src/adapters/restApiAdapter.js) which act as the central HTTP communication layer.
- API Service Modules (under src/apis) such as authService, classificationService, contractService, etc. that encapsulate domain-specific REST calls.
- Configuration (src/config/restApiConfig.js) that holds API endpoint/environment details.
- Plugins & Utilities:
- Plugins (src/plugins/vuetify.js) that integrate third-party libraries like Vuetify.
- Utility modules (src/utils/MoneyUtils.js) for shared logic or helper functions.
- Development & Build Tools:
- Vite configuration (vite.config.js and vitest.config.js) for bundling and testing, plus configuration files such as .gitignore, eslint.config.js, and Prettier config.

##### Relationships and Interactions
- The application boots from index.html and runs src/main.js that sets up the Vue instance.
- The Vue router controls which view is rendered based on the URL. Views then compose various components.
- UI components retrieve or update the application state via the stores.
- When a component requires data, it calls the API service modules which use the common REST adapter for HTTP requests.
- The REST adapter uses configurations defined under src/config to know the endpoints.
- Plugins such as Vuetify modify the UI appearance and behavior.
- External services (as hinted by the existence of REST APIs like authService, contractService, etc.) are abstracted behind the API layer.

##### Important Architectural Patterns
- Separation of Concerns: Notice the clear division between the view layer (components and layouts), the state management (stores), and the data access layer (adapters and API services).
- Modularization: Each domain (employee, partner, project, etc.) has its own set of components and API modules.
- Component-Driven Development: Vue components are organized by functionality ensuring maintainability.
- Configurability: Use of dedicated configuration and utility directories promotes easier modifications and reuse.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Bootstrap Layer
    subgraph "Bootstrap"
        BootstrapIndex("index.html"):::bootstrap
        BootstrapMain("main.js"):::bootstrap
    end

    %% Presentation Layer: Layouts, Views and Components
    subgraph "Presentation Layer"
        subgraph "Layouts & Views"
            Layouts("Layouts"):::layout
            Views("Views"):::layout
        end
        subgraph "Components"
            Login("Login Component"):::ui
            Employee("Employee Components"):::ui
            Partner("Partner Components"):::ui
            Permission("Permission Components"):::ui
            Profile("Profile Components"):::ui
            Project("Project Components"):::ui
            SearchBar("SearchBar Component"):::ui
            Table("Table Components"):::ui
            Tree("Tree Components"):::ui
        end
    end

    %% Navigation & State Management
    subgraph "Navigation & State"
        Router("Router"):::nav
        Stores("Stores"):::state
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        RestAdapter("REST Adapter"):::api
        ApiServices("API Services"):::api
        Configuration("Configuration"):::api
    end

    %% Plugins & Utilities
    subgraph "Plugins & Utilities"
        Vuetify("Vuetify Plugin"):::plugin
        MoneyUtils("Money Utility"):::plugin
    end

    %% Build & Config
    subgraph "Build & Config"
        Vite("Vite Config"):::dev
        Vitest("Vitest Config"):::dev
        Package("Package.json"):::dev
        Gitignore(".gitignore"):::dev
        Eslint("ESLint Config"):::dev
        Prettier("Prettier Config"):::dev
    end

    %% Connections
    BootstrapIndex --> Router
    BootstrapMain --> Router

    Router --> Views
    Layouts --> Views

    Views --> Login
    Views --> Employee
    Views --> Partner
    Views --> Permission
    Views --> Profile
    Views --> Project
    Views --> SearchBar
    Views --> Table
    Views --> Tree

    Login --> Stores
    Employee --> Stores
    Partner --> Stores
    Permission --> Stores
    Profile --> Stores
    Project --> Stores
    SearchBar --> Stores
    Table --> Stores
    Tree --> Stores

    Login --> RestAdapter
    Employee --> RestAdapter
    Partner --> RestAdapter
    Permission --> RestAdapter
    Profile --> RestAdapter
    Project --> RestAdapter
    SearchBar --> RestAdapter
    Table --> RestAdapter
    Tree --> RestAdapter

    RestAdapter --> ApiServices
    ApiServices --> Configuration

    Vuetify --> Layouts
    MoneyUtils --> Login

    Vite --> BootstrapMain
    Vitest --> BootstrapMain
    Package --> BootstrapMain

    %% Styles
    classDef bootstrap fill:#f9c,stroke:#333,stroke-width:2px;
    classDef ui fill:#bbf,stroke:#333,stroke-width:2px;
    classDef layout fill:#cfc,stroke:#333,stroke-width:2px;
    classDef nav fill:#fc9,stroke:#333,stroke-width:2px;
    classDef state fill:#cff,stroke:#333,stroke-width:2px;
    classDef api fill:#ffc,stroke:#333,stroke-width:2px;
    classDef plugin fill:#fdd,stroke:#333,stroke-width:2px;
    classDef dev fill:#ddd,stroke:#333,stroke-width:2px;

    %% Click Events
    click BootstrapIndex "https://github.com/iabacus2024dev/frontend/blob/dev/index.html"
    click BootstrapMain "https://github.com/iabacus2024dev/frontend/blob/dev/src/main.js"
    click Login "https://github.com/iabacus2024dev/frontend/blob/dev/src/components/login/LoginComponent.vue"
    click Employee "https://github.com/iabacus2024dev/frontend/tree/dev/src/components/employee"
    click Partner "https://github.com/iabacus2024dev/frontend/tree/dev/src/components/partners"
    click Permission "https://github.com/iabacus2024dev/frontend/tree/dev/src/components/permission"
    click Profile "https://github.com/iabacus2024dev/frontend/tree/dev/src/components/profile"
    click Project "https://github.com/iabacus2024dev/frontend/tree/dev/src/components/project"
    click SearchBar "https://github.com/iabacus2024dev/frontend/blob/dev/src/components/searchbar/SearchBarComponent.vue"
    click Table "https://github.com/iabacus2024dev/frontend/tree/dev/src/components/table"
    click Tree "https://github.com/iabacus2024dev/frontend/tree/dev/src/components/tree"
    click Layouts "https://github.com/iabacus2024dev/frontend/tree/dev/src/layouts"
    click Views "https://github.com/iabacus2024dev/frontend/tree/dev/src/views"
    click Router "https://github.com/iabacus2024dev/frontend/blob/dev/src/router/index.js"
    click Stores "https://github.com/iabacus2024dev/frontend/tree/dev/src/stores"
    click RestAdapter "https://github.com/iabacus2024dev/frontend/blob/dev/src/adapters/restApiAdapter.js"
    click ApiServices "https://github.com/iabacus2024dev/frontend/tree/dev/src/apis"
    click Configuration "https://github.com/iabacus2024dev/frontend/blob/dev/src/config/restApiConfig.js"
    click Vuetify "https://github.com/iabacus2024dev/frontend/blob/dev/src/plugins/vuetify.js"
    click MoneyUtils "https://github.com/iabacus2024dev/frontend/blob/dev/src/utils/MoneyUtils.js"
    click Vite "https://github.com/iabacus2024dev/frontend/blob/dev/vite.config.js"
    click Vitest "https://github.com/iabacus2024dev/frontend/blob/dev/vitest.config.js"
    click Package "https://github.com/iabacus2024dev/frontend/blob/dev/package.json"
    click Gitignore "https://github.com/iabacus2024dev/frontend/blob/dev/.gitignore"
    click Eslint "https://github.com/iabacus2024dev/frontend/blob/dev/eslint.config.js"
    click Prettier "https://github.com/iabacus2024dev/frontend/blob/dev/.prettierrc.json"
```
