How ifrcgo/go-web-app works
Project type and purpose
• This is a frontend‐focused monorepo hosting:
• A React/Vite single‐page application (“app” directory)
• A shared UI component library (“packages/ui”)
• A Storybook instance for that library (“packages/go-ui-storybook”)
• Nginx-based Docker/Helm configurations for serving static assets
• Its purpose is to deliver the IFRC GO web platform UI, which communicates at runtime with a separate backend API.
High‐level architecture components
a. End Users’ Web Browsers – load the SPA, interact via UI
b. CDN or Nginx Static File Server – serves built JavaScript/CSS/HTML
c. React SPA (app) – the single‐page front end, built with Vite and TypeScript
d. IFRC GO UI Library – component set used both by the SPA and Storybook
e. Storybook / Chromatic – development site for UI components
f. Backend API (external, not in this repo) – REST endpoints for data
g. CI/CD Pipelines – GitHub Actions for building, testing, publishing, deploying
Relationships & data flows
• Developers author components in “packages/ui” → consumed by “app” and “go-ui-storybook”.
• Storybook runs in dev mode (via Chromatic workflow) to preview components in isolation.
• The SPA is built (pnpm → vite build) → static assets.
• Nginx (Docker + Helm charts) pulls those assets into a container → deployed to Kubernetes / cloud.
• Browser requests “index.html” from Nginx → downloads SPA → frontend code executes.
• SPA, via its REST utilities (app/src/utils/restRequest), issues HTTP calls to the external go-api backend → renders data in UI.
Architectural patterns & principles
• Monorepo with well-scoped packages (UI library, Storybook, SPA).
• Component-based UI (React) with a shared design system.
• Environment-driven configuration (app/env.ts → .env).
• Infrastructure as code (Dockerfile, Helm templates in nginx-serve).
• CI/CD defined in GitHub workflows:
• ci.yml (build/test)
• publish-nginx-serve.yml (deploy static site)
• chromatic.yml (publish Storybook)
Technologies & frameworks
• UI: React, TypeScript, Vite, PostCSS, CSS modules
• Package management: pnpm, pnpm-workspace
• Component library: packages/ui (exports styled, accessible components)
• Storybook: packages/go-ui-storybook, Chromatic integration
• Server: Nginx (Docker), Helm charts for Kubernetes
• CI/CD: GitHub Actions
• Testing: vitest, jest (for scripts), linting (eslint, stylelint), knip
• Internationalization: JSON per-component i18n files, translation migrations