# maheesh09/kapruka-flow architecture

> Architecture diagram of the GitHub repository maheesh09/kapruka-flow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maheesh09/kapruka-flow
- Repository: https://github.com/maheesh09/kapruka-flow

## Overview

1. **Overall shape**
   - This is a **Next.js App Router** project written in **plain JavaScript**.
   - The architecture is mostly a **single-page UI experience** with one backend endpoint, rather than a multi-service application.

2. **Top-level app composition**
   - `app/layout.js` provides the global document shell and shared app wrapper.
   - `app/page.js` is the main entry point for the experience and likely assembles the visible sections on the home route.

3. **Presentation subsystem**
   - Most of the product logic appears to live in `app/components/`.
   - The component set suggests a **dashboard/flow visualization UI** with distinct visual modules: `FlowArea`, `FlowOrb`, `OpeningCanvas`, `PlanBoard`, `OrderStageCard`, `TrackingCard`, and `LockedCard`.

4. **UI structure and boundaries**
   - `Header.js` likely anchors the top-level navigation or brand area.
   - The card components imply separate UI panels for different states or stages of a process, while `LockedCard` represents restricted or gated content.
   - `Icon.js` is a shared visual primitive used across the UI.

5. **Interactive/animated visual layer**
   - Components like `FlowArea`, `FlowOrb`, and `OpeningCanvas` indicate a **highly visual, possibly animated front-end**.
   - These are probably used to render the “flow” metaphor and any motion-heavy hero or interaction area.

6. **Backend/API boundary**
   - `app/api/chat/route.js` is the only explicit server-side endpoint in the tree.
   - This is a clear boundary between the client-side interface and a **chat-style backend interaction**, likely used for assistant/help/conversational features.

7. **Data flow**
   - User loads the page → Next.js renders `layout` + `page` → `page` composes the component tree.
   - UI interactions can call `/api/chat` for server-backed responses.
   - The API response then feeds back into the client UI, likely inside a chat or guided-flow surface.

8. **Styling system**
   - `app/globals.css` provides application-wide styles.
   - `app/page.module.css` suggests route-scoped styling for the main page, keeping page-specific layout isolated from shared styling.

9. **Localization / text management**
   - `app/i18n.js` indicates a centralized internationalization or copy-management layer.
   - If the app supports multiple languages or localized labels, this file is the likely coordination point for that content.

10. **Static assets**
   - `public/` is the static asset boundary for images, icons, and other files served directly by Next.js.
   - These assets likely support the visual-heavy components and branding.

11. **Project tooling and constraints**
   - `next.config.mjs`, `eslint.config.mjs`, and `jsconfig.json` show standard Next.js build/lint/editor support.
   - There is no sign of a separate database layer, message queue, or external service wrapper in the repository structure.

12. **Architecture summary**
   - In diagram form, this repo is best represented as:
     - **Browser UI**
     - **Next.js app shell and page composition**
     - **Shared visual components**
     - **Single chat API route**
     - **Static assets/styles**
   - The dominant architecture is **frontend-first**, with one small server boundary for chat interaction.

Main entry points: [`app/page.js`](https://github.com/maheesh09/kapruka-flow/blob/main/app/page.js) (Home page), [`app/components/Icon.js`](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/Icon.js) (Icon), [`app/components/OpeningCanvas.js`](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/OpeningCanvas.js) (Opening canvas), [`app/layout.js`](https://github.com/maheesh09/kapruka-flow/blob/main/app/layout.js) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Next.js app"]
  node_layout["App shell<br/>Next.js layout<br/>[layout.js]"]
  node_page["Home page<br/>Next.js route<br/>[page.js]"]
  node_globalscss["Global styles<br/>CSS<br/>[globals.css]"]
  node_pagemodulecss["Page styles<br/>CSS module<br/>[page.module.css]"]
  node_i18n["Copy layer<br/>i18n/copy<br/>[i18n.js]"]
end

subgraph group_components["UI components"]
  node_header["Header<br/>[Header.js]"]
  node_flowarea["Flow area<br/>visual stage<br/>[FlowArea.js]"]
  node_floworb(("Flow orb<br/>animated visual<br/>[FlowOrb.js]"))
  node_openingcanvas["Opening canvas<br/>hero canvas<br/>[OpeningCanvas.js]"]
  node_planboard["Plan board<br/>planning panel<br/>[PlanBoard.js]"]
  node_ordercard["Order card<br/>stage card<br/>[OrderStageCard.js]"]
  node_trackingcard["Tracking card<br/>status card<br/>[TrackingCard.js]"]
  node_lockedcard["Locked card<br/>gated card<br/>[LockedCard.js]"]
  node_icon(("Icon<br/>visual primitive<br/>[Icon.js]"))
end

subgraph group_server["Server boundary"]
  node_chatapi["Chat API<br/>Next.js route handler<br/>[route.js]"]
end

subgraph group_assets["Static assets"]
  node_public[("Public assets<br/>static assets")]
end

node_layout -->|"wraps"| node_page
node_layout -->|"loads"| node_globalscss
node_page -->|"renders"| node_header
node_page -->|"renders"| node_flowarea
node_page -->|"renders"| node_openingcanvas
node_page -->|"renders"| node_planboard
node_page -->|"renders"| node_ordercard
node_page -->|"renders"| node_trackingcard
node_page -->|"renders"| node_lockedcard
node_flowarea -->|"uses"| node_floworb
node_openingcanvas -->|"uses"| node_floworb
node_header -->|"uses"| node_icon
node_planboard -->|"uses"| node_icon
node_ordercard -->|"uses"| node_icon
node_trackingcard -->|"uses"| node_icon
node_lockedcard -->|"uses"| node_icon
node_page -->|"reads copy"| node_i18n
node_page -->|"styles"| node_pagemodulecss
node_page -->|"calls"| node_chatapi
node_chatapi -.->|"may use"| node_i18n
node_page -->|"serves assets"| node_public
node_openingcanvas -->|"uses assets"| node_public

click node_layout "https://github.com/maheesh09/kapruka-flow/blob/main/app/layout.js"
click node_page "https://github.com/maheesh09/kapruka-flow/blob/main/app/page.js"
click node_globalscss "https://github.com/maheesh09/kapruka-flow/blob/main/app/globals.css"
click node_pagemodulecss "https://github.com/maheesh09/kapruka-flow/blob/main/app/page.module.css"
click node_i18n "https://github.com/maheesh09/kapruka-flow/blob/main/app/i18n.js"
click node_header "https://github.com/maheesh09/kapruka-flow/blob/main/app/components/Header.js"
click node_flowarea "https://github.com/maheesh09/kapruka-flow/blob/main/app/components/FlowArea.js"
click node_floworb "https://github.com/maheesh09/kapruka-flow/blob/main/app/components/FlowOrb.js"
click node_openingcanvas "https://github.com/maheesh09/kapruka-flow/blob/main/app/components/OpeningCanvas.js"
click node_planboard "https://github.com/maheesh09/kapruka-flow/blob/main/app/components/PlanBoard.js"
click node_ordercard "https://github.com/maheesh09/kapruka-flow/blob/main/app/components/OrderStageCard.js"
click node_trackingcard "https://github.com/maheesh09/kapruka-flow/blob/main/app/components/TrackingCard.js"
click node_lockedcard "https://github.com/maheesh09/kapruka-flow/blob/main/app/components/LockedCard.js"
click node_icon "https://github.com/maheesh09/kapruka-flow/blob/main/app/components/Icon.js"
click node_chatapi "https://github.com/maheesh09/kapruka-flow/blob/main/app/api/chat/route.js"
click node_public "https://github.com/maheesh09/kapruka-flow/tree/main/public"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_layout,node_page,node_globalscss,node_pagemodulecss,node_i18n toneBlue
class node_header,node_flowarea,node_floworb,node_openingcanvas,node_planboard,node_ordercard,node_trackingcard,node_lockedcard,node_icon toneAmber
class node_chatapi toneMint
class node_public toneRose
```

## Components

### Next.js app

App Router shell, route entry, styles, and copy coordination.

- [App shell](https://github.com/maheesh09/kapruka-flow/blob/main/app/layout.js): Next.js layout · Global document wrapper and shared app chrome. · `app/layout.js`
- [Home page](https://github.com/maheesh09/kapruka-flow/blob/main/app/page.js): Next.js route · Main entry point that assembles the visible experience. · `app/page.js`
- [Global styles](https://github.com/maheesh09/kapruka-flow/blob/main/app/globals.css): CSS · Application-wide styling boundary. · `app/globals.css`
- [Page styles](https://github.com/maheesh09/kapruka-flow/blob/main/app/page.module.css): CSS module · Route-scoped styles for the home page. · `app/page.module.css`
- [Copy layer](https://github.com/maheesh09/kapruka-flow/blob/main/app/i18n.js): i18n/copy · Centralized text and localization coordination. · `app/i18n.js`

### UI components

Shared visual and staged interface pieces for the main experience.

- [Header](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/Header.js): UI header · Top-level brand or navigation area. · `app/components/Header.js`
- [Flow area](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/FlowArea.js): visual stage · Primary flow-oriented content region. · `app/components/FlowArea.js`
- [Flow orb](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/FlowOrb.js): animated visual · Motion-heavy visual accent used in the flow experience. · `app/components/FlowOrb.js`
- [Opening canvas](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/OpeningCanvas.js): hero canvas · Introductory animated or illustrated surface. · `app/components/OpeningCanvas.js`
- [Plan board](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/PlanBoard.js): planning panel · Board-like panel for organized process steps. · `app/components/PlanBoard.js`
- [Order card](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/OrderStageCard.js): stage card · Card representing an order or progression stage. · `app/components/OrderStageCard.js`
- [Tracking card](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/TrackingCard.js): status card · Card for tracking or progress status. · `app/components/TrackingCard.js`
- [Locked card](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/LockedCard.js): gated card · Restricted or unavailable content panel. · `app/components/LockedCard.js`
- [Icon](https://github.com/maheesh09/kapruka-flow/blob/main/app/components/Icon.js): visual primitive · Reusable icon primitive shared across the UI. · `app/components/Icon.js`

### Server boundary

Single backend route for chat-style interaction.

- [Chat API](https://github.com/maheesh09/kapruka-flow/blob/main/app/api/chat/route.js): Next.js route handler · Single server endpoint for chat-style responses. · `app/api/chat/route.js`

### Static assets

Public files served directly by Next.js.

- [Public assets](https://github.com/maheesh09/kapruka-flow/tree/main/public): static assets · Directly served images and brand assets. · `public`

## Connections

- App shell → Home page: wraps · The app shell provides the shared document structure for the home route.
- App shell → Global styles: loads · Global styles are applied through the top-level shell.
- Home page → Header: renders · The home route includes the header surface.
- Home page → Flow area: renders · Main page composition centers on the flow experience.
- Home page → Opening canvas: renders · The entry route includes the introductory visual layer.
- Home page → Plan board: renders · The route assembles the planning or workflow board.
- Home page → Order card: renders · Stage card content is part of the main composition.
- Home page → Tracking card: renders · Progress tracking UI is composed on the home route.
- Home page → Locked card: renders · Gated content is surfaced as part of the experience.
- Flow area → Flow orb: uses · The flow stage likely includes animated orb elements.
- Opening canvas → Flow orb: uses · The hero canvas shares the same motion/visual primitive.
- Header → Icon: uses · Header presentation likely relies on shared icons.
- Plan board → Icon: uses · Board UI likely uses icons for status and actions.
- Order card → Icon: uses · Stage cards use the shared icon primitive.
- Tracking card → Icon: uses · Tracking UI uses the shared icon primitive.
- Locked card → Icon: uses · Locked state presentation uses the shared icon primitive.
- Home page → Copy layer: reads copy · The route likely pulls labels and text from the copy layer.
- Home page → Page styles: styles · Route-specific layout and presentation are scoped here.
- Home page → Chat API: calls · Client interactions can send requests to the chat endpoint.
- Chat API → Copy layer: may use · Server responses may align with centralized text or prompts.
- Home page → Public assets: serves assets · The UI can draw branding and imagery from static assets.
- Opening canvas → Public assets: uses assets · Visual-heavy components likely depend on static media.
