How web3tea/curio-dashboard works
Project Type & Purpose
• Full-stack web application for real-time monitoring and management of a Curio cluster.
• Frontend: Vue.js + TypeScript + Apollo GraphQL client.
• Backend: Go service exposing a GraphQL API (gqlgen), data loaders and subscriptions.
Main Components
A. Frontend
• Vue.js SPA (ui/) with Apollo Client for GraphQL queries/subscriptions.
• UI layers: layouts, views, components, stores, styling.
B. Backend GraphQL Server
• cmd/ entrypoints orchestrating configuration, GraphQL server, caching, Prometheus integration.
• graph/ contains schema definitions, generated code, resolvers, data loaders, cache-control extensions.
• config/ holds configuration parsing.
• db/ handles direct database logic (YugabyteDB).
C. Data Stores & Caches
• YugabyteDB (configured via config.toml) for cluster state and metadata.
• In-memory cache (per-resolver cachecontrol).
• Prometheus client for metrics ingestion (optional).
D. External Services
• Curio Web API (RPC) for cluster commands and real-time events.
• Lotus Daemon for blockchain data retrieval.
• Prometheus endpoint for time-series metrics.
E. Deployment & Tooling
• Docker (Dockerfile, ci.Dockerfile) for containerized builds.
• Makefile, CI workflows (.github/workflows) for build/test.
• .devcontainer for development environment.
Component Interactions
1. Frontend → GraphQL Server (HTTP/WebSocket)
• Queries & mutations to fetch and update cluster data.
• Subscriptions for real-time updates.
2. GraphQL Server → Data Loaders / Cache / DB
• Resolve GraphQL fields by batching calls, caching, or database queries.
3. GraphQL Server → External APIs
• Curio RPC client under graph/curiorpc/ for tasks, machines, IPNI, miner info.
• Prometheus client under graph/prometheus/.
• Lotus RPC via configuration.
4. GraphQL Server → Database
• CRUD on cluster metadata, configuration, task history.
5. Database & Prometheus
• Persistent store and time-series metrics are independent backends.
Architectural Patterns & Principles
• GraphQL schema-first design with code generation (gqlgen).
• Resolver & loader layering for separation of concerns and batching.
• Modular frontend with Vue components, stores, and Apollo integration.
• Clear environment-based configuration and pluggable endpoints.