# ambalavanan-m/e-voting-using-blockchain architecture

> Architecture diagram of the GitHub repository ambalavanan-m/e-voting-using-blockchain, 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/ambalavanan-m/e-voting-using-blockchain
- Repository: https://github.com/ambalavanan-m/e-voting-using-blockchain

## Overview

This is a browser-based e-voting simulation. The documented user journey begins with language and jurisdiction selection, proceeds through citizen login and simulated identity checks, then reaches a wallet-connected voting interface for casting and checking results. The README also describes bilingual UI, visual identity confirmation, contract-address setup, and live result visualization. Most HTML pages were not sampled, so links between stages below rely on README descriptions; the sampled notification utility has no indexed references to other files.

Main entry points: [`voting.html`](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/voting.html) (Voting Interface), [`index.html`](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/index.html) (Language and Jurisdiction), [`blockchaincontract.html`](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/blockchaincontract.html) (Contract Setup), [`login.html`](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/login.html) (Citizen Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Setup"]
  node_entry["Language and Jurisdiction<br/>[index.html]"]
  node_contract_setup["Contract Setup"]
end

subgraph group_identity["Identity Verification"]
  node_login["Citizen Login<br/>[login.html]"]
  node_otp["OTP Check<br/>[otp.html]"]
  node_aadhaar["Aadhaar Check<br/>[aadhaar.html]"]
  node_aadhaar_image["Aadhaar Confirmation<br/>[aadhaar-image.html]"]
  node_voter_image["Voter ID Confirmation"]
  node_voter_number["Voter ID Number"]
end

subgraph group_vote["Voting and Results"]
  node_voting["Voting Interface<br/>[voting.html]"]
  node_results["Live Results<br/>[voting.html]"]
end

subgraph group_shared["Shared UI"]
  node_notifications["Toast Notifications<br/>[notifications.js]"]
  node_styles["Responsive Styling<br/>[style.css]"]
end

node_citizen(("Citizen"))
node_wallet["MetaMask Wallet"]
node_contract{{"Voting Contract"}}

node_citizen -->|"starts at"| node_entry
node_entry -->|"continues to"| node_login
node_login -->|"begins authentication"| node_otp
node_otp -->|"continues verification"| node_aadhaar
node_aadhaar -->|"confirms identity"| node_aadhaar_image
node_aadhaar_image -->|"shows identity documents"| node_voter_image
node_citizen -->|"provides address"| node_contract_setup
node_contract_setup -->|"configures address"| node_contract
node_citizen -->|"casts vote"| node_voting
node_voting -->|"connects wallet"| node_wallet
node_voting -->|"casts and verifies votes"| node_contract
node_contract -->|"supplies vote counts"| node_results
node_voting -->|"visualizes results"| node_results

click node_entry "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/index.html"
click node_login "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/login.html"
click node_otp "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/otp.html"
click node_aadhaar "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/aadhaar.html"
click node_aadhaar_image "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/aadhaar-image.html"
click node_voter_image "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/voter-id-image.html"
click node_voter_number "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/voter-id-number.html"
click node_contract_setup "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/blockchaincontract.html"
click node_voting "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/voting.html"
click node_results "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/voting.html"
click node_notifications "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/notifications.js"
click node_styles "https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/style.css"

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_entry,node_contract_setup toneBlue
class node_login,node_otp,node_aadhaar,node_aadhaar_image,node_voter_image,node_voter_number toneAmber
class node_voting,node_results toneMint
class node_notifications,node_styles toneRose
class node_citizen,node_wallet,node_contract toneIndigo
```

## Components

### Entry and Setup

- [Language and Jurisdiction](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/index.html): `index.html`
- [Contract Setup](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/blockchaincontract.html): `blockchaincontract.html`

### Identity Verification

- [Citizen Login](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/login.html): `login.html`
- [OTP Check](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/otp.html): `otp.html`
- [Aadhaar Check](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/aadhaar.html): `aadhaar.html`
- [Aadhaar Confirmation](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/aadhaar-image.html): `aadhaar-image.html`
- [Voter ID Confirmation](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/voter-id-image.html): `voter-id-image.html`
- [Voter ID Number](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/voter-id-number.html): `voter-id-number.html`

### Voting and Results

- [Voting Interface](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/voting.html): `voting.html`
- [Live Results](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/voting.html): `voting.html`

### Shared UI

- [Toast Notifications](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/notifications.js): `notifications.js`
- [Responsive Styling](https://github.com/ambalavanan-m/e-voting-using-blockchain/blob/main/style.css): `style.css`

### Other components

- **Citizen**
- **MetaMask Wallet**
- **Voting Contract**

## Connections

- Citizen → Language and Jurisdiction: starts at (evidence: `README.md`)
- Language and Jurisdiction → Citizen Login: continues to (evidence: `README.md`)
- Citizen Login → OTP Check: begins authentication (evidence: `README.md`)
- OTP Check → Aadhaar Check: continues verification (evidence: `README.md`)
- Aadhaar Check → Aadhaar Confirmation: confirms identity (evidence: `README.md`)
- Aadhaar Confirmation → Voter ID Confirmation: shows identity documents (evidence: `README.md`)
- Citizen → Contract Setup: provides address (evidence: `README.md`)
- Contract Setup → Voting Contract: configures address (evidence: `README.md`)
- Citizen → Voting Interface: casts vote (evidence: `README.md`)
- Voting Interface → MetaMask Wallet: connects wallet (evidence: `README.md`)
- Voting Interface → Voting Contract: casts and verifies votes (evidence: `README.md`)
- Voting Contract → Live Results: supplies vote counts (evidence: `README.md`)
- Voting Interface → Live Results: visualizes results (evidence: `README.md`)
