How strahe/curio-dashboard works
Main Components
• Backend Service: Represented by the Go application (e.g., “cmd” package with main.go, configuration in config/ and db/ packages), which includes:
• GraphQL API Layer: The “graph” directory contains resolvers, schema definitions, loaders, and types that leverage gqlgen.
• Configuration & Initialization: The “cmd” and “config” directories manage application startup, configuration (via config.go), and utility functions.
• Database Integration: Note the “db” folder (e.g., db/harmony.go) handling interactions with the underlying (YugabyteDB) or other databases.
• Internal Helpers: The “types” directory and assorted utilities support core functionality.
• Frontend Application: Represented by the “ui” directory. This is a Vue-based SPA containing:
• UI Components, Layouts, and Widgets: Organized in subfolders (components, layouts, views, etc.) that drive the user-facing portion.
• State Management and Routing: Present in “ui/src/stores” and “ui/src/router,” respectively.
• Build/Configuration Files: Such as package.json, tsconfig, and vite.config.mts that define the frontend build process.
• External Dependencies & Services:
• Curio Node API: The application requires a reachable Curio web API endpoint.
• YugabyteDB: Used as the distributed database for the Curio cluster.
• Prometheus (Optional): For metrics collection and real-time monitoring.
• Lotus Daemon: For blockchain data retrieval.
Component Relationships and Data Flow
• The Backend processes incoming API requests and, using its resolvers and loaders, queries data from internal modules (e.g., DB, configuration) and relays these to the frontend.
• External Services are initiated by the backend:
• For example, calls to the Curio Node and Lotus daemon should be shown as outbound connections from the backend layer.
• Database interactions (with YugabyteDB) and optionally Prometheus metrics collection are separate but integral parts of the system.
Architectural Patterns
• GraphQL API design: Show the “GraphQL Layer” that comprises schemas, resolvers (several files under graph/resolvers), and loaders for efficient data fetching.
• Separation of concerns in the project structure (backend core business logic vs. frontend UI components).
• That the API and UI are loosely coupled, which promotes scalability and maintainability.
Relevant Technologies and Frameworks
• Programming Language: Go (for the backend) and Vue/TypeScript (for the frontend).
• GraphQL: Make clear the significant role of gqlgen for generating the API.
• Database & External Tools: Clearly label YugabyteDB, Curio Node API, Prometheus, and Lotus as external integrations.
• Containerization and CI/CD: Optionally, represent how Docker (Dockerfile, ci.Dockerfile, GitHub workflows, etc.) encapsulates and automates building and deployment.
Be Detailed in Capturing Key Elements
• As many underlying components as possible while grouping modules logically (e.g., all GraphQL-related files under “GraphQL API Layer”).
• Don’t overlook ancillary elements such as CI/CD pipelines (GitHub Actions, Makefile) since they yield insights into the development and deployment pipeline.
• That each external service (Curio Node, YugabyteDB, Prometheus, Lotus) is connected to the correct part of the system and clearly labeled.
• Clearly labeled components (Frontend, Backend/GraphQL, Configuration, Database, External Services).
• A layout that separates the concerns of UI, API, and external integrations.
This detailed approach will give stakeholders a clear understanding of the system’s internal structure, integration points, and high-level design principles.
Happy diagramming!