# rigzin00/guesthouse-web architecture

> Architecture diagram of the GitHub repository rigzin00/guesthouse-web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rigzin00/guesthouse-web
- Repository: https://github.com/rigzin00/guesthouse-web

## Overview

##### Main Components
- Frontend Application Shell:
- index.html: The main HTML entry point.
- main.tsx: The app’s entry script that renders the React tree.
- App.tsx: The root React component which bootstraps the app.
- UI Components:
- src/components folder: Includes components like AuthModal.tsx and BookingModal.tsx that likely represent modals for authentication and booking functionalities.
- External Integrations:
- src/lib/supabase.ts: A module for interfacing with Supabase, suggesting the app is using external data services for its business logic and persistence.
- Development & Build Configurations:
- Vite, ESLint, Tailwind CSS, and PostCSS config files in the root indicate the tools for development, styling, and building the project.

##### Relationships and Interactions
- Entry Flow: The browser loads index.html, which in turn allows main.tsx to bootstrap the React application.
- Component Hierarchy: App.tsx acts as a container for various child components (such as the AuthModal and BookingModal) that are rendered based on user interactions or state.
- External Service Interaction: The supabase.ts module encapsulates any API calls or data fetching, showing a dependency from UI components (or custom hooks) towards this library function.
- Development Environment: The presence of configuration files (Vite, Tailwind, ESLint, etc.) shows a clear separation between development tooling and the runtime application code.

##### Architectural Patterns
- Modular Component Architecture: The clear separation into different components (modals, etc.) suggests an emphasis on reusability.
- Configuration-driven Setup: The use of multiple configuration files enables a robust development, linting, and building process.
- External Data Layer: Integration with Supabase hints at using a client-side abstraction layer for accessing external services.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Application Shell"
        INDEX["index.html"]:::frontend
        MAIN["main.tsx"]:::frontend
        APP["App.tsx"]:::frontend
    end

    subgraph "UI Components"
        AUTH["AuthModal"]:::frontend
        BOOK["BookingModal"]:::frontend
    end

    subgraph "External Integrations"
        SUP["Supabase Integration"]:::external
    end

    subgraph "Development & Build Configurations"
        VITE["Vite Configuration"]:::config
        ESLINT["ESLint Configuration"]:::config
        TAILWIND["Tailwind CSS Configuration"]:::config
        POSTCSS["PostCSS Configuration"]:::config
    end

    %% Main Flow
    INDEX -->|"loads"| MAIN
    MAIN -->|"bootstraps"| APP
    APP -->|"renders"| AUTH
    APP -->|"renders"| BOOK

    %% External Service Interaction
    AUTH -->|"calls"| SUP
    BOOK -->|"calls"| SUP

    %% Styling Definitions
    classDef frontend fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef external fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
    classDef config fill:#FFCDD2,stroke:#B71C1C,stroke-width:2px;

    %% Click Events
    click INDEX "https://github.com/rigzin00/guesthouse-web/blob/master//index.html"
    click MAIN "https://github.com/rigzin00/guesthouse-web/blob/master//src/main.tsx"
    click APP "https://github.com/rigzin00/guesthouse-web/blob/master//src/App.tsx"
    click AUTH "https://github.com/rigzin00/guesthouse-web/blob/master//src/components/AuthModal.tsx"
    click BOOK "https://github.com/rigzin00/guesthouse-web/blob/master//src/components/BookingModal.tsx"
    click SUP "https://github.com/rigzin00/guesthouse-web/blob/master//src/lib/supabase.ts"
    click VITE "https://github.com/rigzin00/guesthouse-web/blob/master//vite.config.ts"
    click ESLINT "https://github.com/rigzin00/guesthouse-web/blob/master//eslint.config.js"
    click TAILWIND "https://github.com/rigzin00/guesthouse-web/blob/master//tailwind.config.js"
    click POSTCSS "https://github.com/rigzin00/guesthouse-web/blob/master//postcss.config.js"
```
