# chayan9991/service_booking_flutter_app architecture

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

- Interactive diagram: https://gitdiagram.com/chayan9991/service_booking_flutter_app
- Repository: https://github.com/chayan9991/service_booking_flutter_app

## Overview

##### Project type and purpose
- This is a cross-platform (Android, iOS, Web, macOS, Windows) Flutter client application for service booking, built with Clean Architecture.
- Core features include user authentication (Firebase Email/Password), service browsing and booking, and planned payment integration (Razorpay/Stripe) and admin panel.

##### File structure
- Top-level folders (android, ios, web, macos, windows) host platform-specific Flutter runners.
- The lib/ directory is organized by Clean Architecture layers:
– core/: utilities, themes, routing, DI setup
– data/: models, repositories (auth, etc.)
– logic/ or domain/: business services/use cases
– presentation/: UI screens, widgets, Bloc/Cubit state managers
- Configuration files: pubspec.yaml, firebase.json, flutterfire and build scripts under each platform.

##### README for additional insights
- Confirms Clean Architecture, dependency injection (get_it), state management (Cubit), and Firebase integration.
- Points to future modules: payment service, admin panel.

##### Detailed capture of architectural essentials
- Service Locator (get_it) injecting AuthRepositoryImpl into AuthCubit
- Data flow from LoginScreen → AuthCubit → AuthUseCase → AuthRepository → Firebase Auth
- Error-handling or state transitions in the Bloc/Cubit flow

## Diagram (Mermaid)

```mermaid
graph TD
    %% Platform Targets
    Android["Android"]:::external
    iOS["iOS"]:::external
    Web["Web"]:::external
    macOS["macOS"]:::external
    Windows["Windows"]:::external

    %% Client App Entry
    ClientApp["Flutter Client App"]:::client
    click ClientApp "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/main.dart"

    %% Dependency Injection
    DI["Service Locator"]:::infra
    click DI "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/core/dependency_injection/service_locator.dart"

    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB
        Screens["Screens"]:::client
        click Screens "https://github.com/chayan9991/service_booking_flutter_app/tree/main/lib/presentation/screens/"
        Widgets["Widgets"]:::client
        click Widgets "https://github.com/chayan9991/service_booking_flutter_app/tree/main/lib/presentation/widgets/"
        AuthCubit["AuthCubit"]:::client
        click AuthCubit "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/presentation/bloc_cubits/auth/cubit/auth_cubit.dart"
        CartCubit["CartCubit"]:::client
        click CartCubit "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/presentation/bloc_cubits/cart/cubit/cart_cubit.dart"
        MainCubit["MainCubit"]:::client
        click MainCubit "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/presentation/bloc_cubits/main/cubit/main_cubit.dart"
        PaymentCubit["PaymentCubit"]:::client
        click PaymentCubit "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/presentation/bloc_cubits/payment/cubit/payment_cubit.dart"
    end

    %% Domain Layer
    subgraph "Domain Layer"
        direction TB
        RazorpayService["RazorpayService"]:::client
        click RazorpayService "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/logic/services/razorpay_service.dart"
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        Models["Models"]:::client
        click Models "https://github.com/chayan9991/service_booking_flutter_app/tree/main/lib/data/model/"
        AuthRepoInt["AuthRepository Interface"]:::client
        click AuthRepoInt "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/data/repositories/auth/auth_repo.dart"
        AuthRepoImpl["AuthRepositoryImpl"]:::client
        click AuthRepoImpl "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/data/repositories/auth/auth_repo_impl.dart"
    end

    %% Core Utilities
    subgraph "Core & Config"
        direction TB
        AppRoutes["AppRoutes"]:::infra
        click AppRoutes "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/core/routes/app_routes.dart"
        AppTheme["AppTheme"]:::infra
        click AppTheme "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/config/themes/app_theme.dart"
        UIUtils["UIUtils"]:::infra
        click UIUtils "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/core/utils/ui_utils.dart"
        CustomButton["CustomButton"]:::infra
        click CustomButton "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/core/common/custom_button.dart"
        CustomTextField["CustomTextField"]:::infra
        click CustomTextField "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/core/common/custom_textfield.dart"
        ServicesList["ServicesList"]:::infra
        click ServicesList "https://github.com/chayan9991/service_booking_flutter_app/blob/main/lib/core/common/services_list.dart"
    end

    %% External Services
    subgraph "External Services"
        direction TB
        FirebaseAuth["Firebase Authentication"]:::external
        Firestore["Firebase Firestore"]:::external
        RazorpayGateway["Razorpay Gateway"]:::external
    end

    %% Connections
    Android --> ClientApp
    iOS --> ClientApp
    Web --> ClientApp
    macOS --> ClientApp
    Windows --> ClientApp

    ClientApp --> DI
    DI --> PresentationLayer["Presentation Layer"]
    DI --> DomainLayer["Domain Layer"]
    DI --> DataLayer["Data Layer"]

    PresentationLayer -->|invoke use cases| DomainLayer
    DomainLayer -->|call repositories| DataLayer
    DataLayer -->|authenticate user / read-write bookings| FirebaseAuth
    DataLayer -->|read-write bookings| Firestore
    DomainLayer -->|process payment| RazorpayGateway

    classDef client fill:#AED6F1,stroke:#21618C,color:#1B4F72
    classDef external fill:#A9DFBF,stroke:#27AE60,color:#196F3D
    classDef infra fill:#F5B041,stroke:#D68910,color:#7E5109
```
