# m3ayush/hostelinsight architecture

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

- Interactive diagram: https://gitdiagram.com/m3ayush/hostelinsight
- Repository: https://github.com/m3ayush/hostelinsight

## Overview

##### Project type and purpose
- This is a single-page front-end application (built with React, TypeScript, and Vite) that provides a student and admin dashboard for services such as room booking, leave applications, complaints, feedback, laundry requests, late entries, etc.
- It integrates with Firebase (presumably for authentication and data storage) and an external AI service (the Gemini API) to power AI Studio features.

##### File structure
- Top-level:
- App.tsx, index.tsx, index.html: React entry points
- vite.config.ts, tsconfig.json, package.json: build and configuration
- firebase.ts: Firebase SDK initialization
- constants.ts, types.ts, metadata.json: shared types and static data
- components/: feature-based React components
- components/admin/: admin-specific views
- No backend directory—this is purely front-end; backend functions are handled by Firebase and the external Gemini API.

##### README
- Confirms local setup steps (npm install, .env.local for GEMINI_API_KEY, npm run dev).
- Mentions AI Studio hosting but no internal server code—deployment likely serves static assets.

##### Key points to capture
- The SPA’s feature modules (e.g., BookingModal, AdminDashboard) live entirely in the browser.
- Firebase provides authentication and persistent storage—no custom servers.
- Gemini API is the only external third-party service for AI functionality.
- Vite dev server vs. static hosting in production—two different deployment contexts.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Development & Build"
        VITE["Vite Dev Server\n(npm run dev)"]:::client
        VC["vite.config.ts"]:::config
        TS["tsconfig.json"]:::config
        PKG["package.json"]:::config
        INS["index.html"]:::client
        IDX["index.tsx"]:::client
        APP["App.tsx"]:::client

        VITE --> VC
        VITE --> TS
        VITE --> PKG
        VITE --> INS
        INS --> IDX
        IDX --> APP

        click VC "https://github.com/m3ayush/hostelinsight/blob/main/vite.config.ts"
        click TS "https://github.com/m3ayush/hostelinsight/blob/main/tsconfig.json"
        click PKG "https://github.com/m3ayush/hostelinsight/blob/main/package.json"
        click INS "https://github.com/m3ayush/hostelinsight/blob/main/index.html"
        click IDX "https://github.com/m3ayush/hostelinsight/blob/main/index.tsx"
        click APP "https://github.com/m3ayush/hostelinsight/blob/main/App.tsx"
    end

    subgraph "Client Side"
        SPA["React SPA"]:::client

        subgraph "Core Student Features"
            AUTH["Auth.tsx"]:::client
            DS["Dashboard.tsx"]:::client
            HDR["Header.tsx"]:::client
            PD["PersonalDetails.tsx"]:::client
            RB["RoomBooking.tsx"]:::client
            RC["RoomChange.tsx"]:::client
            LA["LeaveApply.tsx"]:::client
            LT["LateEntry.tsx"]:::client
            LS["LaundryService.tsx"]:::client
            MM["MessMenu.tsx"]:::client
            CMP["Complaint.tsx"]:::client
            FB["Feedback.tsx"]:::client
            NM["NotificationModal.tsx"]:::client
            BM["BookingModal.tsx"]:::client
        end

        subgraph "Admin Features"
            AD["AdminDashboard.tsx"]:::client
            AL["AdminLateEntryRequests.tsx"]:::client
            AR["AdminLeaveRequests.tsx"]:::client
            CV["ComplaintsView.tsx"]:::client
            FV["FeedbackView.tsx"]:::client
            RR["RoomChangeRequests.tsx"]:::client
            SD["StudentDatabase.tsx"]:::client
        end

        IC["IconMap.tsx"]:::client

        click AUTH "https://github.com/m3ayush/hostelinsight/blob/main/components/Auth.tsx"
        click DS "https://github.com/m3ayush/hostelinsight/blob/main/components/Dashboard.tsx"
        click HDR "https://github.com/m3ayush/hostelinsight/blob/main/components/Header.tsx"
        click PD "https://github.com/m3ayush/hostelinsight/blob/main/components/PersonalDetails.tsx"
        click RB "https://github.com/m3ayush/hostelinsight/blob/main/components/RoomBooking.tsx"
        click RC "https://github.com/m3ayush/hostelinsight/blob/main/components/RoomChange.tsx"
        click LA "https://github.com/m3ayush/hostelinsight/blob/main/components/LeaveApply.tsx"
        click LT "https://github.com/m3ayush/hostelinsight/blob/main/components/LateEntry.tsx"
        click LS "https://github.com/m3ayush/hostelinsight/blob/main/components/LaundryService.tsx"
        click MM "https://github.com/m3ayush/hostelinsight/blob/main/components/MessMenu.tsx"
        click CMP "https://github.com/m3ayush/hostelinsight/blob/main/components/Complaint.tsx"
        click FB "https://github.com/m3ayush/hostelinsight/blob/main/components/Feedback.tsx"
        click NM "https://github.com/m3ayush/hostelinsight/blob/main/components/NotificationModal.tsx"
        click BM "https://github.com/m3ayush/hostelinsight/blob/main/components/BookingModal.tsx"

        click AD "https://github.com/m3ayush/hostelinsight/blob/main/components/admin/AdminDashboard.tsx"
        click AL "https://github.com/m3ayush/hostelinsight/blob/main/components/admin/AdminLateEntryRequests.tsx"
        click AR "https://github.com/m3ayush/hostelinsight/blob/main/components/admin/AdminLeaveRequests.tsx"
        click CV "https://github.com/m3ayush/hostelinsight/blob/main/components/admin/ComplaintsView.tsx"
        click FV "https://github.com/m3ayush/hostelinsight/blob/main/components/admin/FeedbackView.tsx"
        click RR "https://github.com/m3ayush/hostelinsight/blob/main/components/admin/RoomChangeRequests.tsx"
        click SD "https://github.com/m3ayush/hostelinsight/blob/main/components/admin/StudentDatabase.tsx"

        click IC "https://github.com/m3ayush/hostelinsight/blob/main/components/icons/IconMap.tsx"
    end

    subgraph "Production"
        HOST["Static Hosting\n(npm run build)"]:::client
    end

    firebase["Firebase Services\n(Auth, Firestore, Storage)"]:::service
    GEM["Gemini AI API"]:::external

    VITE -->|serves| SPA
    SPA -->|initializes| AUTH
    SPA -->|uses| firebase
    SPA -->|calls| GEM
    APP -->|builds| HOST
    click firebase "https://github.com/m3ayush/hostelinsight/blob/main/firebase.ts"

    classDef client fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef service fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#FFA500,stroke:#000,stroke-width:1px
    classDef config fill:#D3D3D3,stroke:#000,stroke-width:1px
```
