# sarthakavhad06/securevote architecture

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

- Interactive diagram: https://gitdiagram.com/sarthakavhad06/securevote
- Repository: https://github.com/sarthakavhad06/securevote

## Overview

SecureVote is a Flask voting interface backed by a Solidity contract on a local Ganache chain. Voters choose an unlocked wallet and candidate; Flask validates the request, submits a contract transaction, and reports its confirmation. The dashboard and JSON endpoints read vote totals, chain status, and VoteCast history from the chain. Deployment compiles and installs the contract. The README documents contract and interface capabilities; source excerpts show Flask routes and deployment behavior, but not the contract or template internals.

Main entry points: [`app.py`](https://github.com/sarthakavhad06/securevote/blob/main/app.py) (Flask routes), [`deploy.py`](https://github.com/sarthakavhad06/securevote/blob/main/deploy.py) (Contract deployer), [`contracts/Voting.sol`](https://github.com/sarthakavhad06/securevote/blob/main/contracts/Voting.sol) (Voting contract), [`templates/index.html`](https://github.com/sarthakavhad06/securevote/blob/main/templates/index.html) (Voting page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Voting interface"]
  node_page["Voting page<br/>[index.html]"]
  node_styles["Responsive styling<br/>[style.css]"]
end

subgraph group_backend["Flask application"]
  node_flask["Flask routes<br/>[app.py]"]
end

subgraph group_chain["Blockchain voting"]
  node_ganache[("Ganache node")]
  node_voting["Voting contract<br/>[Voting.sol]"]
end

subgraph group_deployment["Contract deployment"]
  node_deployer["Contract deployer<br/>[deploy.py]"]
end

node_voter(("Voter"))

node_voter -->|"submits vote"| node_flask
node_flask -->|"renders"| node_page
node_flask -->|"reads and submits"| node_ganache
node_flask -->|"queries and votes"| node_voting
node_deployer -->|"deploys to"| node_ganache
node_deployer -->|"compiles and deploys"| node_voting

click node_flask "https://github.com/sarthakavhad06/securevote/blob/main/app.py"
click node_page "https://github.com/sarthakavhad06/securevote/blob/main/templates/index.html"
click node_styles "https://github.com/sarthakavhad06/securevote/blob/main/static/style.css"
click node_voting "https://github.com/sarthakavhad06/securevote/blob/main/contracts/Voting.sol"
click node_deployer "https://github.com/sarthakavhad06/securevote/blob/main/deploy.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_page,node_styles toneBlue
class node_flask toneAmber
class node_ganache,node_voting toneMint
class node_deployer toneRose
class node_voter toneIndigo
```

## Components

### Voting interface

- [Voting page](https://github.com/sarthakavhad06/securevote/blob/main/templates/index.html): `templates/index.html`
- [Responsive styling](https://github.com/sarthakavhad06/securevote/blob/main/static/style.css): `static/style.css`

### Flask application

- [Flask routes](https://github.com/sarthakavhad06/securevote/blob/main/app.py): `app.py`

### Blockchain voting

- **Ganache node**
- [Voting contract](https://github.com/sarthakavhad06/securevote/blob/main/contracts/Voting.sol): `contracts/Voting.sol`

### Contract deployment

- [Contract deployer](https://github.com/sarthakavhad06/securevote/blob/main/deploy.py): `deploy.py`

### Other components

- **Voter**

## Connections

- Voter → Flask routes: submits vote (evidence: `README.md`)
- Flask routes → Voting page: renders (evidence: `app.py`)
- Flask routes → Ganache node: reads and submits (evidence: `app.py`)
- Flask routes → Voting contract: queries and votes (evidence: `README.md`)
- Contract deployer → Ganache node: deploys to (evidence: `README.md`)
- Contract deployer → Voting contract: compiles and deploys (evidence: `README.md`)
