# saisreejakasireddy/votehub architecture

> Architecture diagram of the GitHub repository saisreejakasireddy/votehub, 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/saisreejakasireddy/votehub
- Repository: https://github.com/saisreejakasireddy/votehub

## Overview

VoteHub is a Flask-based college-club voting platform. Students register and sign in, discover or join clubs, then participate in club elections; admins manage clubs, membership, nominees, and voting schedules, while users can view results. The product is concentrated in a single Flask module, with browser scripts providing API-driven screens and SQLite storing application data. The README documents capabilities beyond the sampled backend excerpts; where route-level implementation was not shown, relationships are limited to documented API use.

Main entry points: [`votehub/app.py`](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py) (Routes and workflows), [`votehub/database.db`](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/database.db) (SQLite application data), [`votehub/static/js/login.js`](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/login.js) (Account screens), [`votehub/static/js/results.js`](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/results.js) (Results chart)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser experience"]
  node_account_ui["Account screens<br/>[login.js]"]
  node_registration_ui["Registration screen<br/>[register.js]"]
  node_shared_js["Shared session logic<br/>[main.js]"]
  node_dashboard_ui["Role dashboards<br/>[dashboard.js]"]
  node_club_ui["Club browser<br/>[clubs.js]"]
  node_poll_ui["Poll creation and voting<br/>[polls.js]"]
  node_results_ui["Results chart<br/>[results.js]"]
  node_templates["Page templates"]
end

subgraph group_backend["Flask application"]
  node_flask["Routes and workflows<br/>[app.py]"]
  node_auth["Authentication and roles<br/>[app.py]"]
  node_database[("SQLite application data<br/>[database.db]")]
  node_config["Runtime configuration<br/>[config.py]"]
end

subgraph group_governance["Club administration"]
  node_club_admin["Club and member management<br/>[app.py]"]
  node_nominees["Nominee management<br/>[app.py]"]
  node_schedule["Voting schedule<br/>[app.py]"]
  node_membership["Club membership<br/>[app.py]"]
end

subgraph group_elections["Voting and results"]
  node_election["Election and vote recording<br/>[app.py]"]
  node_credentials["Voting credentials<br/>[app.py]"]
  node_results["Result calculation and views<br/>[app.py]"]
end

node_student(("Student"))
node_admin(("Platform or club admin"))

node_student -->|"registers through"| node_registration_ui
node_student -->|"signs in through"| node_account_ui
node_admin -->|"signs in through"| node_account_ui
node_account_ui -->|"requests login"| node_auth
node_registration_ui -->|"requests registration"| node_auth
node_auth -->|"reads and writes"| node_database
node_flask -->|"loads"| node_config
node_flask -->|"opens SQLite"| node_database
node_dashboard_ui -->|"fetches club data"| node_flask
node_club_ui -->|"lists and joins"| node_flask
node_poll_ui -->|"creates and votes"| node_flask
node_results_ui -->|"requests results"| node_flask
node_shared_js -->|"stores session for"| node_account_ui
node_flask -.->|"renders pages"| node_templates
node_admin -->|"manages clubs"| node_club_admin
node_admin -->|"manages nominees"| node_nominees
node_admin -->|"sets voting times"| node_schedule
node_club_admin -->|"stores club changes"| node_database
node_admin -->|"assigns members"| node_membership
node_membership -->|"creates credentials"| node_credentials
node_student -->|"casts vote"| node_election
node_election -->|"checks and marks"| node_credentials
node_election -->|"records vote"| node_database
node_student -->|"views results"| node_results_ui
node_results_ui -->|"displays chart data"| node_results
node_results -.->|"reads vote totals"| node_database

click node_account_ui "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/login.js"
click node_registration_ui "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/register.js"
click node_shared_js "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/main.js"
click node_dashboard_ui "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/dashboard.js"
click node_club_ui "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/clubs.js"
click node_poll_ui "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/polls.js"
click node_results_ui "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/results.js"
click node_templates "https://github.com/saisreejakasireddy/votehub/tree/master/votehub/templates"
click node_flask "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py"
click node_auth "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py"
click node_database "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/database.db"
click node_club_admin "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py"
click node_nominees "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py"
click node_schedule "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py"
click node_membership "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py"
click node_election "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py"
click node_credentials "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py"
click node_results "https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py"
click node_config "https://github.com/saisreejakasireddy/votehub/blob/master/config.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_account_ui,node_registration_ui,node_shared_js,node_dashboard_ui,node_club_ui,node_poll_ui,node_results_ui,node_templates toneBlue
class node_flask,node_auth,node_database,node_config toneAmber
class node_club_admin,node_nominees,node_schedule,node_membership toneMint
class node_election,node_credentials,node_results toneRose
class node_student,node_admin toneIndigo
```

## Components

### Browser experience

- [Account screens](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/login.js): `votehub/static/js/login.js`
- [Registration screen](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/register.js): `votehub/static/js/register.js`
- [Shared session logic](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/main.js): `votehub/static/js/main.js`
- [Role dashboards](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/dashboard.js): `votehub/static/js/dashboard.js`
- [Club browser](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/clubs.js): `votehub/static/js/clubs.js`
- [Poll creation and voting](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/polls.js): `votehub/static/js/polls.js`
- [Results chart](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/static/js/results.js): `votehub/static/js/results.js`
- [Page templates](https://github.com/saisreejakasireddy/votehub/tree/master/votehub/templates): `votehub/templates`

### Flask application

- [Routes and workflows](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py): `votehub/app.py`
- [Authentication and roles](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py): `votehub/app.py`
- [SQLite application data](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/database.db): `votehub/database.db`
- [Runtime configuration](https://github.com/saisreejakasireddy/votehub/blob/master/config.py): `config.py`

### Club administration

- [Club and member management](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py): `votehub/app.py`
- [Nominee management](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py): `votehub/app.py`
- [Voting schedule](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py): `votehub/app.py`
- [Club membership](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py): `votehub/app.py`

### Voting and results

- [Election and vote recording](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py): `votehub/app.py`
- [Voting credentials](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py): `votehub/app.py`
- [Result calculation and views](https://github.com/saisreejakasireddy/votehub/blob/master/votehub/app.py): `votehub/app.py`

### Other components

- **Student**
- **Platform or club admin**

## Connections

- Student → Registration screen: registers through (evidence: `README.md`)
- Student → Account screens: signs in through (evidence: `README.md`)
- Platform or club admin → Account screens: signs in through (evidence: `README.md`)
- Account screens → Authentication and roles: requests login (evidence: `votehub/static/js/login.js`)
- Registration screen → Authentication and roles: requests registration (evidence: `votehub/static/js/register.js`)
- Authentication and roles → SQLite application data: reads and writes (evidence: `votehub/app.py`)
- Routes and workflows → Runtime configuration: loads (evidence: `votehub/app.py`)
- Routes and workflows → SQLite application data: opens SQLite (evidence: `votehub/app.py`)
- Role dashboards → Routes and workflows: fetches club data (evidence: `votehub/static/js/dashboard.js`)
- Club browser → Routes and workflows: lists and joins (evidence: `votehub/static/js/clubs.js`)
- Poll creation and voting → Routes and workflows: creates and votes (evidence: `votehub/static/js/polls.js`)
- Results chart → Routes and workflows: requests results (evidence: `votehub/static/js/results.js`)
- Shared session logic → Account screens: stores session for (evidence: `votehub/static/js/login.js`)
- Routes and workflows → Page templates: renders pages
- Platform or club admin → Club and member management: manages clubs (evidence: `README.md`)
- Platform or club admin → Nominee management: manages nominees (evidence: `README.md`)
- Platform or club admin → Voting schedule: sets voting times (evidence: `votehub/app.py`)
- Club and member management → SQLite application data: stores club changes (evidence: `votehub/app.py`)
- Platform or club admin → Club membership: assigns members (evidence: `votehub/app.py`)
- Club membership → Voting credentials: creates credentials (evidence: `votehub/app.py`)
- Student → Election and vote recording: casts vote (evidence: `README.md`)
- Election and vote recording → Voting credentials: checks and marks (evidence: `votehub/app.py`)
- Election and vote recording → SQLite application data: records vote (evidence: `votehub/app.py`)
- Student → Results chart: views results (evidence: `README.md`)
- Results chart → Result calculation and views: displays chart data (evidence: `votehub/static/js/results.js`)
- Result calculation and views → SQLite application data: reads vote totals
