# thanhgiau2604/hotel-room-management architecture

> Architecture diagram of the GitHub repository thanhgiau2604/hotel-room-management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thanhgiau2604/hotel-room-management
- Repository: https://github.com/thanhgiau2604/hotel-room-management

## Overview

##### Main Components

A. Frontend Layer:
- Nuxt.js Application (Client-side)
- PrimeVue UI Components (extensive component library)
- Vue Store (Pinia) for state management
- Pages and Routing structure

B. Backend Layer:
- Nuxt Server-side components
- Firebase Integration
- Authentication Service
- Real-time Database/Firestore

**┌─────────────────────────────────────────────────────────┐**
- Client Browser                        │
- ┬─────────────────────────────┘
- ↓
**┌─────────────────────────────────────────────────────────┐**
- Nuxt.js Application                   │
- ┬─────────────────┬────────────────────┤
- Pages Layer   │  Components     │    Assets          │
- /login      │  - LeftPanel    │    - PrimeVue CSS  │
- /about      │  - RoomCard     │    - SCSS          │
- ┬────────┴────────┬────────┴────────────────────┘
- ↓                 ↓
**┌────────────────┐ ┌──────────────────┐**
- Store Layer   │ │   Utils Layer    │
- rooms.ts    │ │   - firebase.ts  │
- setting.ts  │ │   - toast.ts     │
- ┬────────┘ └─────────┬────────┘

- ↓                    ↓
**┌─────────────────────────────────────────────────────────┐**
- Firebase Services                        │
- ┬─────────────────┬────────────────────┤
- Authentication │  Firestore/RTDB │  Cloud Functions    │
- ┴─────────────────┴────────────────────┘

##### Important Elements to Highlight

a. Client-Side Features:
- Room management interface (RoomList, RoomCard)
- Authentication flow (/login)
- Modal components (CustomerInfo, RoomConfig)
- State management with Pinia stores

b. Firebase Integration:
- Real-time data synchronization
- Authentication services
- Database operations

##### Deployment Architecture

Deployment flow:
**Development → Build → Production**
**(Local:3000) → (yarn build) → (Deployed Instance)**

- The application's overall architecture
- How components interact with each other
- The data flow between frontend and Firebase
- The role of each major subsystem
- The deployment and build process

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Browser"]
        Browser["Web Browser"]
    end

    subgraph NuxtApp["Nuxt.js Application"]
        subgraph Pages["Pages Layer"]
            Login["Login Page"]:::page
            About["About Page"]:::page
            Index["Main Page"]:::page
        end

        subgraph Components["Components Layer"]
            LeftPanel["Left Panel"]:::component
            RoomCard["Room Card"]:::component
            RoomList["Room List"]:::component
            
            subgraph Modals["Modal Components"]
                CustomerInfo["Customer Info"]:::component
                RoomConfig["Room Config"]:::component
            end
        end

        subgraph Assets["Assets Layer"]
            PrimeVue["PrimeVue CSS"]:::asset
            GlobalStyles["Global Styles"]:::asset
            ResetStyles["Reset Styles"]:::asset
        end

        subgraph Store["Store Layer"]
            RoomsStore["Rooms Store"]:::store
            SettingsStore["Settings Store"]:::store
        end

        subgraph Utils["Utils Layer"]
            FirebaseUtils["Firebase Utils"]:::util
            ToastUtils["Toast Utils"]:::util
            GeneralUtils["General Utils"]:::util
        end

        subgraph Config["Configuration"]
            NuxtConfig["Nuxt Config"]:::config
            TSConfig["TypeScript Config"]:::config
            TailwindConfig["Tailwind Config"]:::config
        end
    end

    subgraph Firebase["Firebase Services"]
        Auth["Authentication"]:::firebase
        Firestore["Firestore/RTDB"]:::firebase
        CloudFunctions["Cloud Functions"]:::firebase
    end

    %% Relationships
    Browser --> Login
    Browser --> About
    Browser --> Index

    Login --> Auth
    Components --> Store
    Store <--> Firebase
    Utils --> Firebase

    %% Click Events
    click Login "https://github.com/thanhgiau2604/hotel-room-management/blob/main/pages/login/index.vue"
    click About "https://github.com/thanhgiau2604/hotel-room-management/blob/main/pages/about/index.vue"
    click Index "https://github.com/thanhgiau2604/hotel-room-management/blob/main/pages/index.vue"
    click LeftPanel "https://github.com/thanhgiau2604/hotel-room-management/blob/main/components/LeftPanel.vue"
    click RoomCard "https://github.com/thanhgiau2604/hotel-room-management/blob/main/components/RoomCard.vue"
    click RoomList "https://github.com/thanhgiau2604/hotel-room-management/blob/main/components/RoomList.vue"
    click CustomerInfo "https://github.com/thanhgiau2604/hotel-room-management/blob/main/components/modals/CustomerInfo.vue"
    click RoomConfig "https://github.com/thanhgiau2604/hotel-room-management/blob/main/components/modals/RoomConfig.vue"
    click RoomsStore "https://github.com/thanhgiau2604/hotel-room-management/blob/main/stores/rooms.ts"
    click SettingsStore "https://github.com/thanhgiau2604/hotel-room-management/blob/main/stores/setting.ts"
    click PrimeVue "https://github.com/thanhgiau2604/hotel-room-management/tree/main/assets/primevue"
    click GlobalStyles "https://github.com/thanhgiau2604/hotel-room-management/blob/main/assets/scss/_global.scss"
    click ResetStyles "https://github.com/thanhgiau2604/hotel-room-management/blob/main/assets/scss/_reset.scss"
    click FirebaseUtils "https://github.com/thanhgiau2604/hotel-room-management/blob/main/utils/firebase.ts"
    click ToastUtils "https://github.com/thanhgiau2604/hotel-room-management/blob/main/utils/toast.ts"
    click GeneralUtils "https://github.com/thanhgiau2604/hotel-room-management/blob/main/utils/index.ts"
    click NuxtConfig "https://github.com/thanhgiau2604/hotel-room-management/blob/main/nuxt.config.ts"
    click TSConfig "https://github.com/thanhgiau2604/hotel-room-management/blob/main/tsconfig.json"
    click TailwindConfig "https://github.com/thanhgiau2604/hotel-room-management/blob/main/tailwind.config.js"

    %% Styles
    classDef page fill:#4299e1,color:white
    classDef component fill:#63b3ed,color:white
    classDef asset fill:#9f7aea,color:white
    classDef store fill:#48bb78,color:white
    classDef util fill:#718096,color:white
    classDef firebase fill:#ed8936,color:white
    classDef config fill:#ecc94b,color:black

    %% Legend
    subgraph Legend
        L1["Page"]:::page
        L2["Component"]:::component
        L3["Asset"]:::asset
        L4["Store"]:::store
        L5["Utility"]:::util
        L6["Firebase Service"]:::firebase
        L7["Configuration"]:::config
    end
```
