# eugenevuong/multimodalhackathon2025-continued architecture

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

- Interactive diagram: https://gitdiagram.com/eugenevuong/multimodalhackathon2025-continued
- Repository: https://github.com/eugenevuong/multimodalhackathon2025-continued

## Overview

##### Main Components
- Frontend (Next.js App):
- This includes everything under the “frontend” directory.
- Key subcomponents to highlight are the page routes (e.g., “camera”, “dashboard”, “results”, dynamic [sessionID] pages under the “server” folder) along with UI components (chat-interface, task-bar, and various UI primitives).
- The lib folder (agent.ts, firebaseConfig.ts, together-ai.ts, utils.ts) indicates business logic, external service configuration (e.g., Firebase), and integrations (possibly with Together-AI).

- Backend (Python Application):
- Everything in the “backend” directory forms the Python backend.
- The presence of files such as “GoogleGemini.py” and “agent.py” suggests modules that implement AI or agent-driven logic.
- The “runDatabase.ipynb” notebook implies data processing or database initialization tasks.
- The “_deeplake_log” folder contains logs in JSONL format, indicating that the backend might use these logs for storing or processing data.
- The “tempVideo” folder with multiple video clips indicates that the backend handles media storage/processing (potentially for motion or video-based features).

##### Relationships and Interactions
- Client Side and Frontend:
- Users interact with the system via a web client that loads the Next.js frontend.
- The structured pages (camera, dashboard, results, session-based routes) likely interact with the backend via API calls.

- Frontend to Backend Communication:
- If the Next.js server-side routes or API files (under “app/server/[sessionID]”) are used to mediate communication, indicate this intermediary layer.

- Backend Processing:
- Logging mechanism which writes data to the “_deeplake_log” folders.
- Handling of media files stored under “tempVideo,” emphasizing that these may be processed or archived.

- External and Integration Services:
- External services such as Firebase (referenced in “firebaseConfig.ts”) and any potential interactions with Together-AI (from “together-ai.ts”).

##### Architectural Patterns & Principles
- Separation of Concerns:
- Clearly separate the frontend and backend components to underline the full-stack nature.

- Component-Based UI (Frontend):

- Modular Backend Services:
- Backend’s modules (agent, GoogleGemini, logging, database setup) as individual blocks that interact, showing data flow among them.

- Use of a Data/Media Layer:
- Storage and processing: the temporary video storage, log storage (_deeplake_log), and any potential (implicit) database managed or referenced in “runDatabase.ipynb.”

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Entities
    User["Web Browser"]:::external

    %% Frontend Layer
    subgraph "Frontend Layer"
        FE["Next.js Frontend"]:::frontend
        subgraph "Pages"
            Camera["Camera Page"]:::frontend
            Dashboard["Dashboard Page"]:::frontend
            Results["Results Page"]:::frontend
            Session["Dynamic Session Page"]:::frontend
        end
        UIC["UI Components"]:::frontend
        Lib["Business Logic & Integrations"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE["Python Backend"]:::backend
        Agent["AI Agent (agent.py)"]:::backend
        Gemini["Google Gemini (GoogleGemini.py)"]:::backend
        Database["Database Init (runDatabase.ipynb)"]:::backend
        Logging["Logging (_deeplake_log)"]:::storage
        Media["Media Storage (tempVideo)"]:::storage
    end

    %% External Services
    subgraph "External Services"
        Firebase["Firebase"]:::external
        Together["Together-AI"]:::external
    end

    %% Connections: User interactions with Frontend Pages
    User -->|"visits"| Camera
    User -->|"visits"| Dashboard
    User -->|"visits"| Results
    User -->|"visits"| Session

    %% Frontend Internal Relationships
    Camera -->|"uses"| UIC
    Dashboard -->|"uses"| UIC
    Results -->|"uses"| UIC
    Session -->|"uses"| UIC

    Camera -->|"triggers"| Lib
    Dashboard -->|"triggers"| Lib
    Results -->|"triggers"| Lib
    Session -->|"triggers"| Lib

    Lib -->|"calls"| BE
    Lib -->|"integrates"| Firebase
    Lib -->|"integrates"| Together

    %% Backend Internal Processing
    BE -->|"dispatches"| Agent
    BE -->|"dispatches"| Gemini
    BE -->|"initiates"| Database
    BE -->|"records to"| Logging
    BE -->|"handles media"| Media

    Agent -->|"logs results"| Logging
    Agent -->|"stores media"| Media

    Gemini -->|"logs results"| Logging
    Gemini -->|"stores media"| Media

    %% Click Events for Frontend Components
    click FE "https://github.com/eugenevuong/multimodalhackathon2025-continued/tree/main/frontend"
    click Camera "https://github.com/eugenevuong/multimodalhackathon2025-continued/blob/main/frontend/src/app/camera/page.tsx"
    click Dashboard "https://github.com/eugenevuong/multimodalhackathon2025-continued/blob/main/frontend/src/app/dashboard/page.tsx"
    click Results "https://github.com/eugenevuong/multimodalhackathon2025-continued/blob/main/frontend/src/app/results/page.tsx"
    click Session "https://github.com/eugenevuong/multimodalhackathon2025-continued/blob/main/frontend/src/app/server/[sessionID]/page.tsx"
    click UIC "https://github.com/eugenevuong/multimodalhackathon2025-continued/tree/main/frontend/src/components"
    click Lib "https://github.com/eugenevuong/multimodalhackathon2025-continued/tree/main/frontend/src/lib"

    %% Click Events for Backend Components
    click BE "https://github.com/eugenevuong/multimodalhackathon2025-continued/tree/main/backend"
    click Agent "https://github.com/eugenevuong/multimodalhackathon2025-continued/blob/main/backend/agent.py"
    click Gemini "https://github.com/eugenevuong/multimodalhackathon2025-continued/blob/main/backend/GoogleGemini.py"
    click Database "https://github.com/eugenevuong/multimodalhackathon2025-continued/blob/main/backend/runDatabase.ipynb"
    click Logging "https://github.com/eugenevuong/multimodalhackathon2025-continued/tree/main/backend/_deeplake_log"
    click Media "https://github.com/eugenevuong/multimodalhackathon2025-continued/tree/main/backend/tempVideo"

    %% Styles
    classDef frontend fill:#DDEEFF,stroke:#000,stroke-width:2px;
    classDef backend fill:#FFDDDD,stroke:#000,stroke-width:2px;
    classDef external fill:#DDFFDD,stroke:#000,stroke-width:2px;
    classDef storage fill:#FFFFCC,stroke:#000,stroke-width:2px;
```
