# njb-project/cbt-3gu-bajakan architecture

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

- Interactive diagram: https://gitdiagram.com/njb-project/cbt-3gu-bajakan
- Repository: https://github.com/njb-project/cbt-3gu-bajakan

## Overview

##### Project type and purpose
- From the README (“Apk Dibuat Dengan: Kotlin, Java, IDE Gradle, Firebase, Git, Flutter”) and the update notes (integrating ChatGPT & Gemini AI, splash video, remote‐block/update feature), this is a cross-platform mobile application (primarily Android APK) built with Flutter front-end and native Android (Kotlin/Java) modules, backed by Firebase and calling external AI services.
- Its purpose: deliver educational features to students, chat/AI interactions, push notifications, version‐block for maintenance, etc.

##### (implicit) file structure
- Although only LICENSE and README.md are shown, a typical Flutter + Android structure will include:
- android/ (native Kotlin/Java, Gradle scripts)
- lib/ (Dart code, UI, business logic, BLoC/MVVM layers)
- ios/ (if iOS is supported)
- pubspec.yaml (Flutter dependencies)
- build.gradle, settings.gradle, gradlew wrappers
- test/ (unit/widget tests)

##### README for additional insights
- Key features: AI chat integration (ChatGPT & Gemini), splash animation, grid button layout, remote update/block functionality, Firebase notifications.
- Technology stack: Flutter (UI), Kotlin/Java (native integration), Firebase (Auth, Firestore/Realtime DB, Cloud Messaging, Remote Config), external AI REST APIs.

##### Key reminders
- Be very detailed: split the Flutter app into UI, state-management (BLoC/ViewModel), data-layer, and native bridge.
- Every external dependency (Firebase modules, AI REST endpoints).
- “update & block” logic via Remote Config and the splash video asset load.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% On-Device Layer
    subgraph "Mobile Client (On-Device)"
        direction TB
        UI["Flutter UI\n(Widgets, Screens)"]:::frontend
        BLoC["Dart BLoC / ViewModel"]:::business
        Repo["Repository Layer\n(Firebase SDK, HTTP Client)"]:::business
        Cache[(Local Cache\nSQLite / SharedPreferences)]:::database
        NativeBridge["Android Native Module\n(Kotlin/Java)"]:::frontend
        UI -->|"user interactions"| BLoC
        BLoC -->|"invokes"| Repo
        Repo -->|"caches data"| Cache
        BLoC -->|"calls native APIs"| NativeBridge
    end

    %% Firebase Cloud Services
    subgraph "Firebase Cloud Services"
        direction TB
        Auth["Authentication"]:::backend
        Firestore[(Firestore / Realtime DB)]:::database
        Messaging["Cloud Messaging"]:::backend
        RemoteConfig["Remote Config\n(Update/Block)"]:::backend
    end

    %% External AI Services
    subgraph "External AI Services"
        direction TB
        OpenAI["OpenAI ChatGPT API"]:::cloudAI
        Gemini["Google Gemini API"]:::cloudAI
    end

    %% CI/CD & Distribution
    subgraph "CI/CD & Distribution"
        direction TB
        Gradle["Gradle Build &\nGitHub Actions"]:::ci
        PlayStore["Google Play Console"]:::ci
    end

    %% Interactions
    Repo -->|"Firebase SDK"| Auth
    Repo -->|"Firebase SDK"| Firestore
    Repo -->|"Firebase SDK"| RemoteConfig
    Messaging -.->|"push notifications"| UI
    Repo -->|"HTTPS REST"| OpenAI
    Repo -->|"HTTPS REST"| Gemini
    RemoteConfig -->|"feature toggles / enforce update"| BLoC
    Gradle -->|builds/releases| PlayStore

    %% Project Files
    README["Project Overview & Tech Stack"]:::note
    LICENSE["License Information"]:::note
    click README "https://github.com/njb-project/cbt-3gu-bajakan/blob/main/README.md"
    click LICENSE "https://github.com/njb-project/cbt-3gu-bajakan/tree/main/LICENSE"

    %% Styles
    classDef frontend fill:#D6EAF8,stroke:#3498DB,stroke-width:1px
    classDef business fill:#D5F5E3,stroke:#27AE60,stroke-width:1px
    classDef backend fill:#FDEBD0,stroke:#E67E22,stroke-width:1px
    classDef database fill:#FCF3CF,stroke:#F1C40F,stroke-width:1px
    classDef cloudAI fill:#F5EEF8,stroke:#9B59B6,stroke-width:1px
    classDef ci fill:#E8E8E8,stroke:#7F8C8D,stroke-width:1px
    classDef note fill:#FFF5E5,stroke:#D35400,stroke-width:1px,stroke-dasharray: 5 5
```
