# diegoalv17/greenplaces-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/diegoalv17/greenplaces-frontend
- Repository: https://github.com/diegoalv17/greenplaces-frontend

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with React 18, bundled and served via Vite.
- It’s a static, frontend-only site (“GreenPlaces”) optimized for SEO, with responsive UI components, animations, and integrations for contact forms.

##### File structure
- Top level: config files (eslint.config.js, tailwind.config.js, vite.config.js), package.json, index.html, and the src & public folders.
- /public holds static assets (images, video).
- /src contains the React entrypoint (main.jsx), root component (App.jsx), global CSS (index.css), and a components folder with About, Areas, Education, Events, Footer, Hero, Navbar, Tips.
- No backend or API code—external services (Formspree, EmailJS) are used for form processing and email.

##### README for additional insights
- Emphasis on modern, responsive UI and SEO.

##### Components
a. Frontend (React app)
- Vite build tooling
- React component tree (App, Navbar, Hero, About, etc.)
- Tailwind CSS styling
b. Static assets
c. External Services
- Formspree (form submission endpoint)
- EmailJS (email delivery)
d. Hosting/CDN (if applicable)
- e.g., Netlify, Vercel, S3 + CloudFront

##### Architectural patterns & design principles
- SPA architecture (client-side routing & rendering).
- Component-based UI (React).
- Utility-first CSS (Tailwind).
- External BaaS-style service integrations (Formspree, EmailJS).

##### Essential architectural elements to capture
- The SPA bundle and its internal component structure.
- Asset delivery (img/video).
- Form processing via Formspree & EmailJS.
- Hosting layer/CDN.
- Build step (Vite + node/npm).

## Diagram (Mermaid)

```mermaid
graph TD
    User["User Browser"]:::external

    subgraph "GreenPlaces SPA"
        direction TB
        pkg["package.json"]:::spa
        vitecfg["vite.config.js"]:::spa
        postcss["postcss.config.cjs"]:::spa
        eslintcfg["eslint.config.js"]:::spa
        indexhtml["index.html (SEO metadata)"]:::spa
        main["src/main.jsx"]:::spa
        App["src/App.jsx"]:::spa
        css["src/index.css"]:::spa
        tailwindcfg["tailwind.config.js"]:::spa
        Tailwind["Tailwind CSS Styling"]:::spa
        Icons["Lucide React Icons"]:::spa

        subgraph "React Components"
            direction TB
            Navbar["Navbar"]:::spa
            Hero["Hero"]:::spa
            About["About"]:::spa
            Areas["Areas"]:::spa
            Education["Education"]:::spa
            Events["Events"]:::spa
            Tips["Tips"]:::spa
            Footer["Footer"]:::spa
        end
    end

    subgraph "Static Assets"
        direction TB
        Images["public/img"]:::assets
        Video["public/video/fondo.mp4"]:::assets
    end

    subgraph "External Services"
        direction TB
        Formspree["Formspree API"]:::services
        EmailJS["EmailJS API"]:::services
    end

    subgraph "Hosting/CDN"
        direction TB
        CDN["Netlify/Vercel/S3+CloudFront"]:::hosting
    end

    %% Data Flows
    User -->|loads SPA| indexhtml
    indexhtml -->|initializes| main
    main -->|renders| App
    App -->|uses assets| Images
    App -->|uses assets| Video
    App -->|submits forms to| Formspree
    App -->|submits emails via| EmailJS
    CDN -->|serves| indexhtml
    CDN -->|serves| Images
    CDN -->|serves| Video

    %% Build Pipeline
    subgraph "Build Pipeline"
        direction TB
        Source["src + tailwind.config.js"]:::spa
        Source -->|bundled by Vite| Bundle["dist folder"]:::spa
        Bundle -->|deployed to| CDN
    end

    %% Click Events
    click pkg "https://github.com/diegoalv17/greenplaces-frontend/blob/main/package.json"
    click vitecfg "https://github.com/diegoalv17/greenplaces-frontend/blob/main/vite.config.js"
    click postcss "https://github.com/diegoalv17/greenplaces-frontend/blob/main/postcss.config.cjs"
    click eslintcfg "https://github.com/diegoalv17/greenplaces-frontend/blob/main/eslint.config.js"
    click indexhtml "https://github.com/diegoalv17/greenplaces-frontend/blob/main/index.html"
    click main "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/main.jsx"
    click App "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/App.jsx"
    click css "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/index.css"
    click tailwindcfg "https://github.com/diegoalv17/greenplaces-frontend/blob/main/tailwind.config.js"
    click Images "https://github.com/diegoalv17/greenplaces-frontend/tree/main/public/img"
    click Video "https://github.com/diegoalv17/greenplaces-frontend/blob/main/public/video/fondo.mp4"
    click Navbar "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/components/Navbar.jsx"
    click Hero "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/components/Hero.jsx"
    click About "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/components/About.jsx"
    click Areas "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/components/Areas.jsx"
    click Education "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/components/Education.jsx"
    click Events "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/components/Events.jsx"
    click Tips "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/components/Tips.jsx"
    click Footer "https://github.com/diegoalv17/greenplaces-frontend/blob/main/src/components/Footer.jsx"

    %% Styles
    classDef spa fill:#D0E8FF,stroke:#004085,color:#004085
    classDef assets fill:#D0F0C0,stroke:#155724,color:#155724
    classDef services fill:#FFD8A8,stroke:#975A16,color:#975A16
    classDef hosting fill:#E0E0E0,stroke:#343A40,color:#343A40
    classDef external fill:#F5F5F5,stroke:#6C757D,color:#6C757D
```
