# yogesh-sav/eventhub architecture

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

- Interactive diagram: https://gitdiagram.com/yogesh-sav/eventhub
- Repository: https://github.com/yogesh-sav/eventhub

## Overview

EventHub is a Django event-discovery and ticket-booking product. Users browse upcoming events, inspect details, save events or book tickets; organizers manage listings and review performance. Accounts and event data provide the core domain, while interaction history supports recommendations and a separate popularity model supports prediction and reporting. The graph reflects the sampled views and model code plus SOURCE INDEX references; unsampled implementation details are represented only where those references establish a relationship.

Main entry points: [`events/models.py`](https://github.com/yogesh-sav/eventhub/blob/main/events/models.py) (Events and bookings), [`events/views.py`](https://github.com/yogesh-sav/eventhub/blob/main/events/views.py) (Event workflows), [`accounts/views.py`](https://github.com/yogesh-sav/eventhub/blob/main/accounts/views.py) (Account workflows), [`core/views.py`](https://github.com/yogesh-sav/eventhub/blob/main/core/views.py) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts"]
  node_accounts["Account workflows<br/>[views.py]"]
  node_profiles[("User profiles<br/>[models.py]")]
end

subgraph group_market["Event marketplace"]
  node_event_views["Event workflows<br/>[views.py]"]
  node_event_forms["Event forms<br/>[forms.py]"]
  node_event_domain[("Events and bookings<br/>[models.py]")]
  node_event_guard["Organizer access<br/>[decorators.py]"]
end

subgraph group_discovery["Discovery"]
  node_home["Home page<br/>[views.py]"]
  node_recommendations["Recommendations<br/>[services.py]"]
end

subgraph group_insights["Insights"]
  node_analytics["Analytics views<br/>[views.py]"]
  node_popularity_training["Popularity training"]
  node_popularity_prediction["Popularity prediction"]
  node_prediction_records[("Prediction records<br/>[models.py]")]
end

node_visitor(("Visitor"))

node_visitor -->|"uses"| node_accounts
node_visitor -->|"browses and books"| node_event_views
node_accounts -->|"manages"| node_profiles
node_accounts -->|"uses"| node_event_forms
node_event_views -->|"validates"| node_event_forms
node_event_views -->|"reads and updates"| node_event_domain
node_event_views -->|"checks access"| node_event_guard
node_event_views -.->|"uses organizer identity"| node_profiles
node_home -->|"loads upcoming events"| node_event_domain
node_home -->|"requests trending events"| node_recommendations
node_recommendations -->|"reads event activity"| node_event_domain
node_analytics -->|"aggregates activity"| node_event_domain
node_analytics -->|"reads predictions"| node_prediction_records
node_popularity_training -->|"builds training data"| node_event_domain
node_popularity_prediction -->|"loads event data"| node_event_domain
node_popularity_prediction -->|"records predictions"| node_prediction_records

click node_accounts "https://github.com/yogesh-sav/eventhub/blob/main/accounts/views.py"
click node_profiles "https://github.com/yogesh-sav/eventhub/blob/main/accounts/models.py"
click node_event_views "https://github.com/yogesh-sav/eventhub/blob/main/events/views.py"
click node_event_forms "https://github.com/yogesh-sav/eventhub/blob/main/events/forms.py"
click node_event_domain "https://github.com/yogesh-sav/eventhub/blob/main/events/models.py"
click node_event_guard "https://github.com/yogesh-sav/eventhub/blob/main/events/decorators.py"
click node_home "https://github.com/yogesh-sav/eventhub/blob/main/core/views.py"
click node_recommendations "https://github.com/yogesh-sav/eventhub/blob/main/recommendations/services.py"
click node_analytics "https://github.com/yogesh-sav/eventhub/blob/main/analytics/views.py"
click node_popularity_training "https://github.com/yogesh-sav/eventhub/blob/main/ml/management/commands/train_popularity_model.py"
click node_popularity_prediction "https://github.com/yogesh-sav/eventhub/blob/main/ml/management/commands/predict_popularity.py"
click node_prediction_records "https://github.com/yogesh-sav/eventhub/blob/main/ml/models.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_accounts,node_profiles toneBlue
class node_event_views,node_event_forms,node_event_domain,node_event_guard toneAmber
class node_home,node_recommendations toneMint
class node_analytics,node_popularity_training,node_popularity_prediction,node_prediction_records toneRose
class node_visitor toneIndigo
```

## Components

### Accounts

- [Account workflows](https://github.com/yogesh-sav/eventhub/blob/main/accounts/views.py): `accounts/views.py`
- [User profiles](https://github.com/yogesh-sav/eventhub/blob/main/accounts/models.py): `accounts/models.py`

### Event marketplace

- [Event workflows](https://github.com/yogesh-sav/eventhub/blob/main/events/views.py): `events/views.py`
- [Event forms](https://github.com/yogesh-sav/eventhub/blob/main/events/forms.py): `events/forms.py`
- [Events and bookings](https://github.com/yogesh-sav/eventhub/blob/main/events/models.py): `events/models.py`
- [Organizer access](https://github.com/yogesh-sav/eventhub/blob/main/events/decorators.py): `events/decorators.py`

### Discovery

- [Home page](https://github.com/yogesh-sav/eventhub/blob/main/core/views.py): `core/views.py`
- [Recommendations](https://github.com/yogesh-sav/eventhub/blob/main/recommendations/services.py): `recommendations/services.py`

### Insights

- [Analytics views](https://github.com/yogesh-sav/eventhub/blob/main/analytics/views.py): `analytics/views.py`
- [Popularity training](https://github.com/yogesh-sav/eventhub/blob/main/ml/management/commands/train_popularity_model.py): `ml/management/commands/train_popularity_model.py`
- [Popularity prediction](https://github.com/yogesh-sav/eventhub/blob/main/ml/management/commands/predict_popularity.py): `ml/management/commands/predict_popularity.py`
- [Prediction records](https://github.com/yogesh-sav/eventhub/blob/main/ml/models.py): `ml/models.py`

### Other components

- **Visitor**

## Connections

- Visitor → Account workflows: uses
- Visitor → Event workflows: browses and books
- Account workflows → User profiles: manages
- Account workflows → Event forms: uses
- Event workflows → Event forms: validates (evidence: `events/views.py`)
- Event workflows → Events and bookings: reads and updates (evidence: `events/views.py`)
- Event workflows → Organizer access: checks access (evidence: `events/views.py`)
- Event workflows → User profiles: uses organizer identity
- Home page → Events and bookings: loads upcoming events (evidence: `core/views.py`)
- Home page → Recommendations: requests trending events (evidence: `core/views.py`)
- Recommendations → Events and bookings: reads event activity (evidence: `recommendations/services.py`)
- Analytics views → Events and bookings: aggregates activity (evidence: `analytics/views.py`)
- Analytics views → Prediction records: reads predictions (evidence: `analytics/views.py`)
- Popularity training → Events and bookings: builds training data (evidence: `ml/management/commands/train_popularity_model.py`)
- Popularity prediction → Events and bookings: loads event data (evidence: `ml/management/commands/predict_popularity.py`)
- Popularity prediction → Prediction records: records predictions (evidence: `ml/management/commands/predict_popularity.py`)
