How kshsri21/votingbootcamp works
Bootcamp1.0 is a browser-based voting dapp with voter and candidate registration/listing, voting, election administration, wallet authentication, and a token marketplace. Users connect a wallet, then navigate to registration, voting, election-management, or marketplace screens; those screens use shared Web3 state to interact with contracts. The README gives no further capability details, so unsampled feature relationships are kept conservative. The graph follows explicit route/component wiring and sampled Web3 setup; several contract interactions are indicated by indexed imports, not inspected implementations.
Main entry points: useWeb3Context.jsx Web3 hook · routes.jsx Page routes · TokenMarketplace.jsx Marketplace page · ElectionCommision.jsx Election administration
Components 31
Application flow
- App shell
src/App.jsx - Page routes
src/routes/routes.jsx - Navigation
src/components/Navigation/Navigation.jsx
Wallet and Web3
- Wallet screen
src/components/Wallet/Wallet.jsx - Web3 provider
src/context/Web3Provider.jsx - Web3 hook
src/context/useWeb3Context.jsx - Web3 context
src/context/web3Context.jsx - Wallet setup
src/utils/getWeb3State.jsx
Election workflows
- Voter registration
src/pages/Voter/RegisterVoter.jsx - Voter list
src/pages/Voter/GetVoterList.jsx - Candidate registration
src/pages/Candidate/RegisterCandidate.jsx - Candidate list
src/pages/Candidate/GetCandidateList.jsx - Candidate image upload
src/utils/uploadCandidateImage.jsx - Election administration
src/pages/ElectionCommision/ElectionCommision.jsx - Voting status
src/components/ElectionCommision/VotingStatus.jsx - Election results
src/components/ElectionCommision/DisplayResult.jsx - Voting period
src/components/ElectionCommision/VotingTimePeriod.jsx - Winner announcement
src/components/ElectionCommision/AnnounceWinner.jsx - Emergency declaration
src/components/ElectionCommision/EmergencyDeclare.jsx - Cast vote
src/components/Voter/CastVote.jsx
Token marketplace
- Marketplace page
src/pages/TokenMarketplace/TokenMarketplace.jsx - Buy tokens
src/components/TokenMarketplace/BuyToken.jsx - Sell and approve
src/components/TokenMarketplace/SellToken.jsx - Token balance
src/components/TokenMarketplace/TokenBalance.jsx - Token price
src/components/TokenMarketplace/TokenPrice.jsx
Other components
- Dapp user
- MetaMask
- Authentication API
- Voting contract
- Marketplace contract
- ERC-20 contract
Connections 48
- Dapp user → Page routes: navigates
src/routes/routes.jsx - App shell → Web3 provider: provides state
src/App.jsx - App shell → Page routes: mounts router
src/App.jsx - Page routes → Wallet screen: routes to
src/routes/routes.jsx - Page routes → Navigation: renders
src/routes/routes.jsx - Page routes → Voter registration: routes to
src/routes/routes.jsx - Page routes → Voter list: routes to
src/routes/routes.jsx - Page routes → Candidate registration: routes to
src/routes/routes.jsx - Page routes → Candidate list: routes to
src/routes/routes.jsx - Page routes → Election administration: routes to
src/routes/routes.jsx - Page routes → Marketplace page: routes to
src/routes/routes.jsx - Web3 provider → Web3 context: provides context
src/context/Web3Provider.jsx - Web3 provider → Wallet setup: loads wallet state
src/context/Web3Provider.jsx - Web3 hook → Web3 context: reads context
src/context/useWeb3Context.jsx - Wallet setup → MetaMask: requests account
src/utils/getWeb3State.jsx - Wallet setup → Authentication API: authenticates account
src/utils/getWeb3State.jsx - Wallet setup → Voting contract: creates contract client
src/utils/getWeb3State.jsx - Wallet screen → Web3 hook: reads wallet state
src/components/Wallet/Wallet.jsx - Voter registration → Web3 hook: reads contract state
src/pages/Voter/RegisterVoter.jsx - Voter registration → Voting contract: registers voter
- Voter list → Web3 hook: reads contract state
src/pages/Voter/GetVoterList.jsx - Voter list → Voting contract: queries voters
- Candidate registration → Web3 hook: reads contract state
src/pages/Candidate/RegisterCandidate.jsx - Candidate registration → Candidate image upload: uploads image
src/pages/Candidate/RegisterCandidate.jsx - Candidate registration → Voting contract: registers candidate
src/pages/Candidate/RegisterCandidate.jsx - Candidate list → Web3 hook: reads contract state
src/pages/Candidate/GetCandidateList.jsx - Candidate list → Voting contract: queries candidates
- Election administration → Voting status: renders
src/pages/ElectionCommision/ElectionCommision.jsx - Election administration → Election results: renders
src/pages/ElectionCommision/ElectionCommision.jsx - Election administration → Voting period: renders
src/pages/ElectionCommision/ElectionCommision.jsx - Election administration → Winner announcement: renders
src/pages/ElectionCommision/ElectionCommision.jsx - Election administration → Emergency declaration: renders
src/pages/ElectionCommision/ElectionCommision.jsx - Voting status → Web3 hook: reads contract state
src/components/ElectionCommision/VotingStatus.jsx - Voting status → Voting contract: reads status
src/components/ElectionCommision/VotingStatus.jsx - Election results → Web3 hook: reads contract state
src/components/ElectionCommision/DisplayResult.jsx - Voting period → Web3 hook: reads contract state
src/components/ElectionCommision/VotingTimePeriod.jsx - Winner announcement → Web3 hook: reads contract state
src/components/ElectionCommision/AnnounceWinner.jsx - Emergency declaration → Web3 hook: reads contract state
src/components/ElectionCommision/EmergencyDeclare.jsx - Cast vote → Web3 hook: reads contract state
src/components/Voter/CastVote.jsx - Cast vote → Voting contract: casts vote
- Marketplace page → Web3 hook: reads wallet state
src/pages/TokenMarketplace/TokenMarketplace.jsx - Marketplace page → Buy tokens: renders
src/pages/TokenMarketplace/TokenMarketplace.jsx - Marketplace page → Sell and approve: renders
src/pages/TokenMarketplace/TokenMarketplace.jsx - Marketplace page → Token balance: renders
src/pages/TokenMarketplace/TokenMarketplace.jsx - Marketplace page → Token price: renders
src/pages/TokenMarketplace/TokenMarketplace.jsx - Marketplace page → Marketplace contract: initializes client
src/pages/TokenMarketplace/TokenMarketplace.jsx - Marketplace page → ERC-20 contract: initializes client
src/pages/TokenMarketplace/TokenMarketplace.jsx - Buy tokens → Marketplace contract: buys tokens