# anujbag012/fortscape-visuals architecture

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

- Interactive diagram: https://gitdiagram.com/anujbag012/fortscape-visuals
- Repository: https://github.com/anujbag012/fortscape-visuals

## Overview

##### Main components
a. Developer Environment
- IDE/Code Editor
- Git/GitHub (Version Control)
- Node.js & npm
b. Build Toolchain
- Vite Dev Server (Dev-Time HMR)
- TypeScript Compiler
- PostCSS & Tailwind CSS Processor
c. Project Static Assets
- public/index.html, robots.txt, assets
d. React SPA
- Entry Point: src/main.tsx → App.tsx
- Router & Pages (src/pages)
- Sections Components (src/components/sections)
- UI Components Library (src/components/ui + shadcn-ui)
- Hooks (src/hooks) & Utilities (src/lib/utils.ts)
e. Hosting & Deployment
- Lovable Hosting / Static File Host (Netlify, Vercel, etc.)
- Custom Domain (optional)
f. End User
- Web Browser

##### Relationships and data flow
- Developer edits code → commits to GitHub → triggers CI or direct build
- npm install & “npm run dev” launches Vite Dev Server
- Vite watches source, compiles TS, applies Tailwind CSS → serves SPA assets
- On build (“npm run build”), Vite bundles React code + CSS → outputs static files
- Static files are deployed to Lovable Hosting
- Browser requests index.html → loads JS/CSS → React hydrates the SPA
- User navigates via React Router → components render (UI library + custom sections)

##### Architectural patterns
- SPA architecture with client‐side routing
- Component‐based UI (atomic UI in src/components/ui + domain sections in src/components/sections)
- Separation of concerns:
– Layout & Pages (src/pages)
– Reusable UI primitives (buttons, dialogs, cards…)
– Business/feature sections (tourist‐spots, places)
– Shared hooks and utilities
- Build‐time CSS extraction and tree‐shaking via Tailwind & Vite

##### Relevant technologies
- React & React Router (client‐side rendering)
- TypeScript (static typing)
- Vite (dev server + bundler)
- Tailwind CSS + PostCSS (utility‐first CSS)
- shadcn-ui (prebuilt React components styled with Tailwind)

- Labels for technologies and functions (e.g., “TypeScript Compiler”, “Tailwind Processor”)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        DeveloperMachine["Developer Machine"]:::dev
        IDE["IDE/Code Editor"]:::dev
        GitHub["GitHub (Version Control)"]:::dev
        NodeNpm["Node.js & npm"]:::dev
    end

    DeveloperMachine -->|"edits code"| IDE
    IDE -->|"commits code"| GitHub
    DeveloperMachine -->|"installs packages"| NodeNpm

    %% Build Toolchain
    subgraph "Build Toolchain"
        ViteDevServer["Vite Dev Server & Build Pipeline"]:::build
        TSCompiler["TypeScript Compiler"]:::build
        TailwindProcessor["PostCSS & Tailwind CSS Processor"]:::build
    end

    GitHub -->|"trigger build"| ViteDevServer
    NodeNpm -->|"npm run dev / build"| ViteDevServer
    ViteDevServer -->|"compiles TS"| TSCompiler
    ViteDevServer -->|"processes CSS"| TailwindProcessor

    %% Static Assets
    subgraph "Project Static Assets"
        publicIndex["public/index.html"]:::runtime
        robotsTxt["public/robots.txt"]:::runtime
        assets["src/assets"]:::runtime
    end

    TailwindProcessor --> publicIndex
    TailwindProcessor --> robotsTxt
    TailwindProcessor --> assets

    %% Build Output and Deployment
    BuildOutput["Static Files Output"]:::build
    ViteDevServer -->|"bundles React + CSS"| BuildOutput

    subgraph "Hosting & Deployment"
        StaticHost["Lovable Static File Host"]:::build
        CustomDomain["Custom Domain"]:::external
    end

    BuildOutput --> StaticHost
    StaticHost --> CustomDomain

    %% Runtime: Browser & SPA
    subgraph "Runtime (Browser & SPA)" 
        Browser["Web Browser"]:::runtime
        subgraph "React SPA Internals"
            Entry["Entry Point (src/main.tsx)"]:::runtime
            AppComp["Root App (src/App.tsx)"]:::runtime
            Router["Router & Pages"]:::runtime
            Pages["Pages (src/pages)"]:::runtime
            Sections["Section Components (src/components/sections)"]:::runtime
            UI["UI Components Library (src/components/ui)"]:::runtime
            Hooks["Shared Hooks (src/hooks)"]:::runtime
            Utils["Utilities (src/lib/utils.ts)"]:::runtime
        end
    end

    Browser -->|"requests index.html"| StaticHost
    Browser -->|"loads JS/CSS"| Entry
    Entry --> AppComp
    AppComp --> Router
    Router --> Pages
    Pages --> Sections
    Pages --> UI
    Pages --> Hooks
    Pages --> Utils
    Browser -->|"user interactions"| Router

    %% Click Events
    click ViteDevServer "https://github.com/anujbag012/fortscape-visuals/blob/main/vite.config.ts"
    click TSCompiler "https://github.com/anujbag012/fortscape-visuals/blob/main/tsconfig.json"
    click TailwindProcessor "https://github.com/anujbag012/fortscape-visuals/blob/main/postcss.config.js"
    click publicIndex "https://github.com/anujbag012/fortscape-visuals/blob/main/public/index.html"
    click robotsTxt "https://github.com/anujbag012/fortscape-visuals/blob/main/public/robots.txt"
    click assets "https://github.com/anujbag012/fortscape-visuals/tree/main/src/assets"
    click Entry "https://github.com/anujbag012/fortscape-visuals/blob/main/src/main.tsx"
    click AppComp "https://github.com/anujbag012/fortscape-visuals/blob/main/src/App.tsx"
    click Pages "https://github.com/anujbag012/fortscape-visuals/tree/main/src/pages"
    click Sections "https://github.com/anujbag012/fortscape-visuals/tree/main/src/components/sections"
    click UI "https://github.com/anujbag012/fortscape-visuals/tree/main/src/components/ui"
    click Hooks "https://github.com/anujbag012/fortscape-visuals/tree/main/src/hooks"
    click Utils "https://github.com/anujbag012/fortscape-visuals/blob/main/src/lib/utils.ts"

    %% Styles
    classDef dev fill:#D0E8FF,stroke:#0366D6
    classDef build fill:#DEF6DE,stroke:#028A0F
    classDef runtime fill:#FFEFD0,stroke:#D97706
    classDef external fill:none,stroke:#888,stroke-dasharray:5 5
```
