# srisubhash011/voting-application architecture

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

- Interactive diagram: https://gitdiagram.com/srisubhash011/voting-application
- Repository: https://github.com/srisubhash011/voting-application

## Overview

This repository is a collection of five blockchain-oriented demonstrations: patient-record management, FIR registration, crime-scene OCR, and two voting implementations. In the healthcare and FIR React apps, a user connects a MetaMask wallet, reads or writes records, and may authorize a provider; the voting React app connects a wallet, checks voting status and eligibility, displays candidates, and submits a vote. The README documents OCR as a separate capability but does not establish integration with FIR. Source excerpts support the React-to-contract calls; other domain links are omitted where implementation evidence is unavailable.

Main entry points: [`React-Voting-Application/src/App.js`](https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/App.js) (Voting App), [`Blockchain-Healthcare/src/Healthcare.js`](https://github.com/srisubhash011/voting-application/blob/main/Blockchain-Healthcare/src/Healthcare.js) (Patient Records UI), [`fir/src/Healthcare.js`](https://github.com/srisubhash011/voting-application/blob/main/fir/src/Healthcare.js) (FIR Records UI), [`React-Voting-Application/src/Components/Login.jsx`](https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/Components/Login.jsx) (Wallet Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_health["Healthcare Records"]
  node_health_ui["Patient Records UI<br/>[Healthcare.js]"]
  node_health_entry["Healthcare App Entry<br/>[App.js]"]
  node_health_contract[("Healthcare Contract<br/>[Healthcare.sol]")]
end

subgraph group_fir["FIR Registration"]
  node_fir_ui["FIR Records UI<br/>[Healthcare.js]"]
  node_fir_entry["FIR App Entry<br/>[App.js]"]
  node_fir_contract[("FIR Contract<br/>[Healthcare.sol]")]
end

subgraph group_ocr["Crime Scene OCR"]
  node_ocr["OCR Recognition<br/>[vsss1.py]"]
  node_ocr_model["OCR Model<br/>[best.pt]"]
  node_yolo_model["YOLO Model<br/>[yolov9c.pt]"]
end

subgraph group_voting["Decentralized Voting"]
  node_voting_app["Voting App<br/>[App.js]"]
  node_login["Wallet Login<br/>[Login.jsx]"]
  node_connected["Voting Dashboard<br/>[Connected.jsx]"]
  node_finished["Finished View<br/>[Finished.jsx]"]
  node_voting_config["Contract ABI Config<br/>[constant.js]"]
  node_voting_contract[("Voting Contract<br/>[Voting.sol]")]
  node_standalone_voting["Standalone Voting App<br/>[main.js]"]
  node_standalone_contract[("Standalone Voting Contract<br/>[Voting.sol]")]
end

node_user(("User"))
node_metamask["MetaMask Wallet"]
node_crime_scene(("Crime Scene"))
node_voter(("Voter"))

node_user -->|"manages records"| node_health_ui
node_health_ui -->|"requests account"| node_metamask
node_health_ui -->|"reads and writes"| node_health_contract
node_health_entry -->|"renders"| node_health_ui
node_user -->|"registers FIR"| node_fir_ui
node_fir_ui -->|"requests account"| node_metamask
node_fir_ui -->|"reads and writes"| node_fir_contract
node_fir_entry -->|"renders"| node_fir_ui
node_crime_scene -.->|"provides scene"| node_ocr
node_voter -->|"starts session"| node_login
node_login -->|"requests connection"| node_voting_app
node_voting_app -->|"requests account"| node_metamask
node_voting_app -->|"loads ABI and address"| node_voting_config
node_voting_app -->|"queries and submits votes"| node_voting_contract
node_voting_app -->|"renders when connected"| node_connected
node_voting_app -->|"renders after voting"| node_finished
node_connected -->|"submits vote input"| node_voting_app

click node_health_ui "https://github.com/srisubhash011/voting-application/blob/main/Blockchain-Healthcare/src/Healthcare.js"
click node_health_entry "https://github.com/srisubhash011/voting-application/blob/main/Blockchain-Healthcare/src/App.js"
click node_health_contract "https://github.com/srisubhash011/voting-application/blob/main/Blockchain-Healthcare/Healthcare.sol"
click node_fir_ui "https://github.com/srisubhash011/voting-application/blob/main/fir/src/Healthcare.js"
click node_fir_entry "https://github.com/srisubhash011/voting-application/blob/main/fir/src/App.js"
click node_fir_contract "https://github.com/srisubhash011/voting-application/blob/main/fir/Healthcare.sol"
click node_ocr "https://github.com/srisubhash011/voting-application/blob/main/ocr%20integration%20with%20blockchain/vsss1.py"
click node_ocr_model "https://github.com/srisubhash011/voting-application/blob/main/ocr%20integration%20with%20blockchain/best.pt"
click node_yolo_model "https://github.com/srisubhash011/voting-application/blob/main/ocr%20integration%20with%20blockchain/yolov9c.pt"
click node_voting_app "https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/App.js"
click node_login "https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/Components/Login.jsx"
click node_connected "https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/Components/Connected.jsx"
click node_finished "https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/Components/Finished.jsx"
click node_voting_config "https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/Constant/constant.js"
click node_voting_contract "https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/contracts/Voting.sol"
click node_standalone_voting "https://github.com/srisubhash011/voting-application/blob/main/voting%20appliaction/main.js"
click node_standalone_contract "https://github.com/srisubhash011/voting-application/blob/main/voting%20appliaction/contracts/Voting.sol"

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_health_ui,node_health_entry,node_health_contract,node_user toneBlue
class node_fir_ui,node_fir_entry,node_fir_contract toneAmber
class node_ocr,node_ocr_model,node_yolo_model toneMint
class node_voting_app,node_login,node_connected,node_finished,node_voting_config,node_voting_contract,node_standalone_voting,node_standalone_contract toneRose
class node_metamask,node_crime_scene,node_voter toneIndigo
```

## Components

### Healthcare Records

- [Patient Records UI](https://github.com/srisubhash011/voting-application/blob/main/Blockchain-Healthcare/src/Healthcare.js): `Blockchain-Healthcare/src/Healthcare.js`
- [Healthcare App Entry](https://github.com/srisubhash011/voting-application/blob/main/Blockchain-Healthcare/src/App.js): `Blockchain-Healthcare/src/App.js`
- [Healthcare Contract](https://github.com/srisubhash011/voting-application/blob/main/Blockchain-Healthcare/Healthcare.sol): `Blockchain-Healthcare/Healthcare.sol`

### FIR Registration

- [FIR Records UI](https://github.com/srisubhash011/voting-application/blob/main/fir/src/Healthcare.js): `fir/src/Healthcare.js`
- [FIR App Entry](https://github.com/srisubhash011/voting-application/blob/main/fir/src/App.js): `fir/src/App.js`
- [FIR Contract](https://github.com/srisubhash011/voting-application/blob/main/fir/Healthcare.sol): `fir/Healthcare.sol`

### Crime Scene OCR

- [OCR Recognition](https://github.com/srisubhash011/voting-application/blob/main/ocr%20integration%20with%20blockchain/vsss1.py): `ocr integration with blockchain/vsss1.py`
- [OCR Model](https://github.com/srisubhash011/voting-application/blob/main/ocr%20integration%20with%20blockchain/best.pt): `ocr integration with blockchain/best.pt`
- [YOLO Model](https://github.com/srisubhash011/voting-application/blob/main/ocr%20integration%20with%20blockchain/yolov9c.pt): `ocr integration with blockchain/yolov9c.pt`

### Decentralized Voting

- [Voting App](https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/App.js): `React-Voting-Application/src/App.js`
- [Wallet Login](https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/Components/Login.jsx): `React-Voting-Application/src/Components/Login.jsx`
- [Voting Dashboard](https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/Components/Connected.jsx): `React-Voting-Application/src/Components/Connected.jsx`
- [Finished View](https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/Components/Finished.jsx): `React-Voting-Application/src/Components/Finished.jsx`
- [Contract ABI Config](https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/src/Constant/constant.js): `React-Voting-Application/src/Constant/constant.js`
- [Voting Contract](https://github.com/srisubhash011/voting-application/blob/main/React-Voting-Application/contracts/Voting.sol): `React-Voting-Application/contracts/Voting.sol`
- [Standalone Voting App](https://github.com/srisubhash011/voting-application/blob/main/voting%20appliaction/main.js): `voting appliaction/main.js`
- [Standalone Voting Contract](https://github.com/srisubhash011/voting-application/blob/main/voting%20appliaction/contracts/Voting.sol): `voting appliaction/contracts/Voting.sol`

### Other components

- **User**
- **MetaMask Wallet**
- **Crime Scene**
- **Voter**

## Connections

- User → Patient Records UI: manages records
- Patient Records UI → MetaMask Wallet: requests account (evidence: `Blockchain-Healthcare/src/Healthcare.js`)
- Patient Records UI → Healthcare Contract: reads and writes (evidence: `Blockchain-Healthcare/src/Healthcare.js`)
- Healthcare App Entry → Patient Records UI: renders (evidence: `Blockchain-Healthcare/src/App.js`)
- User → FIR Records UI: registers FIR
- FIR Records UI → MetaMask Wallet: requests account (evidence: `fir/src/Healthcare.js`)
- FIR Records UI → FIR Contract: reads and writes (evidence: `fir/src/Healthcare.js`)
- FIR App Entry → FIR Records UI: renders (evidence: `fir/src/App.js`)
- Crime Scene → OCR Recognition: provides scene (evidence: `README.md`)
- Voter → Wallet Login: starts session (evidence: `React-Voting-Application/src/Components/Login.jsx`)
- Wallet Login → Voting App: requests connection (evidence: `React-Voting-Application/src/App.js`)
- Voting App → MetaMask Wallet: requests account (evidence: `React-Voting-Application/src/App.js`)
- Voting App → Contract ABI Config: loads ABI and address (evidence: `React-Voting-Application/src/App.js`)
- Voting App → Voting Contract: queries and submits votes (evidence: `React-Voting-Application/src/App.js`)
- Voting App → Voting Dashboard: renders when connected (evidence: `React-Voting-Application/src/App.js`)
- Voting App → Finished View: renders after voting (evidence: `React-Voting-Application/src/App.js`)
- Voting Dashboard → Voting App: submits vote input (evidence: `React-Voting-Application/src/Components/Connected.jsx`)
