# amin00sa/plateforme architecture

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

- Interactive diagram: https://gitdiagram.com/amin00sa/plateforme
- Repository: https://github.com/amin00sa/plateforme

## Overview

##### Project type and purpose
- This is a Vue 3 single-page application (SPA) scaffolded with Vite, Tailwind CSS, PostCSS, and ESLint/Prettier.
- It provides a component-based frontend “platform” template, intended to be deployed as static assets that interact with one or more external REST APIs (authentication, data services, etc.).

##### File structure
- Top-level files: Vite config (vite.config.js), Tailwind config (tailwind.config.js), linting/prettier configs, package.json.
- public/: Static assets (images, favicon, index.html).
- src/:
- main.js: App bootstrap, global plugin registration (router, store)
- App.vue: Root component
- assets/: Global CSS/SCSS, design system styles
- views/: Page-level components (e.g., HomeView.vue) wired to router.
- router/index.js: vue-router setup, route definitions.
- stores/: Pinia (or Vuex–style) state modules (auth.store.ts, openModal.js).
- utils/: Service layer helpers (axios-helper.ts, http.ts, error-handler.ts, toast.ts).
- types/: TypeScript interfaces for domain models (students, schools, pagination, errors).

##### README for additional insights
- Basic instructions on installing, running dev server, building for production, and linting.

a. Main components:
- Developer workstation (IDE, Git)
- CI/CD pipeline (Git commit → Vite build)
- Static asset host (CDN or S3/Netlify)
- Browser client running the Vue SPA
- External backend services (Authentication API, Data API, other third-party services)
b. Relationships & data flow:
1. Developer pushes code → CI/CD triggers install → Vite builds static bundle.
2. Built assets are deployed to static hosting/CDN.
3. Browser downloads index.html + JavaScript/CSS.
4. Vue router renders views; user actions dispatch store mutations/actions.
5. Service layer (utils/axios-helper) sends HTTP requests to external APIs.
6. Responses update Pinia store → UI components re-render.
c. Architectural patterns & design principles:
- SPA with component-based UI and single root (App.vue)
- Modular CSS with Tailwind + PostCSS
- Centralized state management via Pinia stores
- Service abstraction layer (utils/http, axios-helper) for all HTTP calls
- Domain typing with TypeScript interfaces
- Routing with vue-router
d. Key technologies/frameworks:
- Vue 3 Composition API + SFCs (Single File Components)
- Vite for faster dev server & build
- Tailwind CSS for utility-first styling
- Pinia (or equivalent) for stores
- Axios for HTTP calls
- ESLint/Prettier for code quality

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build & Styling Layer
    subgraph "Build & Styling" 
        direction TB
        VITE["vite.config.js"]:::config
        TAILWIND["tailwind.config.js"]:::config
        POSTCSS["postcss.config.js"]:::config
        ESLINT[".eslintrc.cjs"]:::config
        PRETTIER[".prettierrc.json"]:::config
        VITE -->|uses| TAILWIND
        VITE -->|uses| POSTCSS
        VITE -->|lint via| ESLINT
        VITE -->|format via| PRETTIER
    end

    %% CI/CD & Hosting
    subgraph "CI/CD & Hosting" 
        direction TB
        DEV["Developer Workstation"]:::external
        CI["CI/CD Pipeline"]:::service
        HOST["Static Asset Host (CDN)"]:::host
        DEV -->|push code| CI
        CI -->|build with Vite| VITE
        CI -->|deploy assets| HOST
    end

    %% Browser Client Runtime
    subgraph "Browser Client" 
        direction TB
        MAIN["main.js"]:::config
        APP["App.vue"]:::client
        ROUTER["Router Module"]:::client
        subgraph "Service Layer"
            direction TB
            AXIOS["axios-helper.ts"]:::utils
            HTTP["http.ts"]:::utils
            ERROR["error-handler.ts"]:::utils
            TOAST["toast.ts"]:::utils
            OBJ["object.ts"]:::utils
        end
        subgraph "State Management"
            direction TB
            AUTH["auth.store.ts"]:::store
            MODAL["openModal.js"]:::store
        end
        subgraph "Components & Views"
            direction TB
            HOME["HomeView.vue"]:::components
            subgraph "UI Components"
                direction TB
                NAV["NavBar.vue"]:::components
                FOOTER["Footer.vue"]:::components
                CARD["Cards/"]:::components
                CARO["Carousals/"]:::components
                MOD["Modals/"]:::components
                CBX["Checkbox.vue"]:::components
                DROPDOWN["Dropdown.vue"]:::components
                VINPUT["VInput.vue"]:::components
                SEARCH["Search.vue"]:::components
            end
        end
        subgraph "Types"
            direction TB
            T_STU["student.ts"]:::types
            T_SCH["school.ts"]:::types
            T_PAG["pagination.ts"]:::types
            T_GUARD["guard.ts"]:::types
            T_FORM["form-errors.ts"]:::types
            T_TOAST["toasts.ts"]:::types
        end

        HOST -->|serves index.html + assets| MAIN
        MAIN -->|mounts| APP
        APP -->|renders| ROUTER
        ROUTER -->|loads| HOME
        HOME -->|uses| NAV
        HOME -->|uses| FOOTER
        HOME -->|uses| CARD
        HOME -->|uses| CARO
        HOME -->|uses| MOD
        HOME -->|uses| CBX
        HOME -->|uses| DROPDOWN
        HOME -->|uses| VINPUT
        HOME -->|uses| SEARCH
        APP -->|registers| AUTH
        APP -->|registers| MODAL
        HOME -->|dispatch| AUTH
        HOME -->|dispatch| MODAL
        AUTH -->|reads/writes| T_STU
        AUTH -->|reads/writes| T_SCH
        MODAL -->|reads/writes| T_FORM
        HOME -->|calls| AXIOS
        AXIOS -->|calls| HTTP
        HTTP -->|handles errors via| ERROR
        ERROR -->|triggers| TOAST
        AXIOS -->|formats| OBJ
        AXIOS -->|returns typed data| T_PAG
        AXIOS -->|returns typed data| T_GUARD
        AXIOS -->|returns typed data| T_TOAST
    end

    %% External Services
    subgraph "External Services" 
        direction TB
        AUTHAPI["Authentication API"]:::external
        DATAAPI["Data API"]:::external
        HOME -->|POST /login| AUTHAPI
        AXIOS -->|GET/POST| DATAAPI
    end

    %% Click Events
    click VITE "https://github.com/amin00sa/plateforme/blob/stagging/vite.config.js"
    click TAILWIND "https://github.com/amin00sa/plateforme/blob/stagging/tailwind.config.js"
    click POSTCSS "https://github.com/amin00sa/plateforme/blob/stagging/postcss.config.js"
    click ESLINT "https://github.com/amin00sa/plateforme/blob/stagging/.eslintrc.cjs"
    click PRETTIER "https://github.com/amin00sa/plateforme/blob/stagging/.prettierrc.json"
    click MAIN "https://github.com/amin00sa/plateforme/blob/stagging/src/main.js"
    click APP "https://github.com/amin00sa/plateforme/blob/stagging/src/App.vue"
    click ROUTER "https://github.com/amin00sa/plateforme/blob/stagging/src/router/index.js"
    click AUTH "https://github.com/amin00sa/plateforme/blob/stagging/src/stores/auth.store.ts"
    click MODAL "https://github.com/amin00sa/plateforme/blob/stagging/src/stores/openModal.js"
    click AXIOS "https://github.com/amin00sa/plateforme/blob/stagging/src/utils/axios-helper.ts"
    click HTTP "https://github.com/amin00sa/plateforme/blob/stagging/src/utils/http.ts"
    click ERROR "https://github.com/amin00sa/plateforme/blob/stagging/src/utils/error-handler.ts"
    click TOAST "https://github.com/amin00sa/plateforme/blob/stagging/src/utils/toast.ts"
    click OBJ "https://github.com/amin00sa/plateforme/blob/stagging/src/utils/object.ts"
    click T_STU "https://github.com/amin00sa/plateforme/blob/stagging/src/types/student.ts"
    click T_SCH "https://github.com/amin00sa/plateforme/blob/stagging/src/types/school.ts"
    click T_PAG "https://github.com/amin00sa/plateforme/blob/stagging/src/types/pagination.ts"
    click T_GUARD "https://github.com/amin00sa/plateforme/blob/stagging/src/types/guard.ts"
    click T_FORM "https://github.com/amin00sa/plateforme/blob/stagging/src/types/form-errors.ts"
    click T_TOAST "https://github.com/amin00sa/plateforme/blob/stagging/src/types/toasts.ts"
    click HOME "https://github.com/amin00sa/plateforme/blob/stagging/src/views/HomeView.vue"
    click NAV "https://github.com/amin00sa/plateforme/blob/stagging/src/components/NavBar.vue"
    click FOOTER "https://github.com/amin00sa/plateforme/blob/stagging/src/components/Footer.vue"
    click CARD "https://github.com/amin00sa/plateforme/tree/stagging/src/components/Cards/"
    click CARO "https://github.com/amin00sa/plateforme/tree/stagging/src/components/Carousals/"
    click MOD "https://github.com/amin00sa/plateforme/tree/stagging/src/components/Modals/"
    click CBX "https://github.com/amin00sa/plateforme/blob/stagging/src/components/Checkbox.vue"
    click DROPDOWN "https://github.com/amin00sa/plateforme/blob/stagging/src/components/Dropdown.vue"
    click VINPUT "https://github.com/amin00sa/plateforme/blob/stagging/src/components/VInput.vue"
    click SEARCH "https://github.com/amin00sa/plateforme/blob/stagging/src/components/Search.vue"

    %% Styles
    classDef config fill:#E8F1F2,stroke:#2B7A78,color:#17252A
    classDef service fill:#FEF9C7,stroke:#B5838D,color:#5D001E
    classDef host fill:#BFD7EA,stroke:#1B4F72,color:#1B2631
    classDef client fill:#F0EDEE,stroke:#774360,color:#2C1A1A
    classDef utils fill:#FFF1E6,stroke:#E29578,color:#7B3922
    classDef store fill:#E2F0CB,stroke:#5F8D4E,color:#2F5233
    classDef components fill:#E8EDF4,stroke:#4A536B,color:#111827
    classDef types fill:#E6E6FA,stroke:#8A2BE2,color:#2F006F
    classDef external fill:#D1E7DD,stroke:#0F5132,color:#0C4128
```
