How cpe3a-tolentino-ronstephen/orbittest works
1. This repository is a two-part monorepo:
- orbit/client: a Vite + React single-page application.
- orbit/server: a Node/Express backend API.
The architecture is split cleanly between a browser UI and an HTTP service layer.
2. The client is the main presentation layer. Its top-level entry is src/main.jsx, which mounts App.jsx and wraps the app with global styling and shared context. The app is organized into pages rather than route-heavy feature modules.
3. Client pages define the user-facing flows:
- LandingPage.jsx for the public entry experience.
- AuthPage.jsx for sign-in/sign-up related interactions.
- DashboardPage.jsx, MapPage.jsx, and StatisticsPage.jsx for the authenticated analytics views.
This suggests the product is centered on exploring disease/country risk data rather than generic CRUD.
4. Shared layout is separated from page content. AppLayout.jsx composes the persistent shell, with Header, Sidebar, and Footer in src/components/layout. This boundary indicates a stable navigation frame around changing page content.
5. Reusable UI is factored into domain-specific components in src/components/ui:
- CountryTable, CountryDetail
- DiseaseTabs
- RiskBadge
- StatCard
- Skeleton
These are not generic widgets; they encode the domain model around countries, diseases, and risk/statistics.
6. Client state and data access are split into a few focused layers:
- context/AuthContext.jsx handles authentication state for the app shell.
- hooks/useDisease.js encapsulates disease-related fetching or derived state.
- services/api.js is the client-side HTTP boundary to the backend.
This keeps UI components mostly declarative and pushes remote communication into dedicated modules.
7. The server is a small Express API surface. server/index.js is the entry point, and the only route modules are routes/auth.js and routes/disease.js. That implies the backend is organized around authentication and disease data retrieval rather than a broad domain model.
8. Server configuration is externalized in config/:
- config/disease.js
- config/dataSources.js
This strongly suggests the API is at least partly configuration-driven and may aggregate from one or more upstream data sources instead of relying on a local database layer, since no DB models or persistence folders are present.
9. The main data flow is:
browser page/component → client service/hook → Express route → config/data-source logic → response back to UI.
The UI appears to consume disease/country/risk data through a single API boundary, then render tables, cards, badges, and map/statistical views.
10. Authentication is a cross-cutting concern but not the core domain. The presence of AuthContext on the client and routes/auth.js on the server indicates login/session handling is part of the app shell, with auth state likely controlling access to the dashboard-style pages.
11. The project also has deployment/runtime boundaries:
- The client uses Vite (vite.config.js) and is configured for Vercel (vercel.json).
- The server is a standalone Node package with its own package.json.
This means frontend and backend can be deployed independently, with the client likely calling the server over HTTP.
12. Overall, the repository is best diagrammed as:
- a React SPA with shared layout, auth context, and domain-specific dashboard pages;
- a thin Express API with auth and disease endpoints;
- config-driven disease/data-source logic on the server;
- no obvious database or worker subsystem in the tree.
The dominant architectural boundary is UI vs API, with the disease/risk domain flowing through both sides.
Main entry points: App.jsx App shell · AppLayout.jsx App layout · index.js Server entry · useDisease.js Disease hook
Components 20
Client SPA
Vite + React browser app
- Main entry · Bootstraps the SPA and mounts the app shell
orbit/client/src/main.jsx - App shell · Top-level app composition and view switching
orbit/client/src/App.jsx - App layout · Persistent frame around page content
orbit/client/src/components/AppLayout.jsx - Header bar · Top navigation and global actions
orbit/client/src/components/layout/Header.jsx - Sidebar · Primary side navigation
orbit/client/src/components/layout/Sidebar.jsx - Footer · Persistent footer area
orbit/client/src/components/layout/Footer.jsx - Auth context · Global authentication state for the SPA
orbit/client/src/context/AuthContext.jsx - API client · Client-side HTTP calls to the backend
orbit/client/src/services/api.js - Disease hook · Encapsulates disease data fetching and derived state
orbit/client/src/hooks/useDisease.js - Landing page · Public entry experience
orbit/client/src/pages/LandingPage.jsx - Auth page · Sign-in and sign-up flow
orbit/client/src/pages/AuthPage.jsx - Dashboard · Authenticated overview of risk data
orbit/client/src/pages/DashboardPage.jsx - Map view · Geographic disease and risk exploration
orbit/client/src/pages/MapPage.jsx - Statistics · Summary statistics and trends
orbit/client/src/pages/StatisticsPage.jsx - Domain UI · Reusable country, disease, risk, and stats components
orbit/client/src/components/ui
Server API
Express HTTP service
- Server entry · Starts the HTTP API
orbit/server/index.js - Auth routes · Authentication endpoint surface
orbit/server/routes/auth.js - Disease routes · Disease and country data endpoint surface
orbit/server/routes/disease.js - Disease config · Domain configuration for disease logic
orbit/server/config/disease.js - Data sources · Upstream data-source configuration
orbit/server/config/dataSources.js
Connections 23
- Main entry → App shell: mounts · Bootstraps the root application
- App shell → App layout: wraps · Provides the persistent application shell
- App shell → Landing page: shows · Public entry view
- App shell → Auth page: shows · Authentication flow
- App shell → Dashboard: shows · Authenticated overview
- App shell → Map view: shows · Map exploration view
- App shell → Statistics: shows · Statistics view
- App layout → Header bar: contains · Persistent top navigation
- App layout → Sidebar: contains · Persistent side navigation
- App layout → Footer: contains · Persistent footer
- App layout → Domain UI: renders · Uses reusable domain UI pieces
- App layout → Auth context: reads · Consumes auth state for shell behavior
- Dashboard → Disease hook: uses · Loads disease data for dashboard views
- Map view → Disease hook: uses · Loads disease data for map views
- Statistics → Disease hook: uses · Loads disease data for statistics views
- Auth page → Auth context: updates · Sets authentication state
- Disease hook → API client: fetches via · Delegates remote data access
- API client → Server entry: calls · HTTP boundary to backend API
- Server entry → Auth routes: mounts · Registers auth routes
- Server entry → Disease routes: mounts · Registers disease routes
- Disease routes → Disease config: uses · Applies domain configuration
- Disease routes → Data sources: uses · Reads upstream data-source configuration
- Auth routes → Server entry: served by · Authentication endpoints live under the API server