# siraajul/restora architecture

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

- Interactive diagram: https://gitdiagram.com/siraajul/restora
- Repository: https://github.com/siraajul/restora

## Overview

##### Main Components

A. Mobile Application (Client-Side)
- User Interface Layer
- On-boarding Module
- Authentication Module
- Home/Discovery Module
- Restaurant Module
- Search Module
- Profile Module
- Order Module
- Location Module

B. Backend Services
- API Layer
- Authentication Service
- Restaurant Management Service
- Order Processing Service
- Location Service
- Review & Rating Service

C. Database Layer
- User Data Store
- Restaurant Data Store
- Order Data Store
- Review Data Store

##### Architecture Pattern Representation

The project follows a modular architecture with BLoC pattern (evident from the blocs directory). Show this using:
- Clear separation between UI, Business Logic, and Data layers
- Module as a self-contained unit with its own UI, business logic, and data access
- Blue: UI Components
- Green: Business Logic (BLoC)
- Yellow: Services
- Red: Data Storage

##### Key Interactions to Highlight

- User authentication flow
- Restaurant discovery and search process
- Order placement and tracking flow
- Review and rating submission
- Location-based services interaction

##### Technical Stack Elements

- Flutter (Mobile Framework)
- Dio (HTTP Client)
- Local Storage
- External Services Integration

**┌─────────────┐**
- Component   │
- ┘

- ►

**╔════════════╗**
**║ API Gateway║**
**╚════════════╝**

##### Implementation Details

- Shared Components (from lib/shared/)
- Module-specific Components (from lib/modules/)
- Service Layer (from lib/shared/services/)
- Model Layer (from lib/shared/models/)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Mobile Application"]
        UI["User Interface Layer"]
        
        subgraph Modules["Core Modules"]
            OnBoard["Onboarding Module"]:::ui
            Auth["Authentication Module"]:::ui
            Home["Home/Discovery Module"]:::ui
            Rest["Restaurant Module"]:::ui
            Search["Search Module"]:::ui
            Profile["Profile Module"]:::ui
            Order["Order Module"]:::ui
            Location["Location Module"]:::ui
        end
        
        subgraph BLogic["Business Logic Layer"]
            AuthBLoC["Auth BLoC"]:::bloc
            RestBLoC["Restaurant BLoC"]:::bloc
            CategoryBLoC["Category BLoC"]:::bloc
            OrderBLoC["Order BLoC"]:::bloc
            LocationBLoC["Location BLoC"]:::bloc
        end
        
        subgraph Services["Service Layer"]
            HttpService["HTTP Service"]:::service
            DioService["DIO Service"]:::service
            CategoryService["Category Service"]:::service
        end
    end
    
    subgraph Backend["Backend Services"]
        API["API Gateway"]:::api
        AuthService["Authentication Service"]:::backend
        RestService["Restaurant Management Service"]:::backend
        OrderService["Order Processing Service"]:::backend
        LocService["Location Service"]:::backend
        ReviewService["Review & Rating Service"]:::backend
    end
    
    subgraph Data["Data Layer"]
        UserDB[("User Data Store")]:::database
        RestDB[("Restaurant Data Store")]:::database
        OrderDB[("Order Data Store")]:::database
        ReviewDB[("Review Data Store")]:::database
    end
    
    UI --> Modules
    Modules --> BLogic
    BLogic --> Services
    Services --> API
    API --> Backend
    Backend --> Data
    
    %% Component Mappings
    click OnBoard "https://github.com/siraajul/Restora/tree/main/lib/modules/on_boarding/"
    click Auth "https://github.com/siraajul/Restora/tree/main/lib/modules/login/"
    click Home "https://github.com/siraajul/Restora/tree/main/lib/modules/home/"
    click Rest "https://github.com/siraajul/Restora/tree/main/lib/modules/restaurant/"
    click Search "https://github.com/siraajul/Restora/tree/main/lib/modules/search/"
    click Profile "https://github.com/siraajul/Restora/tree/main/lib/modules/profile/"
    click Order "https://github.com/siraajul/Restora/tree/main/lib/modules/order/"
    click Location "https://github.com/siraajul/Restora/tree/main/lib/modules/location/"
    click HttpService "https://github.com/siraajul/Restora/blob/main/lib/shared/services/http_service.dart"
    click DioService "https://github.com/siraajul/Restora/tree/main/lib/shared/services/dio/"
    click CategoryService "https://github.com/siraajul/Restora/tree/main/lib/shared/services/category/"
    click CategoryBLoC "https://github.com/siraajul/Restora/tree/main/lib/shared/blocs/category/"
    
    %% Styling
    classDef ui fill:#2196F3,stroke:#1565C0,color:white
    classDef bloc fill:#4CAF50,stroke:#2E7D32,color:white
    classDef service fill:#FFC107,stroke:#FFA000,color:black
    classDef api fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef backend fill:#FF5722,stroke:#E64A19,color:white
    classDef database fill:#795548,stroke:#5D4037,color:white
    
    %% Legend
    subgraph Legend
        UI_L["UI Component"]:::ui
        BLOC_L["Business Logic"]:::bloc
        SERVICE_L["Service"]:::service
        API_L["API"]:::api
        BACKEND_L["Backend Service"]:::backend
        DB_L[("Database")]:::database
    end
```
