How datum-cloud/cloud-portal works
Project Type & Purpose
• Full-stack Remix web portal (“Datum Cloud Portal”) for managing cloud resources via a control-plane API.
• Provides UI for projects, networks, workloads, secrets, export-policies, etc., backed by a code-generated SDK and REST/GraphQL layers.
Main Components
• Frontend (React/TypeScript, Remix, shadcn/ui, Tailwind CSS)
• Feature modules under app/features (e.g., workload, network, observe)
• Shared components under app/components
• State management: Jotai (local) & TanStack Query (server‐state)
• Routing: Remix routes in app/routes & API routes in app/routes/api+
• Backend (Remix server in server.ts & entry.server.ts)
• Loaders/actions for data fetching & form handling
• Middleware for auth & CSRF in app/modules/middleware
• i18n, unstorage, and auth modules
• API Layer
• Control-plane SDK (code-gen under app/modules/control-plane)
• Axios module for HTTP transport
• Resources/controllers in app/resources mapping UI calls to SDK
• GraphQL client under app/modules/graphql (optional)
• External Services
• Cloud control-plane (compute, network, telemetry, resource-manager)
• Monitoring (Prometheus, Grafana via Docker/dev manifests)
• CI/CD (GitHub Actions) & Observability (Sentry, Fathom)
Component Relationships & Data Flow
• Browser → Remix Server: request page or submit form
• Remix Server Loader/Action → Resources → Control-Plane SDK (via Axios) → Cloud API
• Response → Remix Server → Serialized JSON → Browser
• Frontend fetches/caches with TanStack Query; global state via Jotai
Architectural Patterns
• Feature-based modularization: each domain in its own folder
• Layered API adapter: UI → resources/controllers → SDK → HTTP → Cloud API
• Server/client separation via Remix loaders/actions and React components
• Code generation for API schemas and SDK ensures type safety