# pmartingatica/fe-ns architecture

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

- Interactive diagram: https://gitdiagram.com/pmartingatica/fe-ns
- Repository: https://github.com/pmartingatica/fe-ns

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with React and Vite.
- Its focus is on a dashboard-style UI: charts, tables, organization chart, login screen, navigation, etc.
- It fetches data via custom hooks (e.g. useMQS, useYield) from one or more backend APIs.

##### File structure
- Top-level files & dirs:
- package.json / vite.config.js — build & dev configuration
- public/ — static assets (favicon, index.html template)
- src/ — source code
– componentes/ and components/ — reusable UI components
– hooks/ — data-fetching & state hooks (api abstraction)
– layouts/ — wrapper layouts (DashboardLayout)
– pages/ — route-level views (Inicio, Reportes, etc.)
– App.jsx & main.jsx — app root, router mounting
– index.html — entrypoint HTML
- Notice pattern:
- Presentation layer (components)
- Routing/views (pages)
- State & data layer (hooks/api)
- Build tool (Vite with HMR)

##### README
- Confirms minimal React + Vite template
- Mentions ESLint and plugin choices
- No backend code here—backend endpoints are external

## Diagram (Mermaid)

```mermaid
graph TB
    %% Developer and Code
    Dev["Developer Workstation"]:::buildCI
    Git["Git Repository"]:::buildCI

    %% CI/CD
    subgraph "CI/CD Pipeline"
        Lint["ESLint"]:::buildCI
        Test["Tests"]:::buildCI
        Build["vite build"]:::buildCI
        Deploy["Deploy"]:::buildCI
    end

    %% Hosting
    subgraph "Hosting & CDN"
        Host["Static File Host (Netlify/Vercel/S3)"]:::hosting
        CDN["CDN"]:::hosting
    end

    %% Client Browser
    subgraph "Client (Browser)" 
        HTML["index.html"]:::client
        JSBundle["JS Bundle"]:::client
        ReactApp["React App"]:::client
        subgraph "App Structure"
            AppRoot["App (src/App.jsx)"]:::client
            Router["Router (src/main.jsx)"]:::client
            subgraph "Pages & Layout"
                DashLayout["DashboardLayout"]:::client
                Inicio["Inicio Page"]:::client
                Controles["Controles Page"]:::client
                Reportes["Reportes Page"]:::client
                Documentos["Documentos Page"]:::client
                Formacion["Formacion Page"]:::client
                Lanzamientos["Lanzamientos Page"]:::client
            end
            subgraph "UI Components"
                BarChart["Bar Chart"]:::client
                OrgChart["Organization Chart"]:::client
                ControlsTable["Daily Controls Table"]:::client
                LoginScreen["Login Screen"]:::client
                Header["Header"]:::client
                Footer["Footer"]:::client
                Sidebar["Sidebar Navigation"]:::client
                WelcomeMsg["Welcome Message"]:::client
                GoogleIcon["Google Icon"]:::client
                MagicBox["Magic Box"]:::client
                Tarjeta["Tarjeta"]:::client
                ContenidoTablero["ContenidoTablero"]:::client
                TablaPrimeNtf["TablaPrimeNtf"]:::client
            end
            subgraph "Hooks (API Layer)"
                APIJS["api.js"]:::client
                DashboardHook["Dashboard Data Hook"]:::client
                MQSHook["useMQS Hook"]:::client
                YieldHook["useYield Hook"]:::client
                YieldStatsHook["useYieldStats Hook"]:::client
                MesHook["useMes Hook"]:::client
                RepairHistoryHook["useRepairHistory Hook"]:::client
                StationPerfHook["useStationPerformance Hook"]:::client
                TopFailuresHook["useTopFailures Hook"]:::client
            end
        end
    end

    %% Static & Config
    Public["public/"]:::hosting
    ViteConfig["vite.config.js"]:::buildCI
    ESLintConfig["eslint.config.js"]:::buildCI
    PackageJSON["package.json"]:::buildCI

    %% External Services
    API["Backend API Servers"]:::external
    Auth["Auth Provider"]:::external
    Analytics["Analytics/Monitoring"]:::external

    %% Relationships
    Dev -->|push code| Git
    Git -->|triggers| Lint --> Test --> Build --> Deploy
    Deploy --> Host --> CDN
    CDN -->|serves| HTML --> JSBundle --> ReactApp
    ReactApp -->|calls hooks| API
    ReactApp -->|uses auth| Auth
    ReactApp -->|sends logs| Analytics

    ReactApp --> AppRoot
    AppRoot --> Router
    Router --> DashLayout
    DashLayout --> Inicio
    DashLayout --> Controles
    DashLayout --> Reportes
    DashLayout --> Documentos
    DashLayout --> Formacion
    DashLayout --> Lanzamientos

    Inicio --> BarChart
    Inicio --> OrgChart
    Controles --> ControlsTable
    ReactApp --> LoginScreen
    DashLayout --> Header
    DashLayout --> Footer
    DashLayout --> Sidebar
    Inicio --> WelcomeMsg
    LoginScreen --> GoogleIcon

    UIComponents(("UI Components")) --> MagicBox
    UIComponents --> Tarjeta
    UIComponents --> ContenidoTablero
    UIComponents --> TablaPrimeNtf

    ReactApp --> APIJS
    APIJS --> DashboardHook --> MQSHook
    DashboardHook --> YieldHook
    DashboardHook --> YieldStatsHook
    DashboardHook --> MesHook
    DashboardHook --> RepairHistoryHook
    DashboardHook --> StationPerfHook
    DashboardHook --> TopFailuresHook

    %% Click Events
    click HTML "https://github.com/pmartingatica/fe-ns/blob/main/index.html"
    click ViteConfig "https://github.com/pmartingatica/fe-ns/blob/main/vite.config.js"
    click AppRoot "https://github.com/pmartingatica/fe-ns/blob/main/src/App.jsx"
    click Router "https://github.com/pmartingatica/fe-ns/blob/main/src/main.jsx"
    click ESLintConfig "https://github.com/pmartingatica/fe-ns/blob/main/eslint.config.js"
    click PackageJSON "https://github.com/pmartingatica/fe-ns/blob/main/package.json"
    click DashLayout "https://github.com/pmartingatica/fe-ns/blob/main/src/layouts/DashboardLayout.jsx"
    click Inicio "https://github.com/pmartingatica/fe-ns/blob/main/src/pages/Inicio.jsx"
    click Controles "https://github.com/pmartingatica/fe-ns/blob/main/src/pages/Controles.jsx"
    click Reportes "https://github.com/pmartingatica/fe-ns/blob/main/src/pages/Reportes.jsx"
    click Documentos "https://github.com/pmartingatica/fe-ns/blob/main/src/pages/Documentos.jsx"
    click Formacion "https://github.com/pmartingatica/fe-ns/blob/main/src/pages/Formacion.jsx"
    click Lanzamientos "https://github.com/pmartingatica/fe-ns/blob/main/src/pages/Lanzamientos.jsx"
    click BarChart "https://github.com/pmartingatica/fe-ns/blob/main/src/components/BarChart.jsx"
    click OrgChart "https://github.com/pmartingatica/fe-ns/blob/main/src/components/OrganizationChart.jsx"
    click ControlsTable "https://github.com/pmartingatica/fe-ns/blob/main/src/components/DailyControlsTable.jsx"
    click LoginScreen "https://github.com/pmartingatica/fe-ns/blob/main/src/components/LoginScreen.jsx"
    click Header "https://github.com/pmartingatica/fe-ns/blob/main/src/components/Header.jsx"
    click Footer "https://github.com/pmartingatica/fe-ns/blob/main/src/components/Footer.jsx"
    click Sidebar "https://github.com/pmartingatica/fe-ns/blob/main/src/components/Sidebar.jsx"
    click WelcomeMsg "https://github.com/pmartingatica/fe-ns/blob/main/src/components/WelcomeMessage.jsx"
    click GoogleIcon "https://github.com/pmartingatica/fe-ns/blob/main/src/components/GoogleIcon.jsx"
    click MagicBox "https://github.com/pmartingatica/fe-ns/blob/main/src/MagicBox.jsx"
    click Tarjeta "https://github.com/pmartingatica/fe-ns/blob/main/src/componentes/Tarjeta.jsx"
    click ContenidoTablero "https://github.com/pmartingatica/fe-ns/blob/main/src/componentes/ContenidoTablero.jsx"
    click TablaPrimeNtf "https://github.com/pmartingatica/fe-ns/blob/main/src/componentes/TablaPrimeNtf.jsx"
    click APIJS "https://github.com/pmartingatica/fe-ns/blob/main/src/hooks/api.js"
    click DashboardHook "https://github.com/pmartingatica/fe-ns/blob/main/src/hooks/Dashboard.js"
    click MQSHook "https://github.com/pmartingatica/fe-ns/blob/main/src/hooks/useMQS.js"
    click YieldHook "https://github.com/pmartingatica/fe-ns/blob/main/src/hooks/useYield.js"
    click YieldStatsHook "https://github.com/pmartingatica/fe-ns/blob/main/src/hooks/useYieldStats.js"
    click MesHook "https://github.com/pmartingatica/fe-ns/blob/main/src/hooks/useMes.js"
    click RepairHistoryHook "https://github.com/pmartingatica/fe-ns/blob/main/src/hooks/useRepairHistory.js"
    click StationPerfHook "https://github.com/pmartingatica/fe-ns/blob/main/src/hooks/useStationPerformance.js"
    click TopFailuresHook "https://github.com/pmartingatica/fe-ns/blob/main/src/hooks/useTopFailures.js"

    %% Styles
    classDef buildCI fill:#f0f0f0,stroke:#888
    classDef hosting fill:#cfe2f3,stroke:#2a5d84,color:#000
    classDef client fill:#d9ead3,stroke:#6a8a3f,color:#000
    classDef external fill:#f9cb9c,stroke:#bd6d14,color:#000
```
