# bryanvillanueva/chatboot-ecaf-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/bryanvillanueva/chatboot-ecaf-frontend
- Repository: https://github.com/bryanvillanueva/chatboot-ecaf-frontend

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with Create React App.
- It provides a UI for uploading Excel files (students, programs, grades, diplomas), consulting and generating certificates, chat, dashboards, and vector store management.
- It communicates with one or more backend REST APIs (certificateService, diplomaService, etc.).

##### File structure
Top-level:
- public/ – static assets (HTML template, manifest, fonts, images, CSV/XLS templates).
- src/ – all React source code.
- package.json, package-lock.json – dependencies and scripts.
Inside src/:
- index.js & App.js – application entry point and root component.
- components/ – shared UI components (Navbar, Layout, NotificationSystem, AudioPlayer).
- pages/ – route-level views (Login, Dashboard, Chat, Appointments, VectorStoreManager).
- carga/ – “upload” feature modules: CargaExcelBase, Uploader components, page wrappers, and an API helper.
- certificados/ – certificate consultation/generation pages.
- informacion/ – student/program info pages.
- services/ – thin HTTP client wrappers for each backend endpoint (certificateService.js, diplomaService.js, etc.).
- styles/ – theme definitions.
- tests & setupTests.js – unit testing support.

##### README for additional insights
- It’s a standard CRA project with no custom architectural docs.
- Build & dev scripts, deployment pointers.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Deployment
    subgraph "Build & Deployment"
        NPM["npm scripts"]:::build
        Webpack["Webpack/Babel"]:::build
        Build["build/"]:::artifact
    end
    NPM -->|runs| Webpack
    Webpack -->|outputs| Build
    Build -->|deploys to| CDN

    %% Static Assets
    subgraph "Static Assets Host"
        CDN["CDN / Web Server"]:::cdn
        Public["public/"]:::public
    end
    CDN --> Public

    %% Client
    Browser["User's Browser"]:::client
    Browser -->|requests index.html| CDN

    %% React SPA
    Browser -->|"loads SPA"| Index
    subgraph "React SPA" 
        subgraph "Entry Point"
            Index["src/index.js"]:::entry
            App["src/App.js"]:::entry
        end

        subgraph "UI Layer"
            Navbar["Navbar"]:::ui
            Layout["Layout"]:::ui
            NotificationSystem["NotificationSystem"]:::ui
            AudioPlayer["AudioPlayer"]:::ui
            Messages["Messages"]:::ui
            InfoDrawer["InfoDrawer"]:::ui
        end

        subgraph "Pages / Routes"
            Login["Login"]:::page
            Dashboard["Dashboard"]:::page
            Chat["Chat"]:::page
            Appointments["Appointments"]:::page
            VectorStoreManager["VectorStoreManager"]:::page
        end

        subgraph "Feature Modules"
            subgraph "Carga"
                CargaIndex["index"]:::feature
                CargaBase["CargaExcelBase"]:::feature
                CargaUI["CargaExcel"]:::feature
                CargaCSS["CargaExcel.css"]:::feature
                APIHelper["api.js"]:::feature
                EstUploader["EstudiantesUploader"]:::feature
                NotasUploader["NotasUploader"]:::feature
                DiplomasUploader["DiplomasUploader"]:::feature
                EstPage["EstudiantesPage"]:::feature
                ProgPage["ProgramasPage"]:::feature
                DiplPage["DiplomasPage"]:::feature
            end
            subgraph "Certificados"
                Consult["consultar.js"]:::feature
                Generar["generar.js"]:::feature
            end
            subgraph "Informacion"
                InfoEst["InfoEstudiantes"]:::feature
                InfoProg["InfoProgramas"]:::feature
            end
        end

        subgraph "Service Layer"
            CertService["certificateService"]:::service
            DiplomaService["diplomaService"]:::service
            DuplicadoService["duplicadoService"]:::service
            CursoCortoService["cursoCortoService"]:::service
            CertEstService["certificateServiceEstudio"]:::service
            WebhookService["webhookService"]:::service
        end
    end

    %% External APIs
    subgraph "External APIs"
        APICert["Certificate API"]:::api
        APIDiploma["Diploma API"]:::api
        APIStudent["Student/Program API"]:::api
        APIGrades["Grades API"]:::api
        APIChat["Chatbot/Webhook API"]:::api
    end

    %% Connections within SPA
    Index --> App
    App --> Navbar
    App --> Layout
    Layout --> NotificationSystem
    Layout --> AudioPlayer
    Layout --> Messages
    Layout --> InfoDrawer
    App --> Login
    App --> Dashboard
    App --> Chat
    App --> Appointments
    App --> VectorStoreManager

    Login --> CertService
    Dashboard --> CertService
    Chat --> WebhookService
    Appointments --> DiplomaService
    VectorStoreManager --> DuplicadoService

    %% Feature to Services
    CargaIndex --> APIHelper
    CargaBase --> APIHelper
    CargaUI --> APIHelper
    EstUploader --> APIHelper
    NotasUploader --> APIHelper
    DiplomasUploader --> APIHelper
    APIHelper --> CertService
    APIHelper --> DiplomaService

    Consult --> CertService
    Generar --> CertService

    InfoEst --> DuplicadoService
    InfoProg --> DuplicadoService

    %% Services to External APIs
    CertService --> APICert
    DiplomaService --> APIDiploma
    DuplicadoService --> APIStudent
    CursoCortoService --> APIStudent
    CertEstService --> APICert
    WebhookService --> APIChat

    %% Click Events
    click Index "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/index.js"
    click App "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/App.js"
    click Navbar "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/components/Navbar.js"
    click Layout "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/components/Layout.js"
    click NotificationSystem "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/components/NotificationSystem.js"
    click NotificationSystem "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/components/NotificationSystem.css"
    click AudioPlayer "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/components/customAudioPlayer.js"
    click Messages "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/components/Messages.js"
    click InfoDrawer "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/components/InfoDrawer.js"
    click Login "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/pages/Login.js"
    click Dashboard "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/pages/Dashboard.js"
    click Chat "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/pages/Chat.js"
    click Appointments "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/pages/Appointments.js"
    click VectorStoreManager "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/pages/VectorStoreManager.js"
    click CargaIndex "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/index.js"
    click CargaBase "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/CargaExcelBase.js"
    click CargaUI "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/CargaExcel.js"
    click CargaCSS "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/CargaExcel.css"
    click APIHelper "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/api.js"
    click EstUploader "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/EstudiantesUploader.js"
    click NotasUploader "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/NotasUploader.js"
    click DiplomasUploader "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/DiplomasUploader.js"
    click EstPage "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/estudiantes/EstudiantesPage.js"
    click ProgPage "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/programas/ProgramasPage.js"
    click DiplPage "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/carga/diplomas/DiplomasPage.js"
    click Consult "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/certificados/consultar.js"
    click Generar "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/certificados/generar.js"
    click InfoEst "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/informacion/InfoEstudiantes.js"
    click InfoProg "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/informacion/InfoProgramas.js"
    click CertService "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/services/certificateService.js"
    click DiplomaService "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/services/diplomaService.js"
    click DuplicadoService "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/services/duplicadoService.js"
    click CursoCortoService "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/services/cursoCortoService.js"
    click CertEstService "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/services/certificateServiceEstudio.js"
    click WebhookService "https://github.com/bryanvillanueva/chatboot-ecaf-frontend/blob/master/src/services/webhookService.js"

    %% Styles
    classDef client fill:#f9f,stroke:#333,stroke-width:1px
    classDef entry fill:#bbf,stroke:#333,stroke-width:1px
    classDef ui fill:#afa,stroke:#333,stroke-width:1px
    classDef page fill:#ffb,stroke:#333,stroke-width:1px
    classDef feature fill:#fcf,stroke:#333,stroke-width:1px
    classDef service fill:#cff,stroke:#333,stroke-width:1px
    classDef api fill:#fdd,stroke:#333,stroke-width:1px
    classDef build fill:#ddd,stroke:#333,stroke-width:1px
    classDef artifact fill:#bbb,stroke:#333,stroke-width:1px
    classDef cdn fill:#ffd,stroke:#333,stroke-width:1px
    classDef public fill:#dfd,stroke:#333,stroke-width:1px
```
