# sriya-singh/eventflow architecture

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

- Interactive diagram: https://gitdiagram.com/sriya-singh/eventflow
- Repository: https://github.com/sriya-singh/eventflow

## Overview

##### Project Overview
- EventFlow is a web application for event planning and management.
- It uses HTML, CSS, and JavaScript for the frontend, Firebase for authentication and database (Firestore), and the Gemini API for AI-driven email generation.
- The application comprises several standalone pages (e.g., home, profile, invite, createNew, upcoming) that share common elements like a navbar and overall styling.

##### Main Components
a. Frontend/UI Components:
- Pages: index.html, home.html, createNew.html, invite.html, profile.html, upcoming.html.
- Styles: Each page has its own CSS (e.g., home.css, createNew.css, invite.css, profile.css, upcoming.css) plus a global style.css for overall styling.
- JavaScript files: Corresponding JS files for individual pages (e.g., home.js, createNew.js, invite.js, profile.js, upcoming.js) to handle UI interactions.
- Navbar Component: Represented by navbar.html and navbar.css, this is the shared navigation element across the application.

b. Backend Integration and External Services:
- Firebase:
- firebaseauth.js handles user authentication.
- Firebase services are used for authentication and Firestore for database management (storing event data, guest lists, funding logs, etc.).
- AI Email Generation:
- Gemini API integration for AI-powered personalized email generation.

##### Relationships and Interactions
- The Frontend/UI components are responsible for collecting user inputs on events, scheduling, checklists, guest management, etc.
- The JavaScript modules, including firebaseauth.js, interact with Firebase services to authenticate users and perform CRUD operations on event data.
- When generating personalized emails, the frontend or a dedicated module will call the Gemini API to get AI-generated content.
- The Navbar is a shared element that provides navigation between the various pages.
- Data flows from the user’s browser (via HTML forms and UI interactions) to Firebase for secure authentication and data storage, and outward requests are made to the external Gemini API for generating email content.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Clear division between the UI (HTML/CSS/JS) and backend functions (Firebase authentication, Firestore interactions, AI API integration).
- Modular Design: Each page (home, createNew, etc.) is implemented as separate modules with its own style and script, making it easier to maintain.
- Client-Server Architecture: While the UI runs on the client side, backend services like Firebase and the Gemini API serve as the server-side components.
- External Service Integration: Emphasizes RESTful API calls between the client and external services (Firebase and Gemini).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend UI Layer
    subgraph "Frontend UI"
        subgraph "HTML Pages"
            index_html["index.html"]:::frontend
            home_html["home.html"]:::frontend
            createNew_html["createNew.html"]:::frontend
            invite_html["invite.html"]:::frontend
            profile_html["profile.html"]:::frontend
            upcoming_html["upcoming.html"]:::frontend
        end
        subgraph "CSS Styles"
            style_css["style.css"]:::frontend
            home_css["home.css"]:::frontend
            createNew_css["createNew.css"]:::frontend
            invite_css["invite.css"]:::frontend
            profile_css["profile.css"]:::frontend
            upcoming_css["upcoming.css"]:::frontend
        end
        subgraph "JavaScript Modules"
            home_js["home.js"]:::frontend
            createNew_js["createNew.js"]:::frontend
            invite_js["invite.js"]:::frontend
            profile_js["profile.js"]:::frontend
            upcoming_js["upcoming.js"]:::frontend
        end
        subgraph "Navigation Component"
            navbarHTML["navbar.html"]:::frontend
            navbarCSS["navbar.css"]:::frontend
        end
    end

    %% Backend Services
    subgraph "Backend Services"
        firebase_auth["Firebase Auth"]:::backend
        firestore["Firestore Database"]:::database
        gemini["Gemini API"]:::api
    end

    %% Data Flow and Interactions
    %% UI Pages interaction with Authentication via JS Modules
    home_js -->|"AuthRequest"| firebase_auth
    createNew_js -->|"AuthRequest"| firebase_auth
    invite_js -->|"AuthRequest"| firebase_auth
    profile_js -->|"AuthRequest"| firebase_auth
    upcoming_js -->|"AuthRequest"| firebase_auth

    %% Firebase Auth interacts with Firestore for Data CRUD
    firebase_auth -->|"DataCRUD"| firestore

    %% JS Modules call Gemini API for AI-driven email generation
    home_js -->|"AIemail"| gemini
    createNew_js -->|"AIemail"| gemini
    invite_js -->|"AIemail"| gemini
    profile_js -->|"AIemail"| gemini
    upcoming_js -->|"AIemail"| gemini

    %% Navigation component helps in routing between pages
    navbarHTML ---|"Navigation"| index_html
    navbarHTML ---|"Navigation"| home_html
    navbarHTML ---|"Navigation"| createNew_html
    navbarHTML ---|"Navigation"| invite_html
    navbarHTML ---|"Navigation"| profile_html
    navbarHTML ---|"Navigation"| upcoming_html

    %% Click Events for Frontend/UI Pages
    click index_html "https://github.com/sriya-singh/eventflow/blob/main/index.html"
    click home_html "https://github.com/sriya-singh/eventflow/blob/main/home.html"
    click createNew_html "https://github.com/sriya-singh/eventflow/blob/main/createNew.html"
    click invite_html "https://github.com/sriya-singh/eventflow/blob/main/invite.html"
    click profile_html "https://github.com/sriya-singh/eventflow/blob/main/profile.html"
    click upcoming_html "https://github.com/sriya-singh/eventflow/blob/main/upcoming.html"

    click style_css "https://github.com/sriya-singh/eventflow/blob/main/style.css"
    click home_css "https://github.com/sriya-singh/eventflow/blob/main/home.css"
    click createNew_css "https://github.com/sriya-singh/eventflow/blob/main/createNew.css"
    click invite_css "https://github.com/sriya-singh/eventflow/blob/main/invite.css"
    click profile_css "https://github.com/sriya-singh/eventflow/blob/main/profile.css"
    click upcoming_css "https://github.com/sriya-singh/eventflow/blob/main/upcoming.css"

    click home_js "https://github.com/sriya-singh/eventflow/blob/main/home.js"
    click createNew_js "https://github.com/sriya-singh/eventflow/blob/main/createNew.js"
    click invite_js "https://github.com/sriya-singh/eventflow/blob/main/invite.js"
    click profile_js "https://github.com/sriya-singh/eventflow/blob/main/profile.js"
    click upcoming_js "https://github.com/sriya-singh/eventflow/blob/main/upcoming.js"

    click navbarHTML "https://github.com/sriya-singh/eventflow/blob/main/navbar.html"
    click navbarCSS "https://github.com/sriya-singh/eventflow/blob/main/navbar.css"

    %% Click Event for Firebase Integration
    click firebase_auth "https://github.com/sriya-singh/eventflow/blob/main/firebaseauth.js"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef database fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef api fill:#FFC0CB,stroke:#333,stroke-width:2px;
```
