How watchitdev/watchit-app works
Main Architectural Components
• Frontend/UI Layer:
• Overall client-side application, which is structured as a collection of React components (see the extensive “src/components” directory) including common UI elements (e.g., carousels, modals, dialogs, nav sections, and forms).
• “layouts”, “pages”, and “themes” directories, which define how the content is visually structured and styled.
• State Management & Business Logic:
• Context providers present in the “src/auth/context” (e.g., web3Auth context), and other hooks in “src/hooks” that encapsulate domain logic such as blockchain interactions and UI behavior.
• Blockchain Integration & Smart Contract Communication:
• “src/config” folder containing ABI definitions for blockchain contracts and the “src/clients” folder (e.g., using viem for publicClient) that wrap the blockchain connectivity.
• Specialized hooks (“src/hooks/protocol”) that facilitate interactions with decentralized protocols and smart contracts.
• Decentralized Content Delivery & Synapse Protocol:
• Integration with Synapse technology (as noted in the README) – mark an external connection to a distributed content delivery network powered by blockchain. Although the decentralized nodes are external, they are critical to the system architecture.
• Supporting Components:
• Static assets (“public” and “src/assets”) for images, fonts, and other media.
• Background workers (“src/workers”) for handling background tasks.
• The configuration, testing, and utility modules (e.g., “src/utils”, “src/hooks”) that support various functionalities throughout the app.
Out the Relationships and Interactions
• How user interactions in the Frontend/UI Trigger State Management updates (via Redux and React Context) and through the use of custom hooks.
• How the UI components interact with blockchain integration modules (via clients and protocol hooks) to validate authentication, fetch smart contract data, or perform transactions.
• From UI elements to the Redux store and context providers.
• From the Redux layer to the blockchain client modules (wrapping underlying smart contract calls).
• From blockchain integrations to external decentralized nodes (via the Synapse protocol).
• That the theming and layout components orchestrate the user experience, feeding into the overall UI presentation.
Architectural Patterns and Design Principles
• Component-Based Architecture: Emphasize the modular React components clearly separated into directories (such as “components”, “layouts”, “pages”) that indicate reusability and encapsulation.
• State Management and Context Pattern: Illustrate how Redux and React Context for authentication (e.g., “src/auth/context/web3Auth”) are used to manage global state and access control, essential for decentralized authentication.
• Decoupling Between UI and Blockchain Logic: The design separates user interface concerns from blockchain communication (managed in dedicated “clients”, “config”, and “hooks/protocol” directories).
• Use of Testing and Configuration: Include references to test folders, ESLint, Prettier, and CI/CD workflows (in the “.github” folder) to denote attention to code quality and continuous integration.
Relevant Technologies and Frameworks
• Frontend: React, TypeScript, and Vite (as per “vite.config.ts”).
• State Management: Redux and React Context.
• Blockchain/Decentralized Components: Integration via web3Auth, Synapse protocol, and smart contract communication (ABIs in “src/config/abi”).
• UI/UX: Theming with custom shadows, typography, and overrides (see “src/theme”), along with robust component libraries (for modals, carousels, dialogs, etc.).