# gayatriagarwal19/lumyst-assignment architecture

> Architecture diagram of the GitHub repository gayatriagarwal19/lumyst-assignment, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gayatriagarwal19/lumyst-assignment
- Repository: https://github.com/gayatriagarwal19/lumyst-assignment

## Overview

##### Project type and purpose
- There is no separate “backend” or API route folder, so the project is purely a frontend SPA/SSR application that loads and visualizes graph-style data.

##### File structure
- Top-level:
· app/ – Next.js 13 “app router” directory holding server and client components (layout.tsx, page.tsx)
· components/ – React UI pieces: custom React-Flow nodes, shared UI primitives (buttons, etc.)
· core/ – Business-logic layer: JSON data, converters, graph-format and react-flow services, TypeScript types
· lib/ – Utility functions (utils.ts)
· config files (.eslintrc, tsconfig, postcss.config, next.config)
- Directory patterns indicate a clear separation of:
· Presentation (components + app pages)
· Domain logic (core/services + data)
· Utilities (lib)

##### (empty) README for insights

a. Main components:
- Next.js Application (app/) – routes, server + client components
- UI Layer (components/) – React-Flow nodes, UI primitives
- Core Services (core/) –
– Data Converter (data-converter.ts)
– Graph Format Service (graph-format.service.ts)
– React Flow Service (react-flow.service.ts)
- Data Sources (core/data/) – JSON files (analysis.json, analysis-with-code.json)
- Utility Library (lib/utils.ts)
- External Frameworks – React, Next.js, Tailwind/PostCSS
b. Relationships & interactions:
- The Next.js pages under app/ import components/ to build the UI.
- UI components invoke core/services to load/convert JSON data into graph structures.
- Utilities in lib/ are used by both components and core services for helper routines (e.g., formatting).
c. Architectural patterns/design principles:
- Separation of concerns: UI vs. domain logic vs. data vs. utilities
- Layered architecture: Presentation → Services → Data
- Component-based React design with service abstraction
d. Technologies/frameworks:
- Next.js 13 (app router)
- React + React Flow (visual graph rendering)
- TypeScript for typings under core/types/index.ts
- PostCSS/Tailwind CSS (globals.css, postcss.config.mjs)
- ESLint, pnpm

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Presentation Layer"
        direction TB
        app_layout["layout.tsx"] 
        app_page["page.tsx"]
        app_globals["globals.css"]
        components_rf_nodes["react-flow-nodes.tsx"]
        components_button["button.tsx"]
    end

    subgraph "Core Services"
        direction TB
        core_data_converter["data-converter.ts"]
        core_graph_format["graph-format.service.ts"]
        core_react_flow["react-flow.service.ts"]
        core_types["index.ts"]
    end

    subgraph "Data Sources"
        direction TB
        data_analysis["analysis.json"]
        data_analysis_code["analysis-with-code.json"]
    end

    lib_utils["utils.ts"]

    subgraph "External Dependencies"
        direction TB
        React["React"]
        Next["Next.js"]
        Tailwind["Tailwind CSS"]
    end

    app_page -->|uses| components_rf_nodes
    app_page -->|uses| components_button
    components_rf_nodes -->|invokes| core_react_flow
    components_button -->|uses| lib_utils
    core_react_flow -->|calls| core_graph_format
    core_graph_format -->|calls| core_data_converter
    core_data_converter -->|reads| data_analysis
    core_data_converter -->|reads| data_analysis_code
    core_data_converter -->|uses types| core_types
    core_graph_format -->|uses types| core_types
    core_react_flow -->|uses types| core_types
    components_rf_nodes -->|uses utils| lib_utils
    core_data_converter -->|uses utils| lib_utils

    React --> components_rf_nodes
    React --> components_button
    Next --> app_layout
    Next --> app_page
    Tailwind --> app_globals

    click app_layout "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/app/layout.tsx"
    click app_page "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/app/page.tsx"
    click app_globals "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/app/globals.css"
    click components_rf_nodes "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/components/react-flow-nodes.tsx"
    click components_button "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/components/ui/button.tsx"
    click core_data_converter "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/core/data/data-converter.ts"
    click core_graph_format "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/core/graph-format.service.ts"
    click core_react_flow "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/core/react-flow.service.ts"
    click data_analysis "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/core/data/analysis.json"
    click data_analysis_code "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/core/data/analysis-with-code.json"
    click core_types "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/core/types/index.ts"
    click lib_utils "https://github.com/gayatriagarwal19/lumyst-assignment/blob/main/lib/utils.ts"

    class app_layout,app_page,app_globals app
    class components_rf_nodes,components_button ui
    class core_data_converter,core_graph_format,core_react_flow service
    class data_analysis,data_analysis_code data
    class lib_utils utils
    class React,Next,Tailwind external

    classDef app fill:#ADD8E6,stroke:#000
    classDef ui fill:#90EE90,stroke:#000
    classDef service fill:#32CD32,stroke:#000
    classDef data fill:#FFA500,stroke:#000
    classDef utils fill:#D3D3D3,stroke:#000
    classDef external fill:#FFB6C1,stroke:#000
```
