# cs196illinois/fa26-mp-codebases-eventflow architecture

> Architecture diagram of the GitHub repository cs196illinois/fa26-mp-codebases-eventflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cs196illinois/fa26-mp-codebases-eventflow
- Repository: https://github.com/cs196illinois/fa26-mp-codebases-eventflow

## Overview

EventFlow is a Flask-backed campus-events site. Users browse scraped UIUC events, search/filter them, and add selected or manually entered events to a shared Google Calendar. A separate import workflow extracts events from pasted text or Outlook emails using an AI model, then presents them for calendar addition. The scraper publishes event data to Firebase, which the browser reads. Evidence is limited to the README and supplied source excerpts; undocumented wiring is omitted.

Main entry points: [`Project/app.py`](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/app.py) (Flask app and API), [`Project/static/script.js`](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/static/script.js) (Event forms and cards), [`Project/templates/index.html`](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/templates/index.html) (EventFlow page), [`Project/static/browse-events.js`](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/static/browse-events.js) (Browse and search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Event collection"]
  node_scraper["UIUC scraper<br/>[scrape.py]"]
  node_firebase[("Firebase events")]
end

subgraph group_web["Website and browsing"]
  node_flask["Flask app and API<br/>[app.py]"]
  node_webpage["EventFlow page<br/>[index.html]"]
  node_browse["Browse and search<br/>[browse-events.js]"]
  node_ui["Event forms and cards<br/>[script.js]"]
end

subgraph group_imports["Event imports"]
  node_email_fetch["Outlook email fetch<br/>[parse_email.py]"]
  node_ai_parse["AI event extraction<br/>[parse_email.py]"]
  node_openrouter{{"OpenRouter AI"}}
  node_outlook{{"Microsoft Graph"}}
end

subgraph group_calendar["Shared calendar"]
  node_calendar_ui["Calendar connection"]
  node_calendar_api["Calendar event API<br/>[app.py]"]
  node_google_calendar[("Google Calendar")]
end

node_user(("Campus visitor"))

node_user -->|"opens"| node_webpage
node_webpage -->|"requests page"| node_flask
node_scraper -->|"writes events"| node_firebase
node_browse -->|"reads events"| node_firebase
node_browse -->|"uses cards"| node_ui
node_webpage -.->|"loads browser"| node_browse
node_webpage -.->|"loads interface"| node_ui
node_user -->|"enters event"| node_ui
node_ui -->|"submits text"| node_flask
node_flask -->|"parses text"| node_ai_parse
node_flask -->|"fetches emails"| node_email_fetch
node_email_fetch -->|"fetches messages"| node_outlook
node_flask -->|"parses email content"| node_ai_parse
node_ai_parse -->|"requests extraction"| node_openrouter
node_ui -->|"adds event"| node_calendar_ui
node_browse -->|"adds event"| node_calendar_ui
node_calendar_ui -->|"posts event"| node_flask
node_flask -->|"creates event"| node_google_calendar
node_calendar_ui -->|"embeds calendar"| node_google_calendar

click node_scraper "https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/web_scraper/scrape.py"
click node_flask "https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/app.py"
click node_webpage "https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/templates/index.html"
click node_browse "https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/static/browse-events.js"
click node_ui "https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/static/script.js"
click node_email_fetch "https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/email_parser/parse_email.py"
click node_ai_parse "https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/email_parser/parse_email.py"
click node_calendar_ui "https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/static/calendar-connect.js"
click node_calendar_api "https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_scraper,node_firebase toneBlue
class node_flask,node_webpage,node_browse,node_ui toneAmber
class node_email_fetch,node_ai_parse,node_openrouter,node_outlook toneMint
class node_calendar_ui,node_calendar_api,node_google_calendar toneRose
class node_user toneIndigo
```

## Components

### Event collection

- [UIUC scraper](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/web_scraper/scrape.py): `Project/web_scraper/scrape.py`
- **Firebase events**

### Website and browsing

- [Flask app and API](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/app.py): `Project/app.py`
- [EventFlow page](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/templates/index.html): `Project/templates/index.html`
- [Browse and search](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/static/browse-events.js): `Project/static/browse-events.js`
- [Event forms and cards](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/static/script.js): `Project/static/script.js`

### Event imports

- [Outlook email fetch](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/email_parser/parse_email.py): `Project/email_parser/parse_email.py`
- [AI event extraction](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/email_parser/parse_email.py): `Project/email_parser/parse_email.py`
- **OpenRouter AI**
- **Microsoft Graph**

### Shared calendar

- [Calendar connection](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/static/calendar-connect.js): `Project/static/calendar-connect.js`
- [Calendar event API](https://github.com/cs196illinois/fa26-mp-codebases-eventflow/blob/main/Project/app.py): `Project/app.py`
- **Google Calendar**

### Other components

- **Campus visitor**

## Connections

- Campus visitor → EventFlow page: opens (evidence: `README.md`)
- EventFlow page → Flask app and API: requests page (evidence: `README.md`)
- UIUC scraper → Firebase events: writes events (evidence: `Project/web_scraper/scrape.py`)
- Browse and search → Firebase events: reads events (evidence: `Project/static/browse-events.js`)
- Browse and search → Event forms and cards: uses cards (evidence: `Project/static/browse-events.js`)
- EventFlow page → Browse and search: loads browser
- EventFlow page → Event forms and cards: loads interface
- Campus visitor → Event forms and cards: enters event (evidence: `README.md`)
- Event forms and cards → Flask app and API: submits text (evidence: `Project/app.py`)
- Flask app and API → AI event extraction: parses text (evidence: `Project/app.py`)
- Flask app and API → Outlook email fetch: fetches emails (evidence: `Project/app.py`)
- Outlook email fetch → Microsoft Graph: fetches messages (evidence: `Project/email_parser/parse_email.py`)
- Flask app and API → AI event extraction: parses email content (evidence: `Project/app.py`)
- AI event extraction → OpenRouter AI: requests extraction (evidence: `Project/email_parser/parse_email.py`)
- Event forms and cards → Calendar connection: adds event (evidence: `Project/static/script.js`)
- Browse and search → Calendar connection: adds event (evidence: `Project/static/browse-events.js`)
- Calendar connection → Flask app and API: posts event (evidence: `Project/static/calendar-connect.js`)
- Flask app and API → Google Calendar: creates event (evidence: `Project/app.py`)
- Calendar connection → Google Calendar: embeds calendar (evidence: `Project/static/calendar-connect.js`)
