# kamran1819g/tnent architecture

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

- Interactive diagram: https://gitdiagram.com/kamran1819g/tnent
- Repository: https://github.com/kamran1819g/tnent

## Overview

##### Main Components

a. Client-Side (Mobile Application):
- Flutter UI Layer
- Core Services Layer
- State Management Layer (Controllers)
- Models Layer
- External Services Integration

b. Backend Services:
- Firebase Authentication
- Firebase Cloud Functions
- Firebase Database (implied by structure)
- Razorpay Payment Integration

##### Connection Types

- Double lines: API communications

##### Specific Implementation Details

**[User Interface Layer]**
**↓**
**[Controllers Layer]**
- AuthController
- CheckoutController
- NotificationController
- StoryUpdatesController
**↓**
**[Services Layer]**
- Firebase Auth Service
- Network Services
- Permission Handler
- Razorpay Service
**↓**
**[External Services Layer]**
- Firebase Backend
- Payment Gateway
- External Links

##### Notes for Implementation

- Keep the main flow clear and centered
- Related features together
- Clear boundaries between different modules
- Data flow direction
- Critical security checkpoints
- Error handling paths

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        direction TB
        Auth["Authentication Screens"]
        Store["Store Management"]
        Catalog["Catalog Management"]
        Community["Community Features"]
        Payment["Payment Processing"]
        Orders["Order Management"]
        Profile["User Profile"]
    end

    subgraph BL["Business Logic Layer"]
        direction TB
        AC["Auth Controller"]
        CC["Checkout Controller"]
        NC["Notification Controller"]
        SC["Story Updates Controller"]
    end

    subgraph SL["Services Layer"]
        direction TB
        FAS["Firebase Auth Service"]
        NS["Network Services"]
        PH["Permission Handler"]
        RPS["Razorpay Service"]
    end

    subgraph EX["External Services"]
        direction TB
        FB["Firebase Backend"]
        PG["Payment Gateway"]
        EL["External Links"]
    end

    %% Connections
    Auth --> AC
    Store --> SC
    Catalog --> CC
    Payment --> CC
    Orders --> CC
    Community --> NC
    Profile --> AC

    AC --> FAS
    CC --> RPS
    NC --> NS
    SC --> NS

    FAS --> FB
    RPS --> PG
    NS --> EL
    PH --> EL

    %% Styling
    classDef ui fill:#a8d1f0
    classDef logic fill:#90EE90
    classDef service fill:#FFE5B4
    classDef external fill:#DDA0DD

    class Auth,Store,Catalog,Community,Payment,Orders,Profile ui
    class AC,CC,NC,SC logic
    class FAS,NS,PH,RPS service
    class FB,PG,EL external

    %% Click Events
    click Auth "https://github.com/kamran1819G/tnent/blob/master/lib/presentation/pages/signin_screen.dart"
    click Store "https://github.com/kamran1819G/tnent/tree/master/lib/presentation/pages/store_owner_screens/"
    click Catalog "https://github.com/kamran1819G/tnent/tree/master/lib/presentation/pages/catalog_pages/"
    click Community "https://github.com/kamran1819G/tnent/blob/master/lib/presentation/pages/home_pages/community.dart"
    click Payment "https://github.com/kamran1819G/tnent/blob/master/lib/services/razorpay_service.dart"
    click Orders "https://github.com/kamran1819G/tnent/blob/master/lib/models/store_order.dart"
    click Profile "https://github.com/kamran1819G/tnent/blob/master/lib/presentation/pages/users_screens/myprofile_screen.dart"
    click AC "https://github.com/kamran1819G/tnent/blob/master/lib/presentation/controllers/auth_controller.dart"
    click CC "https://github.com/kamran1819G/tnent/blob/master/lib/presentation/controllers/checkoutController.dart"
    click NC "https://github.com/kamran1819G/tnent/blob/master/lib/presentation/controllers/notification_controller.dart"
    click SC "https://github.com/kamran1819G/tnent/blob/master/lib/presentation/controllers/story_updates_controller.dart"
    click FAS "https://github.com/kamran1819G/tnent/blob/master/lib/services/firebase/firebase_auth_service.dart"
    click NS "https://github.com/kamran1819G/tnent/blob/master/lib/core/services/network_services.dart"
    click PH "https://github.com/kamran1819G/tnent/blob/master/lib/core/services/permission_handler_service.dart"
    click EL "https://github.com/kamran1819G/tnent/blob/master/lib/services/external_linking_services/universal_linking.dart"

    %% Legend
    subgraph Legend
        UI_L["UI Components"]:::ui
        BL_L["Business Logic"]:::logic
        SL_L["Services"]:::service
        EX_L["External Services"]:::external
    end
```
