# ejeonghun/universus_flutter architecture

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

- Interactive diagram: https://gitdiagram.com/ejeonghun/universus_flutter
- Repository: https://github.com/ejeonghun/universus_flutter

## Overview

##### Main Components
- Client/Fron-tend (Flutter App):
– Includes platform-specific parts (android, ios, macos, linux, windows, web directories)
– Contains the Flutter “lib” folder that is organized by feature (auth, community, chat, club, main page, versus, etc.)
- API Communication Layer:
– You have custom API call utilities (see lib/class/api/ApiCall.dart and DioApiCall.dart) that handle network requests.
- Back-end Service (External):
– Although not part of this repository, the README informs you of a Spring Boot back-end, running on Apache Tomcat and containerized via Docker.
- External Services and Integrations:
– Firebase (firebase_options.dart for FCM push notifications and other Firebase services)
– Third-party authentication (Kakao and university email verification)
– Google Maps integration (via shared/GoogleMap.dart), and possibly payment processing and notification click handling.
- Data Models & Business Logic:
– Encapsulated in various “_Model.dart” files. These are closely tied to UI components (the “_Widget.dart” files), following a design pattern that separates UI from data and logic.

##### Relationships and Interactions
- UI Components (Widgets) communicate with their corresponding Models to fetch, display, and update data.
- Both UI and Models use the API call components to exchange data with the back-end server.
- User actions (e.g., log in, send chat messages, create clubs or sports matches) trigger API calls.
- Third-party services are called when needed (e.g., Firebase for push notifications, and Google Maps for location data).
- The back-end services handle data persistence (using Oracle DB as per the technology stack), business logic, and serve the RESTful APIs.

##### Architectural Patterns and Design Principles
- Modular Separation:
– The project is broken down into clear feature areas (auth, chat, club, community, versus, etc.), making it easy to map each module as a separate component.
- MVVM/MVC-like Structure within Flutter:
– Models for data, UI widgets for presentation, and clear separation between API communications.
- Multi-platform Support:
– Distinct directories for platform-specific implementations suggest cross-platform support using Flutter’s unified development approach.
- Use of External Integrations:
– Integration with Firebase, Google Maps, and secure local storage (for user credentials) provide enhanced performance and functionality.

##### Specific Technologies & Frameworks
- Front-end: Flutter (Dart), using Flutter-specific frameworks for custom widgets, themes, and utility functions.
- Back-end: Java with Spring Boot, Docker, Apache Tomcat.
- Communication: HTTP/REST APIs handled by Dio in Flutter.
- External: Firebase, Google Maps, Payment gateways (as seen in shared/payment.dart), and others mentioned in the README.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Flutter Front-end"
        subgraph "Platforms"
            Android("Android"):::platform
            iOS("iOS"):::platform
            Web("Web"):::platform
            macOS("macOS"):::platform
            Windows("Windows"):::platform
            Linux("Linux"):::platform
        end
        FlutterApp("Unified Flutter App"):::frontend
        Android -->|" "| FlutterApp
        iOS -->|" "| FlutterApp
        Web -->|" "| FlutterApp
        macOS -->|" "| FlutterApp
        Windows -->|" "| FlutterApp
        Linux -->|" "| FlutterApp

        subgraph "Feature Modules"
            Authentication("Authentication Module"):::module
            Community("Community Module"):::module
            Club("Club Management Module"):::module
            Chat("Chat Module"):::module
            Versus("Sports Competition Module"):::module
        end
        FlutterApp -->|"ModuleRouting"| Authentication
        FlutterApp -->|"ModuleRouting"| Community
        FlutterApp -->|"ModuleRouting"| Club
        FlutterApp -->|"ModuleRouting"| Chat
        FlutterApp -->|"ModuleRouting"| Versus
    end

    APILayer("API Communication Layer"):::api
    Authentication -->|"APIRequest"| APILayer
    Community -->|"APIRequest"| APILayer
    Club -->|"APIRequest"| APILayer
    Chat -->|"APIRequest"| APILayer
    Versus -->|"APIRequest"| APILayer

    Backend("Back-end Service (SpringBoot,Tomcat,Docker)"):::backend
    APILayer -->|"RESTAPICalls"| Backend

    DB("OracleDB"):::database
    Backend -->|"DataPersistence"| DB

    subgraph "External Services"
        Firebase("Firebase"):::external
        GoogleMaps("Google Maps"):::external
        Payment("Payment & Notifications"):::external
    end
    Firebase ---|"PushNotifications"| FlutterApp
    GoogleMaps ---|"MapData"| FlutterApp
    Payment ---|"PaymentHandling"| FlutterApp

    Firebase ---|"BackendIntegration"| Backend
    Payment ---|"NotificationHandling"| Backend

    click Android "https://github.com/ejeonghun/universus_flutter/blob/main/android/app/src/main/kotlin/com/example/universus/MainActivity.kt"
    click iOS "https://github.com/ejeonghun/universus_flutter/blob/main/ios/Runner/AppDelegate.swift"
    click Web "https://github.com/ejeonghun/universus_flutter/blob/main/web/index.html"
    click macOS "https://github.com/ejeonghun/universus_flutter/blob/main/macos/Runner/MainFlutterWindow.swift"
    click Windows "https://github.com/ejeonghun/universus_flutter/blob/main/windows/runner/main.cpp"
    click Linux "https://github.com/ejeonghun/universus_flutter/blob/main/linux/main.cc"

    click Authentication "https://github.com/ejeonghun/universus_flutter/blob/main/lib/auth/Login_Widget.dart"
    click Authentication "https://github.com/ejeonghun/universus_flutter/blob/main/lib/auth/CreateAccount_Widget.dart"
    click Authentication "https://github.com/ejeonghun/universus_flutter/blob/main/lib/auth/Login_Model.dart"
    click Community "https://github.com/ejeonghun/universus_flutter/blob/main/lib/Community/Community_Widget.dart"
    click Community "https://github.com/ejeonghun/universus_flutter/blob/main/lib/Community/Post_Widget.dart"
    click Club "https://github.com/ejeonghun/universus_flutter/blob/main/lib/club/ClubMain_Widget.dart"
    click Club "https://github.com/ejeonghun/universus_flutter/blob/main/lib/club/CreateClub_Widget.dart"
    click Club "https://github.com/ejeonghun/universus_flutter/blob/main/lib/club/ClubMain_Model.dart"
    click Chat "https://github.com/ejeonghun/universus_flutter/blob/main/lib/chat/chatRoom.dart"
    click Chat "https://github.com/ejeonghun/universus_flutter/blob/main/lib/chat/chats_Model.dart"
    click Versus "https://github.com/ejeonghun/universus_flutter/blob/main/lib/versus/versusDetail_Widget.dart"
    click Versus "https://github.com/ejeonghun/universus_flutter/blob/main/lib/versus/versusList_Widget.dart"
    click Versus "https://github.com/ejeonghun/universus_flutter/blob/main/lib/versus/versusDetail_Model.dart"
    click APILayer "https://github.com/ejeonghun/universus_flutter/blob/main/lib/class/api/ApiCall.dart"
    click APILayer "https://github.com/ejeonghun/universus_flutter/blob/main/lib/class/api/DioApiCall.dart"
    click Firebase "https://github.com/ejeonghun/universus_flutter/blob/main/lib/firebase_options.dart"
    click GoogleMaps "https://github.com/ejeonghun/universus_flutter/blob/main/lib/shared/GoogleMap.dart"
    click Payment "https://github.com/ejeonghun/universus_flutter/blob/main/lib/shared/payment.dart"
    click Payment "https://github.com/ejeonghun/universus_flutter/blob/main/lib/handleNotificationClick.dart"

    classDef platform fill:#bae1ff,stroke:#000,stroke-width:2px;
    classDef frontend fill:#c8f7c5,stroke:#000,stroke-width:2px;
    classDef module fill:#ffedb3,stroke:#000,stroke-width:2px;
    classDef api fill:#f9d5e5,stroke:#000,stroke-width:2px;
    classDef backend fill:#febe7f,stroke:#000,stroke-width:2px;
    classDef database fill:#ffd6a5,stroke:#000,stroke-width:2px;
    classDef external fill:#d4a5a5,stroke:#000,stroke-width:2px;
```
