How swrjsingh/eth24submission works
Main Components Identification
• Backend / Smart Contracts Module:
• Located in the “packages/hardhat” directory.
• Contains smart contract code (in Solidity), deployment scripts (deploy directory with various deployment scripts), tests, and configuration files (hardhat.config.ts, tsconfig.json).
• Includes CI/CD configurations (e.g., .github/workflows/lint.yaml) and other project-wide config files.
• Frontend Module:
• Located in “packages/nextjs.”
• A Next.js application structured with multiple pages and components (organized under “app”, “components”, “hooks”, “services” etc.).
• Uses various frontend libraries and integrations such as Scaffold-ETH components, wallet connectors (MetaMask, Coinbase), and a dedicated blockexplorer and event management interface.
• External Dependencies & Integrations:
• Blockchain network: Polygon zkEVM/Amoy (for live deployment and testing).
• Wallet Providers: MetaMask and Coinbase wallets used for role-based authentication.
• Zero-Knowledge Proof Tools: Integrations with tools like Circom and Snark.js for generating and validating zkProofs.
• Deployment and build tools: Yarn, Hardhat, and Next.js development server.
Relationships and Interactions
• End Users (Organizers & Buyers):
• Access the frontend (Next.js app) where they authenticate using wallet providers.
• Frontend (Next.js):
• Interacts with smart contracts on the blockchain via connected wallet protocols and services (using scaffolding libraries, hooks for wallet interactions, and custom services like “web3” in the “services” folder).
• Manages event data, provides UI for creating events, viewing tickets, and debugging transactions.
• Smart Contracts / Blockchain Layer (Hardhat):
• The smart contracts govern event creation, ticket issuance (minting NFTs), and verification (using zkProofs).
• Deployed using scripts in “deploy” with interactions logged and managed (deployment artifacts stored in deployments folder).
• External Services:
• Zero-Knowledge Proof generation and validation plugins.
• CI/CD pipelines to ensure code quality and deployment readiness via GitHub workflows.
Architectural Patterns and Design Decisions
• Monorepo structure: The project is integrated as a single repository with separate packages for backend (blockchain contracts) and frontend application.
• Separation of Concerns: Smart contract code is decoupled in its dedicated package while the Next.js frontend handles all user interactions.
• Use of Modern Tooling: Leveraging Hardhat for blockchain development, Next.js for a performant React-based frontend, and scaffold libraries (like Scaffold-ETH2) to simplify complex blockchain interactions.
• Make annotations that call out critical elements, for instance the “zkProof Generation” component and wallet integrations.