# gebort/festu.navigator architecture

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

- Interactive diagram: https://gitdiagram.com/gebort/festu.navigator
- Repository: https://github.com/gebort/festu.navigator

## Overview

##### Project type and purpose
- This is a native Android application (“app” Gradle module) implementing AR navigation inside university buildings.
- It uses Google ML Kit for classroom-number recognition, SceneView for AR rendering, Room as local graph database, and a Clean-Architecture layering (data, domain, presentation).

##### File structure
- Top-level “app” module with build.gradle, ProGuard rules and two build flavors: adminDebug/adminRelease vs. userDebug/userRelease.
- app/src/main:
- assets/database: pre-populated Room graph (nodes.db)
- java/com/example/festunavigator/data: data_source (Room + DAOs), ML classification helpers, pathfinding (AStar), repositories, utils
- java/com/example/festunavigator/domain: DI module, abstract entities (Tree, Path), repositories interfaces, use_cases (AnalyzeImage, FindWay, HitTest, SmoothPath), utilities
- java/com/example/festunavigator/presentation: MainActivity + Fragments (Preview, Scanner, Router, Search, Orientation, Confirm), MVVM view-models, adapters, common helpers (DisplayRotationHelper, DrawerHelper), navigation graph
- Tests: unit tests under src/test, instrumentation tests under src/androidTest.

##### README for insights
- Describes features: scanning classroom numbers, confirming 3D position, path building via A* + Bezier smoothing, AR route visualization.
- Explains admin mode for graph editing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation" 
        direction TB
        MainActivity["MainActivity"]:::presentation
        ScannerFragment["ScannerFragment"]:::presentation
        ConfirmFragment["ConfirmFragment"]:::presentation
        RouterFragment["RouterFragment"]:::presentation
        PreviewFragment["PreviewFragment"]:::presentation
        SearchFragment["SearchFragment"]:::presentation
        OrientationFragment["OrientationFragment"]:::presentation
    end

    %% Domain Layer
    subgraph "Domain" 
        direction TB
        AnalyzeImage["AnalyzeImage"]:::domain
        HitTest["HitTest"]:::domain
        FindWay["FindWay"]:::domain
        SmoothPath["SmoothPath"]:::domain
        Tree["Tree"]:::domain
        PathEntity["Path"]:::domain
        DetectedText["DetectedText"]:::domain
    end

    %% Data Layer
    subgraph "Data" 
        direction TB
        GraphImpl["GraphImpl"]:::data
        RecordsImpl["RecordsImpl"]:::data
        Database["Database"]:::data
        GraphDao["GraphDao"]:::data
        RecordsDao["RecordsDao"]:::data
        AStarImpl["AStarImpl"]:::data
        AStarNode["AStarNode"]:::data
        TextAnalyzer["TextAnalyzer"]:::data
        ARCoreSessionHelper["ARCoreSessionLifecycleHelper"]:::data
        YuvToRgbConverter["YuvToRgbConverter"]:::data
        DetectedObjectResult["DetectedObjectResult"]:::data
    end

    %% External / Assets
    subgraph "External & Assets" 
        direction TB
        MLKit["Google ML Kit"]:::external
        SceneView["SceneView AR Engine"]:::external
        NodesDB["nodes.db"]:::external
        Models["3D Models (.glb)"]:::external
    end

    %% Relationships
    ScannerFragment -->|"invoke"| AnalyzeImage
    AnalyzeImage -->|"uses"| TextAnalyzer
    TextAnalyzer -->|"calls"| MLKit
    AnalyzeImage -->|"outputs DetectedText"| DetectedText

    ConfirmFragment -->|"invoke"| HitTest
    HitTest -->|"uses"| ARCoreSessionHelper
    ARCoreSessionHelper -->|"session data"| SceneView

    SearchFragment -->|"select destination"| FindWay
    FindWay -->|"fetch graph"| GraphImpl
    GraphImpl -->|"uses A*"| AStarImpl
    AStarImpl -->|"nodes"| AStarNode
    GraphImpl -->|"via DAO"| GraphDao
    GraphDao -->|"reads/writes"| Database
    RecordsImpl -->|"via DAO"| RecordsDao
    RecordsDao -->|"reads/writes"| Database

    FindWay -->|"raw path"| PathEntity
    PathEntity -->|"smoothed by"| SmoothPath
    SmoothPath -->|"smoothed path"| RouterFragment
    RouterFragment -->|"render"| SceneView

    NodesDB -->|"pre-bundled asset"| Database
    Models -->|"loaded by"| SceneView

    MainActivity -->|"hosts"| ScannerFragment
    MainActivity --> ConfirmationFragment
    MainActivity --> RouterFragment
    MainActivity --> PreviewFragment
    MainActivity --> SearchFragment
    MainActivity --> OrientationFragment

    %% Click Events
    click MainActivity "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/presentation/MainActivity.kt"
    click ScannerFragment "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/presentation/scanner/ScannerFragment.kt"
    click ConfirmFragment "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/presentation/confirmer/ConfirmFragment.kt"
    click RouterFragment "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/presentation/router/RouterFragment.kt"
    click PreviewFragment "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/presentation/preview/PreviewFragment.kt"
    click SearchFragment "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/presentation/search/SearchFragment.kt"
    click OrientationFragment "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/presentation/orientating/OrientationFragment.kt"
    click AnalyzeImage "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/domain/use_cases/AnalyzeImage.kt"
    click HitTest "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/domain/use_cases/HitTest.kt"
    click FindWay "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/domain/use_cases/FindWay.kt"
    click SmoothPath "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/domain/use_cases/SmoothPath.kt"
    click Tree "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/domain/tree/Tree.kt"
    click PathEntity "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/domain/pathfinding/Path.kt"
    click DetectedText "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/domain/ml/DetectedText.kt"
    click DetectedObjectResult "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/model/DetectedObjectResult.kt"
    click GraphImpl "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/repository/GraphImpl.kt"
    click RecordsImpl "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/repository/RecordsImpl.kt"
    click Database "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/data_source/Database.kt"
    click GraphDao "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/data_source/GraphDao.kt"
    click RecordsDao "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/data_source/RecordsDao.kt"
    click AStarImpl "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/pathfinding/AStarImpl.kt"
    click AStarNode "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/pathfinding/AStarNode.kt"
    click TextAnalyzer "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/ml/classification/TextAnalyzer.kt"
    click ARCoreSessionHelper "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/ml/classification/ARCoreSessionLifecycleHelper.kt"
    click YuvToRgbConverter "https://github.com/gebort/festu.navigator/blob/master/app/src/main/java/com/example/festunavigator/data/ml/classification/YuvToRgbConverter.kt"
    click NodesDB "https://github.com/gebort/festu.navigator/blob/master/app/src/main/assets/database/nodes.db"
    click Models "https://github.com/gebort/festu.navigator/blob/master/app/src/main/assets/models/box.glb"

    %% Styles
    classDef presentation fill:#D0E8FF,stroke:#0366D6,stroke-width:1px
    classDef domain fill:#DFF5E1,stroke:#228B22,stroke-width:1px
    classDef data fill:#FFE4B5,stroke:#FF8C00,stroke-width:1px
    classDef external fill:#E8E8E8,stroke:#696969,stroke-width:1px
```
