How ibrahim-string/kausal-paths-ui works
Main Components
• Frontend Application – This includes:
• Next.js pages (e.g., under src/pages), global and UI Components (found in src/components, including specialized components like charts, graphs, and layout containers).
• Storybook for component development (under .storybook and stories directories).
• Styling layers (found in styles, with SCSS files and CSS modules).
• Internationalization support (public/locales and next-i18next.config.js).
• Client-side Apollo and Sentry configurations (src/common, sentry.client.config.js).
• API & Server-side Components – This comprises:
• API route for GraphQL (src/pages/api/graphql.ts) which acts as the gateway between the frontend and backend.
• Server middleware and utilities (e.g., src/server with auth.ts, log.ts, and views/templates).
• Apollo server and related configuration files (found in src/common/apollo.ts and codegen.ts).
• Testing and Quality Assurance:
• End-to-end (e2e-tests) and load testing (load-tests) directories which include configurations and tests using Playwright and API/load test YAMLs.
• Linting, formatting, and review tools (e.g., .eslintrc, .prettierrc, reviewdog.yml).
• Deployment & Infrastructure:
• Dockerfiles and Docker scripts (Dockerfile, docker folder with Caddyfile, utility scripts).
• GitHub Actions workflows for CI/CD (in .github/workflows).
• Sentry integration for tracking (sentry.properties, Sentry CLI configuration).
• Environment & Configuration:
• Environment variables for API endpoint configuration (as described in the README and .env settings).
• Node version management (.nvmrc) and package dependency management files (package.json, package-lock.json).
Relationships and Data Flows
• The Frontend sends requests to the GraphQL API endpoint (via Apollo) which then interacts with server middleware or an external backend (configured through the NEXT_PUBLIC_API_URL environment variable).
• UI components, as designed in Storybook, are developed independently but eventually integrate as part of the Next.js pages.
• Deployment pipelines (GitHub workflows) and Docker processes build, test, and deploy the entire application.
• Sentry is integrated to capture errors coming from both client-side (Sentry’s client configuration) and server-side logs.
• The testing frameworks (e2e and load tests) simulate user actions and API interactions which can be visualized connecting back to the main API and frontend layers.
Architectural Patterns and Design Principles
• Separation of Concerns: Distinguish the UI (Next.js pages and components) from business logic/APIs (GraphQL and server files).
• Layered Architecture: Differentiate between presentation, API, and integration layers. Even though the project is “full-stack”, the clear folder separation (src/pages, src/components, src/server) reflects a modular design.
• Infrastructure-as-Code: The inclusion of Docker and GitHub Actions configurations denotes CI/CD and containerization practices.