# kongquan98/silearnplatform architecture

> Architecture diagram of the GitHub repository kongquan98/silearnplatform, 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/kongquan98/silearnplatform
- Repository: https://github.com/kongquan98/silearnplatform

## Overview

##### Main Components
- Mobile Client (Android Application)
- Business Logic & Controllers: Java classes that handle navigation, state management, and the calling of recognition or learning modules.
- Sign Language Recognition Engine
- Camera Integration: Capture via CameraActivity (and its “Back” variant) feeding frames for processing.
- Image Processing & Feature Detection: Integration with OpenCV library (provided as a separate module, “openCVLibrary3413”).
- External Services & Infrastructure
- Firebase: Authentication and image storage services for user management and data persistence. Indicate the Firebase Auth and Storage modules with arrowed interactions with the mobile client.
- (Optional) Python Script for Model Training: Even if not part of the deployed runtime, mention that models were generated externally using Python.
- Data Assets & Resources
- Assets: Show that various supporting files like .txt files, multimedia files (images, videos), and model files are provided in the assets folder.
- Native Libraries: JNI libraries under “jnilibs” that could be tied to performance-critical methods in recognition processing.

##### Relationships & Data Flows
- From the UI components (e.g., CameraActivity) to the Sign Recognition Engine.
- Within the recognition module, show a flow: Camera input → OpenCV processing → TFLite Inference → Output recognition result.
- Firebase’s role as a backend service for user authentication (login, registration) and for storing/retrieving images or associated data.

##### Architectural Patterns & Technologies
- Library Integration: Since the OpenCV integration is done through a dedicated module, highlight it as an imported library. Similarly, show the TensorFlow Lite engine as a key part of the image recognition processing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Mobile Client"
        UI["UI Layer (Activities: MainActivity, LoginActivity, ProfileActivity, QuizActivity, LandingPage, AdminActivity)"]:::ui
        BL["Business Logic & Controllers (Navigation, Recognition, etc.)"]:::ui
    end

    subgraph "Sign Language Recognition Engine"
        CI["Camera Integration (CameraActivity, CameraActivityBack)"]:::engine
        IP["Image Processing (RecognitionClass & ObjectDetector)"]:::engine
        TF["TFLite Inference (TensorFlow Lite Models)"]:::engine
        OC["OpenCV Library"]:::library
    end

    subgraph "External Services"
        FB["Firebase (Auth & Storage)"]:::external
    end

    subgraph "Data Assets & Resources"
        AS["Assets & Media Resources (Models, Text, Media)"]:::data
        NL["Native Libraries (JNI)"]:::data
    end

    %% Mobile Client interactions
    UI -->|"userActions"| BL
    UI -->|"launchCamera"| CI
    BL -->|"triggerCamera"| CI

    %% Recognition Engine workflow
    CI -->|"frameData"| IP
    IP -->|"features"| TF
    TF -->|"inferenceResult"| BL
    IP -->|"usesOpenCV"| OC

    %% Data Assets connections
    AS -->|"loadsModels"| TF
    NL -->|"optimizesProcessing"| IP

    %% External Services interactions
    UI -->|"sendCredentials"| FB
    FB -->|"authResponse"| UI
    BL -->|"dataStore"| FB

    %% Click Events
    click UI "https://github.com/kongquan98/silearnplatform/tree/main/app/src/main/java/com/example/imagepro"
    click BL "https://github.com/kongquan98/silearnplatform/tree/main/app/src/main/java/com/example/imagepro"
    click CI "https://github.com/kongquan98/silearnplatform/tree/main/app/src/main/java/com/example/imagepro"
    click IP "https://github.com/kongquan98/silearnplatform/tree/main/app/src/main/java/com/example/imagepro"
    click OC "https://github.com/kongquan98/silearnplatform/tree/main/openCVLibrary3413/"
    click TF "https://github.com/kongquan98/silearnplatform/tree/main/app/src/main/assets"
    click FB "https://github.com/kongquan98/silearnplatform/tree/main/app/"
    click AS "https://github.com/kongquan98/silearnplatform/tree/main/app/src/main/assets"
    click NL "https://github.com/kongquan98/silearnplatform/tree/main/app/src/main/jnilibs"

    %% Style Definitions
    classDef ui fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef engine fill:#FFA500,stroke:#333,stroke-width:2px;
    classDef library fill:#FF7F50,stroke:#333,stroke-width:2px;
    classDef external fill:#87CEFA,stroke:#333,stroke-width:2px;
    classDef data fill:#98FB98,stroke:#333,stroke-width:2px;
```
