How hackdays-io/toban works
Main Components
• Frontend Application: Located in pkgs/frontend. This includes the user interface built with a modern JavaScript framework and routing (pages, components) and integrations with wallet services and blockchain APIs.
• Smart Contracts: Found in pkgs/contract. This contains Solidity (or similar) contracts that implement core logic (BigBang, FractionToken, Hats, Splits, modules, etc.). It also includes deployment scripts, upgrade scripts, and testing.
• CLI Tool: In pkgs/cli. Provides command-line commands to interact with smart contracts, process deployments, and manage other tasks related to the blockchain.
• Documentation/Whitepaper Site: Under pkgs/document (and docs folder at the root). This is built with Docusaurus and includes guides, how-to documents, and other developer/user resources.
Relationships and Interactions
• The Frontend interacts directly with the smart contracts. It uses wallet integrations (pkgs/frontend/hooks/useWallet.ts) to perform transactions (e.g., registering contributions and rewards distribution).
• The CLI tool provides a developer-facing interface for executing commands that interact with both smart contracts and potentially external services. It wraps around modules and services that handle tasks like deployment, contract upgrades, or wallet interactions.
• There are deployment pipelines defined through GitHub workflows (inside .github/workflows) that build, test, and deploy parts of the system. These CI/CD components ensure consistency in the deployment process.
Architectural Patterns and Design Principles
• Separation of Concerns: The system clearly splits user interface, smart contract logic, indexing, and tooling functionalities.
• Integration of External Blockchain Services: Use of environment variables indicates a design that integrates multiple external services (wallets, IPFS, blockchain networks, etc.) making the system event-driven and decentralized.
• CI/CD Pipeline Integration: The use of GitHub workflows and other configuration files (lefthook.yaml, pnpm-workspace.yaml) shows an emphasis on automated testing, deployment, and quality checks.
Relevant Technologies, Frameworks, and Libraries
• Frontend: Vite, Remix, React, GraphQL, and GraphQL code generation; CSS and emotion for styling.
• Smart Contracts: Hardhat (with its configuration present), Solidity (contracts, OpenZeppelin libraries), and deployment helpers.
• CLI: TypeScript-based CLI that likely interacts with blockchain via modules and services built using libraries like viem.
• Documentation: Docusaurus configuration and custom React components.
• External integrations include services like Pinata, Goldsky, Alchemy, ENS, etc.