# yormanona/comunikate_ec_v1 architecture

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

- Interactive diagram: https://gitdiagram.com/yormanona/comunikate_ec_v1
- Repository: https://github.com/yormanona/comunikate_ec_v1

## Overview

##### Project Type and Purpose
- This is a Single-Page Application (SPA) built with React, using Vite as the build tool and dev server.
- It’s a content-driven, static front-end for a courses/coworking site: it serves various pages (Home, Cursos, Servicios, Nosotros, Inscríbete, Contacto) and renders data loaded from local JSON files.

##### File Structure
- Top level:
- package.json / package-lock.json: dependencies and scripts
- vite.config.js: Vite build/dev configuration
- public/: static assets (images, instructors folder)
- src/: application source
- src/ subdivisions:
- components/: reusable UI components (NavBar, HomeSlider, footer, etc.)
- pages/: page-level components, organized by route (Cursos, Cursos/Audiovisual, etc.)
- data/: local JSON files (instructores.json, course data)
- hook/: custom hooks (ScrollToTop, useTypewriter)
- assets/img/: various images for courses, gallery, etc.
- styles/: CSS files organized by component/page
- main.jsx / App.jsx: application entry point and router setup

##### Extract Insights from README
- Confirms use of React + Vite with HMR (fast refresh) via @vitejs/plugin-react or plugin-react-swc.
- No backend or external API is mentioned; data is loaded locally.

##### Main Components
a. Developer Environment
- Code Editor / Git Repo (local machine)
- Vite Dev Server (localhost:3000) with HMR
b. Build Pipeline
- Vite (bundler/transpiler)
- Babel or SWC plugin
- Output: static assets (JS/CSS/HTML) in dist/
c. Hosting & CDN
- Vercel (per vercel.json) or any static-site host (Netlify, AWS S3 + CloudFront)
- CDN cache layer
d. Client Browser
- Loads index.html
- Executes bundled React app
- React Router handles navigation between pages
- Components fetch JSON from “public/” or embedded in bundles
e. Static Assets
- Images in public/ and src/assets/img/
- CSS files served alongside JS

##### Relationships & Data Flow
- Developer writes code → commits to Git → pushes to remote
- On push, CI/CD triggers Vite build → produces dist/ → deploys to hosting/CDN
- Client browser requests “/” → CDN/host returns index.html + JS/CSS
- Browser runs React app → React Router maps URL to a page component → component loads data (JSON or assets) → renders UI
- Navigation within the SPA does not reload the server, uses client-side routing

##### Architectural Patterns & Design Principles
- SPA with client-side routing (React Router)
- Component-based UI (atomistic structure in src/components + pages)
- Separation of concerns:
- components/ for pure UI
- pages/ for route containers
- data/ for static content
- hook/ for cross-cutting behavior
- Vite for fast rebuilds and optimized production build

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Tools
    subgraph "Developer Environment"
        direction TB
        CodeEditor["Code Editor"]:::dev
        GitRepo["Git Repository"]:::dev
        CICD["CI/CD Pipeline"]:::dev
        ProjectMeta["package.json / package-lock.json"]:::dev
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        direction TB
        ViteDev["Vite Dev Server (HMR)"]:::build
        ViteBundle["Vite Bundler"]:::build
        subgraph "Plugins"
            direction TB
            BabelSWC["Babel/SWC Plugin"]:::build
        end
        ViteConfig["vite.config.js"]:::build
    end

    %% Hosting & CDN
    subgraph "Hosting & CDN"
        direction TB
        Vercel["Vercel Hosting"]:::host
        CDN["CDN Cache Layer"]:::host
        VercelJson["vercel.json"]:::host
    end

    %% Client Runtime
    subgraph "Client Browser"
        direction TB
        Browser["Browser"]:::runtime
        subgraph "React Application"
            direction TB
            Router["React Router"]:::runtime
            Pages["Pages (src/pages/)"]:::runtime
            Components["UI Components (src/components/)"]:::runtime
            Hooks["Custom Hooks (src/hook/)"]:::runtime
        end
    end

    %% Static Data & Assets
    subgraph "Static Data & Assets"
        direction TB
        Public["Public Static Assets & Mock Data (public/)"]:::data
        DataStore["JSON Data Store (src/data/)"]:::data
        Images["Image Assets (src/img/)"]:::data
        Styles["Stylesheets (src/styles/)"]:::data
    end

    %% Connections
    CodeEditor -->|writes code| GitRepo
    GitRepo -->|push| CICD
    CICD -->|trigger build| ViteBundle
    ViteDev -->|serve| Browser
    ViteBundle -->|uses| BabelSWC
    ViteBundle -->|config via| ViteConfig
    ViteBundle -->|deploy| Vercel
    Vercel -->|cache via| CDN
    Browser -->|HTTP GET /index.html, JS, CSS| CDN
    Browser -->|runs app| Router
    Router -->|routes to| Pages
    Pages -->|renders| Components
    Components -->|use hooks| Hooks
    Pages -->|fetch JSON| DataStore
    Components -->|load assets| Public
    Components -->|load images| Images
    Components -->|apply styles| Styles

    %% Click Events
    click ProjectMeta "https://github.com/yormanona/comunikate_ec_v1/blob/main/package.json"
    click ViteConfig "https://github.com/yormanona/comunikate_ec_v1/blob/main/vite.config.js"
    click VercelJson "https://github.com/yormanona/comunikate_ec_v1/blob/main/vercel.json"
    click Public "https://github.com/yormanona/comunikate_ec_v1/tree/main/public/"
    click DataStore "https://github.com/yormanona/comunikate_ec_v1/tree/main/src/data/"
    click Browser "https://github.com/yormanona/comunikate_ec_v1/blob/main/src/main.jsx"
    click Router "https://github.com/yormanona/comunikate_ec_v1/blob/main/src/App.jsx"
    click Components "https://github.com/yormanona/comunikate_ec_v1/tree/main/src/components/"
    click Pages "https://github.com/yormanona/comunikate_ec_v1/tree/main/src/pages/"
    click Hooks "https://github.com/yormanona/comunikate_ec_v1/tree/main/src/hook/"
    click Images "https://github.com/yormanona/comunikate_ec_v1/tree/main/src/img/"
    click Styles "https://github.com/yormanona/comunikate_ec_v1/tree/main/src/styles/"

    %% Styles
    classDef dev fill:#f2f2f2,stroke:#999,stroke-width:1px;
    classDef build fill:#cce5ff,stroke:#6699cc,stroke-width:1px;
    classDef host fill:#ffe5cc,stroke:#cc9966,stroke-width:1px;
    classDef runtime fill:#d4edda,stroke:#66cc99,stroke-width:1px;
    classDef data fill:#fff3cd,stroke:#ccbb66,stroke-width:1px;
```
