# coordipai/admin-web architecture

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

- Interactive diagram: https://gitdiagram.com/coordipai/admin-web
- Repository: https://github.com/coordipai/admin-web

## Overview

##### Project Type and Purpose
- This is a single-page application (SPA) built with React and Vite.
- Its purpose is to provide a front-end for an issue/project/user management tool, interacting with a remote REST API (see src/api/*) and maintaining client-side state via Zustand (src/store).

##### File Structure
- Top-level config & tooling:
- vite.config.js, package.json / package-lock.json (build and dependencies)
- eslint.config.js, jsconfig.json (code quality and editor integration)
- Static entrypoint: index.html
- Source code under src/:
- pages/ – top-level views and client-side routes (e.g., IssueRequestPage, BuildProject)
- components/ – shared UI elements (Common, Edit, forms, layout)
- api/ – modules that wrap Axios calls to agentApi, issueApi, projectApi
- store/ – Zustand hooks (useUserStore, useProjectStore, useLoadingStore)
- hooks/ – custom hooks (useAxios)
- mocks/ – mock data for issueList, project, user
- styles/ and utils/ – global styles and helper functions

##### README
- Confirms this is a minimal React+Vite template, extended with:
- Fast refresh via @vitejs/plugin-react
- ESLint integration
- No server-side code included — the SPA relies on external REST endpoints.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Tooling
    subgraph "Build & Tooling"
        direction TB
        VITE["Vite Config"]:::tooling
        NPM["package.json & lock"]:::tooling
        ESLINT["ESLint Config"]:::tooling
        JSCONFIG["jsconfig.json"]:::tooling
    end

    %% Client Entry & Delivery
    subgraph "Client Delivery"
        direction TB
        BROWSER["Browser / Client"]:::external
        DEVSERVER["Vite Dev Server / Static Host"]:::tooling
    end

    %% React Application
    subgraph "React Application" 
        direction TB

        %% Bootstrap & Router
        subgraph "Bootstrap & Router"
            direction TB
            MAIN["src/main.jsx"]:::client
            APP["src/App.jsx"]:::client
        end

        %% Presentation Layer
        subgraph "Presentation Layer (Pages & Components)"
            direction TB
            PAGES["src/pages/"]:::client
            subgraph "UI Components"
                direction TB
                COMMON["Common UI"]:::client
                FORMS["Form Elements"]:::client
                EDIT["Edit Widgets"]:::client
                LAYOUT["Layout & Navigation"]:::client
            end
        end

        %% State Management
        subgraph "State Management (Zustand)"
            direction TB
            USERSTORE["useUserStore"]:::client
            PROJECTSTORE["useProjectStore"]:::client
            LOADINGSTORE["useLoadingStore"]:::client
        end

        %% Data Layer
        subgraph "Data Layer (API)"
            direction TB
            AGENTAPI["agentApi.js"]:::client
            ISSUEAPI["issueApi.js"]:::client
            PROJECTAPI["projectApi.js"]:::client
        end

        %% Cross-Cutting
        subgraph "Cross-Cutting Concerns"
            direction TB
            HOOKS["useAxios.js"]:::client
            UTILS["Utility Functions"]:::client
        end

        %% Mocks & Styles
        subgraph "Mocks & Styles"
            direction TB
            MOCKS["Mock Data"]:::client
            STYLES["Global Styles & Theming"]:::client
        end
    end

    %% External Services
    subgraph "External Services"
        direction TB
        BACKEND["REST API Backend"]:::external
        AUTH["OAuth / Auth Provider"]:::external
    end

    %% Flows
    BROWSER -->|fetch index.html & bundle| DEVSERVER
    DEVSERVER -->|serves| BROWSER

    DEVSERVER -->|bundle built| BROWSER
    BROWSER -->|runs| MAIN
    MAIN --> APP
    APP --> PAGES
    PAGES --> COMMON
    PAGES --> FORMS
    PAGES --> EDIT
    PAGES --> LAYOUT

    COMMON --> USERSTORE
    FORMS --> USERSTORE
    EDIT --> PROJECTSTORE
    LAYOUT --> LOADINGSTORE

    COMMON --> AGENTAPI
    ISSUEAPI -->|HTTP calls| BACKEND
    PROJECTAPI -->|HTTP calls| BACKEND
    AGENTAPI -->|HTTP calls| BACKEND

    PAGES --> USERSTORE
    PAGES --> PROJECTSTORE
    PAGES --> LOADINGSTORE

    HOOKS --> AGENTAPI
    HOOKS --> ISSUEAPI
    HOOKS --> PROJECTAPI

    MOCKS --> PAGES
    MOCKS --> USERSTORE
    MOCKS --> PROJECTSTORE

    UTILS --> PAGES
    UTILS --> COMMON
    STYLES --> PAGES
    STYLES --> COMMON

    %% Build & Tooling relationships
    VITE --> DEVSERVER
    NPM --> DEVSERVER
    ESLINT --> MAIN
    JSCONFIG --> MAIN

    %% External integration
    APP --> AUTH

    %% Click Events
    click VITE "https://github.com/coordipai/admin-web/blob/main/vite.config.js"
    click NPM "https://github.com/coordipai/admin-web/blob/main/package.json"
    click ESLINT "https://github.com/coordipai/admin-web/blob/main/eslint.config.js"
    click JSCONFIG "https://github.com/coordipai/admin-web/blob/main/jsconfig.json"
    click MAIN "https://github.com/coordipai/admin-web/blob/main/src/main.jsx"
    click APP "https://github.com/coordipai/admin-web/blob/main/src/App.jsx"
    click PAGES "https://github.com/coordipai/admin-web/tree/main/src/pages/"
    click COMMON "https://github.com/coordipai/admin-web/tree/main/src/components/Common/"
    click FORMS "https://github.com/coordipai/admin-web/blob/main/src/components/FormDropdown.jsx"
    click FORMS "https://github.com/coordipai/admin-web/blob/main/src/components/FormInput.jsx"
    click FORMS "https://github.com/coordipai/admin-web/blob/main/src/components/FormTextarea.jsx"
    click EDIT "https://github.com/coordipai/admin-web/tree/main/src/components/Edit/"
    click LAYOUT "https://github.com/coordipai/admin-web/blob/main/src/components/Header.jsx"
    click LAYOUT "https://github.com/coordipai/admin-web/blob/main/src/components/SideBar.jsx"
    click LAYOUT "https://github.com/coordipai/admin-web/blob/main/src/components/Loading.jsx"
    click LAYOUT "https://github.com/coordipai/admin-web/blob/main/src/components/ConfirmModal.jsx"
    click AGENTAPI "https://github.com/coordipai/admin-web/blob/main/src/api/agentApi.js"
    click ISSUEAPI "https://github.com/coordipai/admin-web/blob/main/src/api/issueApi.js"
    click PROJECTAPI "https://github.com/coordipai/admin-web/blob/main/src/api/projectApi.js"
    click USERSTORE "https://github.com/coordipai/admin-web/blob/main/src/store/useUserStore.js"
    click PROJECTSTORE "https://github.com/coordipai/admin-web/blob/main/src/store/useProjectStore.js"
    click LOADINGSTORE "https://github.com/coordipai/admin-web/blob/main/src/store/useLoadingStore.js"
    click HOOKS "https://github.com/coordipai/admin-web/blob/main/src/hooks/useAxios.js"
    click MOCKS "https://github.com/coordipai/admin-web/blob/main/src/mocks/issueList.js"
    click MOCKS "https://github.com/coordipai/admin-web/blob/main/src/mocks/project.js"
    click MOCKS "https://github.com/coordipai/admin-web/blob/main/src/mocks/user.js"
    click UTILS "https://github.com/coordipai/admin-web/blob/main/src/utils/dateUtils.js"
    click UTILS "https://github.com/coordipai/admin-web/blob/main/src/utils/showToastMsg.js"
    click STYLES "https://github.com/coordipai/admin-web/blob/main/src/styles/globalStyle.js"
    click STYLES "https://github.com/coordipai/admin-web/blob/main/src/styles/reset-css.js"
    click STYLES "https://github.com/coordipai/admin-web/blob/main/src/styles/theme.js"

    %% Styles
    classDef client fill:#D0E8FF,stroke:#0366d6,color:#03396c
    classDef external fill:#E2F0CB,stroke:#4F772D,color:#405720
    classDef tooling fill:#FFE8A1,stroke:#D97706,color:#92400E
```
