How cerebellum-network/cluster-apps works
Main Components Identification
• Applications Layer: Represent the three primary web apps:
• Developer Console – with multiple sub-modules (e.g., ActivityCapture, ContentDelivery, ContentStorage).
• Node Provider Console – which includes modules like Network Topology, Node Configuration Steps, Payouts, etc.
• Global Registry – another web app focusing on registry and access management.
• Shared Packages: Illustrate the repositories under “packages” which include:
• API package – handling all the backend communication with endpoints such as AccessRegistryApi, ClusterManagementApi, FaucetApi, IndexerApi, and StatsApi.
• Analytics and Reporting packages – which are used across the UIs to monitor and report on system metrics.
• Infrastructure & Configuration: Note the environment configuration files (e.g., .env files for dev, prod and stage) and the GitHub workflows (CI/CD pipelines) that automate testing and deployment.
• Build and Tooling: Incorporate nodes for tools like ESLint, Prettier, Vite configuration, and the standard Node Version Manager (.nvmrc) for setting the runtime environment.
Relationships and Interactions
• Each app in “apps” draws from the shared “packages” (such as the UI and API libraries) to maintain consistent component design and API integrations.
• GitHub Actions (found in the .github/workflows directory) are crucial for automating deployments and tests; thus, include these as an external CI/CD pipeline that triggers builds and deployments.
Highlighting Architectural Patterns and Design Principles
• Monorepo Architecture: Show that multiple independent web app projects and shared libraries coexist within a single repository. This is beneficial for synchronization of changes and consistent dependency management.
• Component-Based UI: Each web app is structured using UI components (as evidenced by the many component directories) and adheres to a clear separation of concerns – for example, by having dedicated folders for routes, stores, hooks, and components.
• Modular and Reusable Code: The “packages” directory embodies this principle. Emphasize how the UI and API packages are designed for reusability across different apps.
• Frontend Routing and State Management: With robust routing (files in routes/) and state management (stores/), these aspects should be visually represented, for instance, by grouping routes and store modules within each app.
Detailed Layers
• Top Layer: CI/CD and Environment Management – show GitHub workflows and .env files linking to deployment pipelines.
• Middle Layer: The three main web apps (each as a separate module with submodules inside for their routes, stores, and components).
• Bottom Layer: Shared packages/libraries – represent the analytics, API, reporting, and UI libraries, and their utility across the apps.