# satyanandyadav/bhive-assignment architecture

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

- Interactive diagram: https://gitdiagram.com/satyanandyadav/bhive-assignment
- Repository: https://github.com/satyanandyadav/bhive-assignment

## Overview

##### Project type and purpose
- This is a single‐page, client‐side React/TypeScript application (“Co-Working space seat booking application”) delivered as a static site (deployed via Vercel).
- There is no custom backend in this repo; all data is bundled in a local JSON file and the app runs entirely in the browser.

##### File structure
- Top‐level artifacts:
- package.json, tsconfig.json, tailwind.config.js – project configuration & build
- public/ – index.html, manifest, static hosting config
- src/ – all application code, subdivided into:
– src/index.tsx + reportWebVitals.ts – app entry point & performance hooks
– src/App.tsx/.css/.test.tsx – root app component, global styles, test
– src/pages/ – page‐level containers (Home)
– src/components/ – reusable presentational & container UI components (Header, Footer, SpaceCard, etc.)
– src/Resuables & src/Constant & src/interfaces – shared constants, TypeScript interfaces
– src/data/data.json – static data source
– src/ui/lib – shared utility functions

##### README for additional insights
- Confirms it’s a seat-booking front-end, deployed at a static URL.
- No mention of external APIs or microservices; app is fully static on the client.

a. Hosting & Delivery:
– Developer’s Machine → Build Process (Node, NPM scripts, Webpack/Babel, Tailwind) → Vercel CDN / Static File Hosting
b. Client‐side Runtime:
– Browser (Chrome, etc.) loads static index.html → React App Bundle
– React App Core (App.tsx) initializes:
- Context Provider (src/components/Context) for global state
- Routes / Pages (Home)
- UI Components (Header, Footer, SpaceOverview, BhiveAppDetails, CoWorkingFacilities, SpaceCard, etc.)
– Data Layer:
- Local JSON data (src/data/data.json) imported via ES modules
– Assets & Styling:
c. Build & Test:
– Unit Tests (Jest + React Testing Library via src/App.test.tsx, setupTests.ts)
– TypeScript compilation (tsconfig.json)
– Tailwind build (tailwind.config.js)

##### Relationships and interactions
- Within React: App → Context Provider → passes state to child components
- Components → import & render data from data.json
- Components → apply styles from Tailwind CSS + custom CSS
- Build tools → produce optimized static assets for deployment
- Test suite runs against the bundled React components before production build

##### Architectural patterns & design principles
- Component‐based UI (container vs presentational)
- Single‐Page Application (SPA) with client‐side routing (if future)
- Context API for lightweight global state
- Static data import (no runtime API calls)
- CSS utility framework (Tailwind) + modular CSS

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Developer & Build Phase"
        style BuildPhase fill:#f0f0f0,stroke:#333,stroke-width:1px
        Dev["Developer's Machine"]:::build
        Pkg["package.json"]:::build
        PLock["package-lock.json"]:::build
        TSConf["tsconfig.json"]:::build
        TailConf["tailwind.config.js"]:::build
        Node["Node & NPM"]:::build
        BuildTools["Webpack/Babel & Tailwind"]:::build
        TS["TypeScript Compiler"]:::build
        Tests["Jest & React Testing Library"]:::test

        Dev --> Node
        Pkg --> BuildTools
        PLock --> BuildTools
        TSConf --> BuildTools
        TailConf --> BuildTools
        Node --> BuildTools --> TS --> Tests
        Tests -->|"runs tests"| BuildTools
        BuildTools -->|"produce static assets"| Assets["Static Assets"]:::build
    end

    subgraph "Hosting & Delivery"
        style Hosting fill:#D0E8FF,stroke:#333,stroke-width:1px
        CDN["Vercel CDN / Static File Hosting"]:::hosting
        PublicDir["/public"]:::hosting
        HTML["index.html"]:::hosting
        Manifest["manifest.json"]:::hosting
        Robots["robots.txt"]:::hosting

        Assets --> CDN
        CDN --> PublicDir
        PublicDir --> HTML
        PublicDir --> Manifest
        PublicDir --> Robots
        CDN -->|"HTTP GET"| Browser
    end

    Browser["Browser (Chrome, etc.)"]:::runtime
    Browser -->|"loads index.html"| HTML
    HTML -->|"loads JS/CSS bundles"| Bundle["main.bundle.js"]:::runtime

    subgraph "Client-side Runtime"
        style Runtime fill:#e0ffe0,stroke:#333,stroke-width:1px
        Entry["/src/index.tsx"]:::runtime
        WVitals["/src/reportWebVitals.ts"]:::runtime
        ReactApp["React App (App.tsx)"]:::runtime
        AppStyle["/src/App.css"]:::runtime
        Context["Context Provider"]:::runtime
        PagesIndex["/src/pages/index.tsx"]:::runtime
        HomePage["/src/pages/Home/index.tsx"]:::runtime
        ComponentsGroup["UI Components"]:::runtime
        Header["/src/components/Header/index.tsx"]:::runtime
        Footer["/src/components/Footer/index.tsx"]:::runtime
        SpaceCard["/src/components/SpaceCard/index.tsx"]:::runtime
        Data["Static Data (data.json)"]:::data
        Styles["/src/index.css & /src/assets/css/index.css"]:::runtime
        Utils["/src/ui/lib/utils.ts"]:::runtime
        Consts["/src/Constant/index.ts"]:::runtime
        Interfaces["/src/interfaces/index.ts"]:::runtime

        Bundle --> Entry --> WVitals --> ReactApp
        ReactApp --> AppStyle
        ReactApp --> Context
        ReactApp --> PagesIndex --> HomePage
        ReactApp --> ComponentsGroup
        ComponentsGroup --> Header
        ComponentsGroup --> Footer
        ComponentsGroup --> SpaceCard
        ComponentsGroup --> Styles
        ComponentsGroup --> Data
        ReactApp --> Utils
        ReactApp --> Consts
        ReactApp --> Interfaces
    end

    subgraph "Testing Setup"
        style TestSetup fill:#f9e0ff,stroke:#333,stroke-width:1px
        AppTest["/src/App.test.tsx"]:::test
        SetupTests["/src/setupTests.ts"]:::test
        ReactEnv["/src/react-app-env.d.ts"]:::test
        Tests --> AppTest
        Tests --> SetupTests
        Tests --> ReactEnv
    end

    classDef build fill:#f0f0f0,stroke:#333,stroke-width:1px
    classDef hosting fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef runtime fill:#e0ffe0,stroke:#333,stroke-width:1px
    classDef data fill:#FFE0B2,stroke:#333,stroke-width:1px
    classDef test fill:#F3E5F5,stroke:#333,stroke-width:1px

    click Pkg "https://github.com/satyanandyadav/bhive-assignment/blob/main//package.json"
    click PLock "https://github.com/satyanandyadav/bhive-assignment/blob/main//package-lock.json"
    click TSConf "https://github.com/satyanandyadav/bhive-assignment/blob/main//tsconfig.json"
    click TailConf "https://github.com/satyanandyadav/bhive-assignment/blob/main//tailwind.config.js"
    click HTML "https://github.com/satyanandyadav/bhive-assignment/blob/main//public/index.html"
    click Manifest "https://github.com/satyanandyadav/bhive-assignment/blob/main//public/manifest.json"
    click Robots "https://github.com/satyanandyadav/bhive-assignment/blob/main//public/robots.txt"
    click Entry "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/index.tsx"
    click WVitals "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/reportWebVitals.ts"
    click ReactApp "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/App.tsx"
    click AppStyle "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/App.css"
    click Context "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/components/Context/index.tsx"
    click PagesIndex "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/pages/index.tsx"
    click HomePage "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/pages/Home/index.tsx"
    click Header "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/components/Header/index.tsx"
    click Footer "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/components/Footer/index.tsx"
    click SpaceCard "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/components/SpaceCard/index.tsx"
    click Data "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/data/data.json"
    click Styles "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/index.css"
    click Utils "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/ui/lib/utils.ts"
    click Consts "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/Constant/index.ts"
    click Interfaces "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/interfaces/index.ts"
    click AppTest "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/App.test.tsx"
    click SetupTests "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/setupTests.ts"
    click ReactEnv "https://github.com/satyanandyadav/bhive-assignment/blob/main//src/react-app-env.d.ts"
```
