# lorettarehm/evolve-empowerment-journey architecture

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

- Interactive diagram: https://gitdiagram.com/lorettarehm/evolve-empowerment-journey
- Repository: https://github.com/lorettarehm/evolve-empowerment-journey

## Overview

##### Project Type and Purpose
- The project is a full-stack web application where the bulk of the code is a React-based frontend built with TypeScript and Vite.
- It leverages modern tools and libraries such as shadcn-ui and Tailwind CSS for styling and UI components.
- In addition to the frontend, there are backend/server components in the form of Supabase functions (found in the “supabase/functions” directory) that handle specific API-like tasks (e.g., chat-AI, fetch research, send feedback).
- The project is designed to be deployed via Lovable (with additional deployment recommendations, such as using Netlify for custom domains).

##### Analyzing the File Structure
- At the root level, you see configuration files (like package.json, vite.config.ts, tailwind.config.ts) that define the development/build environment.
- The “public” directory holds static assets, including uploads and a robots.txt.
- The “src” directory contains the React application source code:
- "index.html", "main.tsx", and "App.tsx" serve as the entry points.
- Subdirectories like “components”, “pages”, “hooks”, and “contexts” clearly denote separation of concerns, following common design patterns (component-based/MVC-like).
- The “components” directory is structured into further categories (assessment, chat, home, profile, techniques, ui) reflecting various parts of the UI and features.
- The “supabase” directory holds backend serverless functions and configuration details used for integrating Supabase services.

##### Key System Components and Their Relationships
- Frontend Application:
- Built with React (with TypeScript) and Vite.
- Comprises various UI components (organized under src/components) that handle distinct sections like Home, Assessment, Chat, Profile, Techniques, etc.
- Utilizes context (such as AuthContext and ThemeContext) and custom hooks (e.g., use-chat, use-mobile) to manage state and UI interactions.
- UI and Styling:
- Uses the shadcn-ui component library and Tailwind CSS for building responsive and well-styled user interfaces.
- Backend/Serverless Functions:
- Located in the “supabase/functions” directory, these functions support API interactions (for example, chat functionality, fetching research data, feedback handling).
- The integration code in “src/integrations/supabase” connects the client side with these backend functions.
- Deployment/Integration:
- The project can be deployed directly via Lovable or through other platforms like Netlify for those requiring custom domains.
- The development lifecycle is supported by tools like Vite for fast development server startup and hot reloading.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Entities
    BROWSER["Browser/Client"]:::browser
    ASSETS["Static Assets"]:::assets

    %% Frontend Application Subgraph
    subgraph "Frontend Application"
        FE_Index["Index.html"]:::frontend
        FE_Main["main.tsx"]:::frontend
        FE_App["App.tsx"]:::frontend
        UI_Components["UI Components"]:::frontend
        PAGES["Pages"]:::frontend
        STATE["State Management (Contexts)"]:::frontend
        HOOKS["Custom Hooks"]:::frontend
    end

    %% Integration Layer
    INTEGRATION["Supabase Integration"]:::integration

    %% Backend Functions Subgraph
    subgraph "Backend (Supabase Functions)"
        CHAT["chat-AI Function"]:::backend
        RESEARCH["fetch-research Function"]:::backend
        FEEDBACK["send-feedback Function"]:::backend
    end

    %% Connections

    %% Browser connections
    BROWSER --> FE_Index
    BROWSER --> ASSETS

    %% Frontend sequence (loading order)
    FE_Index --> FE_Main --> FE_App

    %% Frontend internal relationships
    FE_App --> UI_Components
    FE_App --> PAGES
    FE_App --> STATE
    FE_App --> HOOKS

    %% Frontend to Backend integration
    FE_App --> INTEGRATION
    INTEGRATION --> CHAT
    INTEGRATION --> RESEARCH
    INTEGRATION --> FEEDBACK

    %% Styles
    classDef browser fill:#f4a582,stroke:#333,stroke-width:2px;
    classDef frontend fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef backend fill:#F5B7B1,stroke:#333,stroke-width:2px;
    classDef integration fill:#A3E4D7,stroke:#333,stroke-width:2px;
    classDef assets fill:#D2B4DE,stroke:#333,stroke-width:2px;

    %% Click Events
    click FE_Index "https://github.com/lorettarehm/evolve-empowerment-journey/blob/main/index.html"
    click FE_Main "https://github.com/lorettarehm/evolve-empowerment-journey/blob/main/src/main.tsx"
    click FE_App "https://github.com/lorettarehm/evolve-empowerment-journey/blob/main/src/App.tsx"
    click UI_Components "https://github.com/lorettarehm/evolve-empowerment-journey/tree/main/src/components"
    click PAGES "https://github.com/lorettarehm/evolve-empowerment-journey/tree/main/src/pages"
    click STATE "https://github.com/lorettarehm/evolve-empowerment-journey/tree/main/src/contexts"
    click HOOKS "https://github.com/lorettarehm/evolve-empowerment-journey/tree/main/src/hooks"
    click INTEGRATION "https://github.com/lorettarehm/evolve-empowerment-journey/tree/main/src/integrations/supabase"
    click CHAT "https://github.com/lorettarehm/evolve-empowerment-journey/tree/main/supabase/functions/chat-ai"
    click RESEARCH "https://github.com/lorettarehm/evolve-empowerment-journey/tree/main/supabase/functions/fetch-research"
    click FEEDBACK "https://github.com/lorettarehm/evolve-empowerment-journey/tree/main/supabase/functions/send-feedback"
    click ASSETS "https://github.com/lorettarehm/evolve-empowerment-journey/tree/main/public"
```
