# rohitdayal-jktech/jk-intellitech architecture

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

- Interactive diagram: https://gitdiagram.com/rohitdayal-jktech/jk-intellitech
- Repository: https://github.com/rohitdayal-jktech/jk-intellitech

## Overview

##### Project type and purpose
- This is a full-stack web application:
– Frontend: a React single-page application (SPA) that lets users browse, search, and add recipes.
– Backend: a FastAPI-based REST API that serves and persists recipe data.
- Purpose: provide a simple “Food Recipe Book” where clients can view and add recipes via HTTP.

##### File structure
- Top-level directories:
– backend/
- main.py – FastAPI app defining endpoints (/, /api/recipes).
- recipes.json – flat-file data store for recipes.
- requirements.txt – Python dependencies.
– frontend/
- public/ – static HTML template + manifest.
- src/ – React source code:
· components/ (RecipeCard, RecipeForm)
· pages/ (Home, RecipeDetail)
· App.js, index.js – entry points.
- package.json / package-lock.json – Node dependencies and scripts.
- Configuration & scripts:
– uvicorn command in README to run backend.
– npm start for frontend.

##### README for additional insights
- Tech stack: FastAPI, Uvicorn, React, React Router DOM, Axios.
- Architecture hints: SPA front-end communicates with REST API, JSON storage.
- Features: health check, list recipes, add new recipes, client-side routing.

a. Main components
– Client Browser / User Interface
– React Frontend (SPA)
– FastAPI Backend (REST API)
– Data Store (recipes.json)
– External libraries/services (Uvicorn server, Axios HTTP client)
b. Relationships & interactions
1. User ⟷ Browser UI
2. Browser UI ⟶ React Router (client-side routing)
3. React components ⟶ Axios HTTP calls → FastAPI endpoints
4. FastAPI handlers ⟶ Read/Write → recipes.json file
5. FastAPI health check endpoint ← Browser/monitoring
c. Architectural patterns & principles
– Client-Server separation (frontend as SPA, backend as stateless REST API)
– Layered design: Presentation (React) → API layer (FastAPI) → Data layer (JSON store)
– RESTful endpoints for CRUD operations
d. Key technologies/frameworks
– React, React Router DOM, Axios
– FastAPI, Uvicorn, Python 3.x
– JSON file for persistence

##### Detail without overcomplication
- Essential components—don’t omit the health check endpoint or the JSON store.
- Internal subdivisions if needed (e.g., list out React pages or FastAPI routers).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        User["User"]
        Browser["Browser UI"]:::frontend
        Static["index.html"]:::frontend
        Index["index.js"]:::frontend
        App["App.js"]:::frontend
        Router["React Router"]:::frontend
        Home["Home.js (List/Search)"]:::frontend
        Detail["RecipeDetail.js"]:::frontend
        Form["RecipeForm.js"]:::frontend
        Card["RecipeCard.js"]:::frontend
        Pack["package.json"]:::frontend
    end

    %% API Layer
    subgraph "API Layer"
        direction TB
        API["FastAPI Service\n(main.py)"]:::backend
        Req["requirements.txt"]:::backend
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        DB["recipes.json"]:::data
    end

    %% Connections
    User -->|"interacts"| Browser
    Browser -->|"serves static"| Static
    Static -->|"loads"| Index
    Index -->|"mounts"| App
    App -->|"uses"| Router
    Router -->|"route to Home"| Home
    Router -->|"route to Detail"| Detail
    Router -->|"route to Form"| Form
    Home -->|"renders"| Card
    Home -->|"GET /api/recipes"| API
    Form -->|"POST /api/recipes"| API
    Browser -->|"GET /health"| API
    API -->|"read/write"| DB

    %% Click Events
    click Browser "https://github.com/rohitdayal-jktech/jk-intellitech/tree/main/frontend/"
    click Static "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/frontend/public/index.html"
    click Index "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/frontend/src/index.js"
    click App "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/frontend/src/App.js"
    click Router "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/frontend/src/App.js"
    click Home "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/frontend/src/pages/Home.js"
    click Detail "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/frontend/src/pages/RecipeDetail.js"
    click Form "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/frontend/src/components/RecipeForm.js"
    click Card "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/frontend/src/components/RecipeCard.js"
    click Pack "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/frontend/package.json"
    click API "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/backend/main.py"
    click Req "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/requirements.txt"
    click DB "https://github.com/rohitdayal-jktech/jk-intellitech/blob/main/backend/recipes.json"

    %% Styles
    classDef frontend fill:#D6EAF8,stroke:#1F618D,stroke-width:1px;
    classDef backend fill:#D5F5E3,stroke:#196F3D,stroke-width:1px;
    classDef data fill:#FCF3CF,stroke:#B9770E,stroke-width:1px;
```
