# 1kakashy0/events-app-flutter architecture

> Architecture diagram of the GitHub repository 1kakashy0/events-app-flutter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/1kakashy0/events-app-flutter
- Repository: https://github.com/1kakashy0/events-app-flutter

## Overview

##### Project type and purpose
- This is a full-stack **frontend** application for an **Event Management System**, built with **Flutter** and **GetX**.
- Purpose: provide event discovery, registration, checkout, and profile management on mobile and web, with real-time updates via **Firebase** and a PHP/MySQL backend for persistence.

##### File structure
- Top-level:
- `main.dart`, `routes.dart`, `linkapi.dart`
- `bindings/` – GetX bindings for dependency injection
- `controller/` – GetX controllers grouped by feature (auth, events, cart, orders, etc.)
- `core/` – shared constants, utilities, middleware, and service wrappers
- `data/` – data layer
– `datasource/remote/` – HTTP clients for REST endpoints
– `datasource/static/` – local static data
– `model/` – Dart data classes
- `view/` – UI layer
– `screen/` – full-screen widgets per feature
– `widget/` – reusable UI components
- Patterns:
- **GetX** for state management, routing, and DI
- Layered architecture: UI → Controller → Data Source → Network/Services → External

##### README insights
- Frontend only, integrated into a PHP/MySQL backend
- Real-time updates and auth via Firebase
- Cross-platform (mobile + web)

##### Elements
- **Clear labels**: e.g., “AuthController”, “EventsDataSource”, “Firebase Realtime DB”
- UI → Controller → Data Source → External Service → Controller → UI
- Blue for Flutter app layers
- Green for external services

##### Detailed breakdown of components
- Flutter App
- UI Layer (view/screen + view/widget)
- GetX Bindings (`bindings/…`)
- Controllers (`controller/…`)
- Core (`core/constant`, `core/functions`, `core/middleware`, `core/services`)
- Data Layer
– `datasource/remote/*`
– `datasource/static/static.dart`
– `model/*`
- External
- REST API (PHP endpoints for auth, events, cart, orders, etc.)
- Firebase
– Auth service
– Realtime DB (subscriptions for live updates)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Flutter App Container
    subgraph "Flutter App" 
        direction TB

        %% Entry Points
        EntryMain["main.dart"]:::frontend
        EntryRoutes["routes.dart"]:::frontend
        EntryAPIConfig["linkapi.dart"]:::frontend

        %% Presentation Layer
        subgraph "Presentation Layer" 
            direction TB
            UIV["Screens"]:::frontend
            UIW["Widgets"]:::frontend
        end

        %% State Management Layer
        subgraph "State Management" 
            direction TB
            Bindings["initialbinding.dart"]:::frontend
            Controllers["controller/"]:::frontend
        end

        %% Core Layer
        subgraph "Core Utilities & Services"
            direction TB
            CoreConstants["core/constant/"]:::frontend
            CoreFunctions["core/functions/"]:::frontend
            CoreMiddleware["core/middleware/mymiddleware.dart"]:::frontend
            CoreServices["core/services/services.dart"]:::frontend
        end

        %% Data Layer
        subgraph "Data Layer"
            direction TB
            RemoteDS["data/datasource/remote/"]:::frontend
            StaticDS["data/datasource/static/static.dart"]:::frontend
            Models["data/model/"]:::frontend
        end

        %% Connections within Flutter
        EntryMain -->|initializes| EntryRoutes
        EntryMain -->|initializes| Bindings
        EntryRoutes -->|defines navigation| UIV

        UIV -->|renders| UIW
        UIV -->|dispatches actions| Controllers
        UIW -->|used by| UIV

        Bindings -->|injects| Controllers
        Controllers -->|calls| CoreServices
        Controllers -->|calls| RemoteDS
        Controllers -->|calls| StaticDS

        CoreServices -->|uses| StaticDS
        CoreServices -->|makes HTTP via| RemoteDS
        RemoteDS -->|maps to| Models
        StaticDS -->|provides| Models

    end

    %% External Services Container
    subgraph "External Services"
        direction TB
        PHPAPI["PHP/MySQL REST API"]:::external
        FirebaseAuth["Firebase Auth Service"]:::external
        FirebaseDB["Firebase Realtime DB"]:::external
    end

    %% External Interactions
    RemoteDS -->|REST calls| PHPAPI
    CoreServices -->|HTTP client| PHPAPI
    Controllers -->|subscribe| FirebaseDB
    Controllers -->|authenticate| FirebaseAuth

    %% Click Events
    click EntryMain "https://github.com/1kakashy0/events-app-flutter/blob/main/main.dart"
    click EntryRoutes "https://github.com/1kakashy0/events-app-flutter/blob/main/routes.dart"
    click EntryAPIConfig "https://github.com/1kakashy0/events-app-flutter/blob/main/linkapi.dart"
    click Bindings "https://github.com/1kakashy0/events-app-flutter/blob/main/bindings/initialbinding.dart"
    click Controllers "https://github.com/1kakashy0/events-app-flutter/tree/main/controller/"
    click CoreConstants "https://github.com/1kakashy0/events-app-flutter/tree/main/core/constant/"
    click CoreFunctions "https://github.com/1kakashy0/events-app-flutter/tree/main/core/functions/"
    click CoreMiddleware "https://github.com/1kakashy0/events-app-flutter/blob/main/core/middleware/mymiddleware.dart"
    click CoreServices "https://github.com/1kakashy0/events-app-flutter/blob/main/core/services/services.dart"
    click RemoteDS "https://github.com/1kakashy0/events-app-flutter/tree/main/data/datasource/remote/"
    click StaticDS "https://github.com/1kakashy0/events-app-flutter/blob/main/data/datasource/static/static.dart"
    click Models "https://github.com/1kakashy0/events-app-flutter/tree/main/data/model/"
    click UIV "https://github.com/1kakashy0/events-app-flutter/tree/main/view/screen/"
    click UIW "https://github.com/1kakashy0/events-app-flutter/tree/main/view/widget/"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#0288D1,color:#01579B
    classDef external fill:#E8F5E9,stroke:#43A047,color:#1B5E20
```
