# namhoai1109/tabi-partner architecture

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

- Interactive diagram: https://gitdiagram.com/namhoai1109/tabi-partner
- Repository: https://github.com/namhoai1109/tabi-partner

## Overview

##### Main System Components

a) Frontend Layer (Client-Side)
- React Application Core
- Authentication Module
- Internationalization System (i18n)
- State Management (Valtio)
- Routing System
- Query Management (React Query)

b) Feature Modules
- Booking Management
- Branch Management
- Room Management
- Revenue Management
- Statistics/Analytics

c) External Services Integration
- Backend API Services (currently mocked)
- File Storage Service
- Authentication Service

##### Component Relationships

a) Core Architecture Flow:
**User Interface → React Components → Services Layer → External APIs**

b) Data Flow Patterns:
- API Calls (React Query)
- State Updates (Valtio)
- Route Changes (Ant Design Pro Router)

##### Detailed Component Breakdown

a) UI Layer
- Pages (src/pages/*)
- Authentication (SignIn/SignUp)
- Dashboard Views
- Management Interfaces
- Components (src/components/*)
- Core Components
- Common Components
- Feature-specific Components

b) Service Layer (src/services/*)
- Authentication Services
- Booking Services
- Branch Services
- Room Services
- File Services
- Company Services

c) Support Systems
- Internationalization (src/locales/*)
- Utilities (src/utils/*)
- Hooks (src/hooks/*)
- Constants (src/constants/*)

##### Implementation Details

a) Technology Stack:
- React as the core framework
- Ant Design Pro for UI components
- React Query for data fetching
- Valtio for state management
- TailwindCSS for styling

b) Key Features:
- Multi-language support (en/vn)
- Authentication flows
- Booking management
- Revenue tracking
- Statistics visualization

##### Cross-cutting Concerns (Auth, i18n)

This system design should effectively communicate the architecture of this accommodation management platform while maintaining clarity and providing sufficient detail for implementation understanding.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        UI[UI Component]:::ui
        SVC[Service]:::service
        EXT[External Service]:::external
        UTIL[Utility]:::util
        STATE[State Management]:::state
    end

    subgraph "Frontend Layer"
        UI_Core[React Application Core]:::ui
        
        subgraph "Core Systems"
            Auth[Authentication Module]:::core
            I18n[Internationalization]:::core
            Router[Routing System]:::core
            Layout[Layout System]:::core
            StateManagement[Valtio State]:::state
            QueryManagement[React Query]:::state
        end

        subgraph "Feature Modules"
            Booking[Booking Management]:::feature
            Branch[Branch Management]:::feature
            Room[Room Management]:::feature
            RoomType[Room Type Management]:::feature
            Company[Company Management]:::feature
        end

        subgraph "Component Layer"
            CoreComp[Core Components]:::ui
            CommonComp[Common Components]:::ui
        end

        subgraph "Support Systems"
            Utils[Utilities]:::util
            Hooks[Custom Hooks]:::util
            Constants[Constants]:::util
        end
    end

    subgraph "Service Layer"
        AuthService[Authentication Service]:::service
        BookingService[Booking Service]:::service
        BranchService[Branch Service]:::service
        RoomService[Room Service]:::service
        RoomTypeService[Room Type Service]:::service
        FileService[File Service]:::service
        CompanyService[Company Service]:::service
        FacilityService[Facility Service]:::service
    end

    subgraph "External Services"
        MockAPI[Mock API Services]:::external
        FileStorage[File Storage]:::external
        AuthProvider[Auth Provider]:::external
    end

    UI_Core --> Auth
    UI_Core --> I18n
    UI_Core --> Router
    UI_Core --> Layout
    UI_Core --> StateManagement
    UI_Core --> QueryManagement

    Auth --> AuthService
    Booking --> BookingService
    Branch --> BranchService
    Room --> RoomService
    RoomType --> RoomTypeService
    Company --> CompanyService

    AuthService --> MockAPI
    BookingService --> MockAPI
    BranchService --> MockAPI
    RoomService --> MockAPI
    RoomTypeService --> MockAPI
    FileService --> FileStorage
    CompanyService --> MockAPI
    FacilityService --> MockAPI

    classDef ui fill:#2196F3,stroke:#1565C0,color:white
    classDef service fill:#4CAF50,stroke:#2E7D32,color:white
    classDef external fill:#FF9800,stroke:#EF6C00,color:white
    classDef util fill:#9E9E9E,stroke:#616161,color:white
    classDef state fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef core fill:#3F51B5,stroke:#283593,color:white
    classDef feature fill:#00BCD4,stroke:#00838F,color:white

    click Auth "https://github.com/namhoai1109/tabi-partner/tree/main/src/pages/SignIn"
    click I18n "https://github.com/namhoai1109/tabi-partner/tree/main/src/locales"
    click Router "https://github.com/namhoai1109/tabi-partner/blob/main/config/routes.ts"
    click Layout "https://github.com/namhoai1109/tabi-partner/tree/main/src/layouts"
    click Booking "https://github.com/namhoai1109/tabi-partner/tree/main/src/pages/Bookings"
    click Branch "https://github.com/namhoai1109/tabi-partner/tree/main/src/pages/Branches"
    click Room "https://github.com/namhoai1109/tabi-partner/tree/main/src/pages/Rooms"
    click RoomType "https://github.com/namhoai1109/tabi-partner/tree/main/src/pages/RoomTypes"
    click FileService "https://github.com/namhoai1109/tabi-partner/tree/main/src/services/file"
    click CoreComp "https://github.com/namhoai1109/tabi-partner/tree/main/src/components/core"
    click CommonComp "https://github.com/namhoai1109/tabi-partner/tree/main/src/components/common"
    click Utils "https://github.com/namhoai1109/tabi-partner/tree/main/src/utils"
    click Hooks "https://github.com/namhoai1109/tabi-partner/tree/main/src/hooks"
    click Constants "https://github.com/namhoai1109/tabi-partner/tree/main/src/constants"
    click MockAPI "https://github.com/namhoai1109/tabi-partner/tree/main/mock"
    click Company "https://github.com/namhoai1109/tabi-partner/tree/main/src/pages/Company"
    click FacilityService "https://github.com/namhoai1109/tabi-partner/tree/main/src/services/facility"
```
