# hussain-reddy/onlinevotingsystem architecture

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

- Interactive diagram: https://gitdiagram.com/hussain-reddy/onlinevotingsystem
- Repository: https://github.com/hussain-reddy/onlinevotingsystem

## Overview

This is a Flask online voting application. Voters register or log in, view candidates, submit one vote, and view vote totals. The main runtime is concentrated in app.py, which handles routes and SQLite access; templates provide the pages and a small JavaScript helper confirms vote submission. The README also advertises an admin dashboard, but the shown routes do not establish its implementation. The graph reflects the sampled source and documented capabilities; template internals were not inspected.

Main entry points: [`app.py`](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py) (Flask routes), [`templates/vote.html`](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/vote.html) (Voting page), [`templates/register.html`](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/register.html) (Registration page), [`templates/login.html`](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/login.html) (Login page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_routes["Flask routes<br/>[app.py]"]
  node_registration["Registration page<br/>[register.html]"]
  node_login["Login page<br/>[login.html]"]
  node_vote_page["Voting page<br/>[vote.html]"]
  node_vote_confirm["Vote confirmation<br/>[script.js]"]
  node_results_page["Results page<br/>[results.html]"]
end

subgraph group_voting["Voting workflow"]
  node_account["Account access<br/>[app.py]"]
  node_cast_vote["Vote submission<br/>[app.py]"]
  node_results["Results aggregation<br/>[app.py]"]
  node_admin["Admin dashboard<br/>[app.py]"]
end

subgraph group_data["Application data"]
  node_voting_db[("SQLite voting data<br/>[app.py]")]
end

node_voter(("Voter"))

node_voter -->|"uses routes"| node_routes
node_routes -->|"renders"| node_registration
node_routes -->|"renders"| node_login
node_routes -->|"renders"| node_vote_page
node_routes -->|"renders"| node_results_page
node_vote_page -.->|"confirms vote"| node_vote_confirm
node_routes -->|"handles access"| node_account
node_routes -->|"handles submission"| node_cast_vote
node_routes -->|"loads results"| node_results
node_account -->|"reads and writes"| node_voting_db
node_cast_vote -->|"reads and updates"| node_voting_db
node_results -->|"reads totals"| node_voting_db
node_routes -.->|"advertises capability"| node_admin

click node_routes "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py"
click node_registration "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/register.html"
click node_login "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/login.html"
click node_vote_page "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/vote.html"
click node_vote_confirm "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/static/script.js"
click node_results_page "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/results.html"
click node_account "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py"
click node_cast_vote "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py"
click node_results "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py"
click node_admin "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py"
click node_voting_db "https://github.com/hussain-reddy/onlinevotingsystem/blob/main/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_routes,node_registration,node_login,node_vote_page,node_vote_confirm,node_results_page toneBlue
class node_account,node_cast_vote,node_results,node_admin toneAmber
class node_voting_db toneMint
class node_voter toneIndigo
```

## Components

### Web interface

- [Flask routes](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py): `app.py`
- [Registration page](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/register.html): `templates/register.html`
- [Login page](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/login.html): `templates/login.html`
- [Voting page](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/vote.html): `templates/vote.html`
- [Vote confirmation](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/static/script.js): `static/script.js`
- [Results page](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/templates/results.html): `templates/results.html`

### Voting workflow

- [Account access](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py): `app.py`
- [Vote submission](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py): `app.py`
- [Results aggregation](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py): `app.py`
- [Admin dashboard](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py): `app.py`

### Application data

- [SQLite voting data](https://github.com/hussain-reddy/onlinevotingsystem/blob/main/app.py): `app.py`

### Other components

- **Voter**

## Connections

- Voter → Flask routes: uses routes (evidence: `app.py`)
- Flask routes → Registration page: renders (evidence: `app.py`)
- Flask routes → Login page: renders (evidence: `app.py`)
- Flask routes → Voting page: renders (evidence: `app.py`)
- Flask routes → Results page: renders (evidence: `app.py`)
- Voting page → Vote confirmation: confirms vote
- Flask routes → Account access: handles access (evidence: `app.py`)
- Flask routes → Vote submission: handles submission (evidence: `app.py`)
- Flask routes → Results aggregation: loads results (evidence: `app.py`)
- Account access → SQLite voting data: reads and writes (evidence: `app.py`)
- Vote submission → SQLite voting data: reads and updates (evidence: `app.py`)
- Results aggregation → SQLite voting data: reads totals (evidence: `app.py`)
- Flask routes → Admin dashboard: advertises capability (evidence: `README.md`)
