# ayushi544/event-management architecture

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

- Interactive diagram: https://gitdiagram.com/ayushi544/event-management
- Repository: https://github.com/ayushi544/event-management

## Overview

##### Main Components
- Frontend: HTML/CSS templates for creating, viewing, and managing events.
- Backend: Flask application logic (found in both app.py for SQL and json_app.py for JSON).
- Data Layer:
- SQL Version: MySQL database (as indicated by the “events sql” folder).
- JSON Version: Files like event_data.json and CSV files (in "event json" and "static/attachments").
- External Services: Google Meet link validation and file upload features.

##### Relationships and Data Flow
- For the SQL version: Show how the Flask app interacts with the MySQL database and serves HTML pages.
- For the JSON version: Illustrate how the Flask app reads and writes JSON data and CSVs.
- User interactions (create event, view event list) flowing from the frontend to the backend and then to the database or file system.

##### Architectural Patterns
- MVC-like pattern: Separate templates (view), Flask routes (controller), and data (model via SQL or JSON).
- Maintain a clear separation between the two data handling strategies by indicating two separate pathways (one for MySQL, one for JSON).

##### Technology Stack
- Python with Flask for the web framework.
- MySQL as the primary database (for the SQL version) and JSON/CSV files for the alternate version.
- HTML, CSS, and optionally Bootstrap for the UI.
- Git for version control.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["User Browser (UI)"]:::frontend

    subgraph "SQL Version"
        direction TB
        SQL_Frontend["Frontend (SQL Templates)"]:::frontend
        SQL_Backend["Flask App – SQL"]:::backend
        MySQLDB["MySQL Database"]:::database
    end

    subgraph "JSON Version"
        direction TB
        JSON_Templates["Frontend Templates (JSON)"]:::frontend
        JSON_CSS["CSS Styling (JSON)"]:::frontend
        JSON_Backend["Flask App – JSON"]:::backend
        JSON_Data["JSON & CSV Data Files"]:::database
    end

    External["External Services (GoogleMeet & FileUpload)"]:::external

    %% Connections for SQL Version
    Browser -->|"selects"| SQL_Frontend
    SQL_Frontend -->|"handles request"| SQL_Backend
    SQL_Backend -->|"queries/inserts"| MySQLDB
    SQL_Backend -->|"validates & uploads"| External

    %% Connections for JSON Version
    Browser -->|"selects"| JSON_Templates
    Browser -->|"loads"| JSON_CSS
    JSON_Templates -->|"renders"| JSON_Backend
    JSON_CSS -->|"styles"| JSON_Backend
    JSON_Backend -->|"reads/writes"| JSON_Data
    JSON_Backend -->|"validates & uploads"| External

    %% Click Events
    click SQL_Frontend "https://github.com/ayushi544/event-management/tree/main/events sql/templates"
    click SQL_Backend "https://github.com/ayushi544/event-management/blob/main/events sql/app.py"
    click MySQLDB "https://github.com/ayushi544/event-management/tree/main/events sql"
    click JSON_Templates "https://github.com/ayushi544/event-management/tree/main/event json/templates"
    click JSON_CSS "https://github.com/ayushi544/event-management/blob/main/event json/static/events_json.css"
    click JSON_Backend "https://github.com/ayushi544/event-management/blob/main/json_app.py"
    click JSON_Data "https://github.com/ayushi544/event-management/blob/main/event json/event_data.json"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef backend fill:#98FB98,stroke:#000,stroke-width:1px;
    classDef database fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef external fill:#FFB6C1,stroke:#000,stroke-width:1px;
```
