How flickit-platform/flickit-frontend works
Project Type and Purpose
• Flickit Platform is a Single-Page Application (SPA) built with React, TypeScript, and Vite.
• It provides assessment kits, reporting, comparison, and collaboration features for software teams.
• It runs in Docker, serves static assets via Nginx, and interacts with backend services (not in this repo) over HTTP/REST.
File Structure
• Top-level artifacts:
– Dockerfile & nginx/default.conf → containerized deployment.
– vite.config.ts, index.html → SPA build pipeline.
– src/: React code organized by feature (components/, screens/, routes/, providers/, service/, utils/, hooks/).
– cypress/: end-to-end tests.
– .github/workflows/frontend-ci-cd.yaml → CI/CD pipeline for lint, test, build, deploy.
• Architectural patterns:
– Provider pattern (Context + Reducer) for global state (Auth, Assessment, Compare, etc.).
– Service layer abstracts HTTP calls.
– Hooks for shared logic.
– Feature-based component organization (assessment-kit, dashboard, compare, kit-designer…).
Additional Insights from README
• Expects a docker-compose setup that includes backend services (APIs, database, Keycloak).
• Nginx serves the built SPA and proxies API requests.
• Authentication likely via Keycloak (see keycloakService.ts).
Main Components & Their Interactions
a. Frontend (React SPA)
– Features: Screens, Routes, Components, Hooks, Utils.
– State Management: AppProvider, AuthProvider, AssessmentProvider, etc.
– Service Layer: service/http.tsx + domain-specific modules (assessments, kits, questions…).
– Routing: PrivateRoutes, Redirect.
– Testing: Cypress for E2E, Jest for unit tests in src/components and src/utils.
b. External Services & APIs
– Auth API: Keycloak (token acquisition/refresh).
– Assessment API (REST endpoints).
– ExpertGroup, Questions, Space, User, KitVersions, Advice, Compare services.
c. Deployment
– Docker container runs Nginx, serves built SPA.
– .env.production configures API base URLs.
– GitHub Actions CI/CD: runs ESLint, unit tests, Cypress, builds Docker image, pushes to registry.
d. External Integrations
– Browser → React app → HTTP client → API Gateway
– SPA ←→ Keycloak for auth tokens
– API Gateway → Microservices → Database (not in this repo)
Architectural Patterns & Design Principles
• Separation of Concerns:
– Presentation (components/screens) vs business logic (hooks, providers) vs data access (service/).
• Context + Reducer for state slices, promoting unidirectional data flow.
• Feature-based module organization makes it easy to locate code.
• Service abstraction centralizes HTTP configuration (timeouts, base URL, interceptors).
• CI/CD as code via GitHub workflows ensures build/test/deploy consistency.
Putting It All Together
• Top-level layer: User’s browser.
• In-App modules:
– Routes/Screens → Components → Providers → Service Layer → HTTP Client
– Hooks and Utils support various features.
• External calls:
– /api/auth → Keycloak
– /api/assessments, /api/assessmentKits, /api/questions, /api/expertGroups, etc.
• Infrastructure: Docker, .env, GitHub Actions, Cypress tests.
• Critical configuration (e.g., API base URLs in .env.production, nginx proxy rules).