How zodiadevias/blockchain-based-voting-system works
Project Type and Purpose
• BlockVote is primarily a full-stack decentralized application (DApp) built using Angular for the frontend. It integrates with blockchain smart contracts (managed via Truffle) to handle voting operations in a decentralized manner.
• The Angular portion of the project manages user interactions across several components (authentication, candidate listing, voting interfaces, dashboards, profiles, and results). The smart contract components manage the on-chain voting logic, candidate registration, and state migration (via migrations and Truffle configurations).
Project File Structure
• Top-level files and directories indicate both Angular frontend and a smart contract backend:
• The "src" directory contains various Angular components (auth, candidates, dashboard, header, profile, results, vote) and configuration files that make up the client-side application.
• The "contract" directory contains subdirectories with the Solidity smart contracts, Truffle migration scripts, and test files. This confirms a blockchain component in the system.
• Presence of configuration files such as angular.json, truffle-config.js, package.json, and tsconfig files indicate standard Angular and blockchain development practices.
• The contracts folder within "contract" and the associated deployment/migration files indicate that the blockchain portion is central to the vote recording and verification.
Key Project Components to Capture in the DFD
a. Client/User Interface:
• Angular Frontend: Represents the entire Angular application (including components like auth, candidates, vote, results, etc.)
• User Agent (Browser): The end user interacts with the application via a web browser.
b. Business Logic / Service Layer:
• Blockchain Service (blockchain.service.ts): Acts as an intermediary between the UI and the blockchain network. This service is responsible for interacting with the smart contracts.
c. Blockchain (Smart Contracts):
• Smart Contracts: Deployed on the blockchain network; manage vote transactions, candidate data, and state management.
• Deployment/Migration Scripts (in the contract/migrations folder): They convey how the smart contracts are deployed and managed on the blockchain.
d. Data Persistence and External Services:
• While there is no traditional database in this project, the blockchain itself serves as the persistent data store for votes and candidates.
• Any client-side state (e.g. using ethers.js or similar libraries referenced in the angular cache) that facilitates interaction with the blockchain network should be represented.
Relationships and Data Flow
• Users interact with the Angular frontend via their browsers.
• Responses and events from the blockchain (e.g., successful vote submission, updated candidate counts) flow back through the Blockchain Service to update the UI state.