# didaktikapp5/didaktikappdurango architecture

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

- Interactive diagram: https://gitdiagram.com/didaktikapp5/didaktikappdurango
- Repository: https://github.com/didaktikapp5/didaktikappdurango

## Overview

##### Main Components
- User Interface (UI) Layer: Represented by the multitude of Android Activities (e.g., MainActivity, LoginActivity, various game activities such as ArtopilActivity, BasilicaActivity, etc.). These activities form the interactive screens of the application.
- Game Module / Logic: Each mini-game (e.g., “Buscando a Mikeldi”, “Mercado de Durango”, “Preguntas de verdadero o falso”, “Sopa de letras” and “Puzzle”) should be shown as distinct submodules. They include game-specific logic and interactions.
- Media and Resource Layer: The app uses a well-populated ‘res’ directory with layouts, drawables, raw media files (e.g., mp3, mp4), and different language resource files, indicating support for internationalization.
- Data Layer: Includes the database module (found under the "db" package with ConexionDb.kt) which handles local storage or persistence of game scores, rankings, and possibly user settings.

##### Relationships and Interactions
- UI Layer interacts with the Game Module by capturing user input and directing navigation between activities.
- The Data Layer (local database) is accessed from various game activities for tasks such as saving user credentials (from LoginActivity) or storing scores for the Ranking module.
- Media and Resource Layer is consumed by UI elements to render the proper layouts, images, and audio-visual instructions during gameplay.
- Components (activities) will pull data from the DB and use resource files (layouts, strings, images) to render interactive screens.
- The Gradle/Build infrastructure supports the overall compilation and bundling of these components.

##### Architectural Patterns and Principles
- The project follows an Android architecture where Activities serve as controllers and directly manage the UI.
- Separation of concerns: Each activity is purpose-specific—handling login, main menu, specific mini-games, map interaction, and ranking.
- Resource-driven design: Emphasis on localization (with strings for different languages) and multimedia education through audio and video files.
- Modularity: Though not explicitly using advanced patterns like MVVM, the separation between UI (activities), game logic (each mini-game’s specific activity and potentially separate logic classes) and data (database connectivity) is clear.

##### Relevant Technologies and Frameworks
- Android SDK: Core framework for activities, UI elements, and overall mobile app behavior.
- Kotlin: Primary programming language, as suggested by the Kotlin files (.kt) and build.gradle.kts.
- Gradle: Build tool used to manage project dependencies and build configurations.
- Database technology (possibly SQLite via the provided ConexionDb.kt).

##### Elements
- From “User Input” to “LoginActivity” then branching to “Main Menu”.
- From “Main Menu” to various game activities.
- From game activities to the “Database Module” when saving/reading scores.
- User Interface components.
- Backend logic (game modules, database).
- Resources.
- Optionally, include a note that Gradle and build artifacts support the development/build life cycle.

## Diagram (Mermaid)

```mermaid
flowchart TD
    UA["User Action"]:::user

    subgraph "UI Layer (Activities)"
        LA["LoginActivity"]:::ui
        MA["MainActivity"]:::ui
    end

    subgraph "Game Modules"
        AA["ArtopilActivity"]:::game
        BA["BasilicaActivity"]:::game
        MA2["MikeldiActivity"]:::game
        MPA["MapaActivity"]:::game
        PA["PuzleActivity"]:::game
    end

    subgraph "Media and Resources"
        L["Layouts"]:::resource
        D["Drawables"]:::resource
        RM["Raw Media"]:::resource
        S["Strings"]:::resource
    end

    DB["Database Module (ConexionDb)"]:::db

    subgraph "Build Infrastructure"
        BG["build.gradle.kts"]:::build
        SG["settings.gradle.kts"]:::build
        GW["gradle/wrapper"]:::build
    end

    UA -->|"start"| LA
    LA -->|"login_success"| MA
    MA -->|"navigates_to"| AA
    MA -->|"navigates_to"| BA
    MA -->|"navigates_to"| MA2
    MA -->|"navigates_to"| MPA
    MA -->|"navigates_to"| PA

    AA -->|"save_score"| DB
    BA -->|"save_score"| DB
    MA2 -->|"save_score"| DB
    MPA -->|"save_score"| DB
    PA -->|"save_score"| DB

    LA -->|"renders"| L
    MA -->|"renders"| L
    MA -->|"loads"| S
    MA -->|"plays"| RM
    AA -->|"uses"| D
    BA -->|"uses"| D

    BG -->|"builds"| LA
    BG -->|"builds"| MA
    BG -->|"builds"| AA
    BG -->|"builds"| DB
    BG -->|"builds"| L

    %% Click Events
    click MA "https://github.com/didaktikapp5/didaktikappdurango/blob/master/app/src/main/java/com/icjardinapps/dm2/durango/MainActivity.kt"
    click LA "https://github.com/didaktikapp5/didaktikappdurango/blob/master/app/src/main/java/com/icjardinapps/dm2/durango/actividades/LoginActivity.kt"
    click AA "https://github.com/didaktikapp5/didaktikappdurango/blob/master/app/src/main/java/com/icjardinapps/dm2/durango/actividades/ArtopilActivity.kt"
    click BA "https://github.com/didaktikapp5/didaktikappdurango/blob/master/app/src/main/java/com/icjardinapps/dm2/durango/actividades/BasilicaActivity.kt"
    click MA2 "https://github.com/didaktikapp5/didaktikappdurango/blob/master/app/src/main/java/com/icjardinapps/dm2/durango/actividades/MikeldiActivity.kt"
    click MPA "https://github.com/didaktikapp5/didaktikappdurango/blob/master/app/src/main/java/com/icjardinapps/dm2/durango/actividades/MapaActivity.kt"
    click PA "https://github.com/didaktikapp5/didaktikappdurango/blob/master/app/src/main/java/com/icjardinapps/dm2/durango/actividades/PuzleActivity.kt"
    click L "https://github.com/didaktikapp5/didaktikappdurango/tree/master/app/src/main/res/layout"
    click D "https://github.com/didaktikapp5/didaktikappdurango/tree/master/app/src/main/res/drawable"
    click RM "https://github.com/didaktikapp5/didaktikappdurango/tree/master/app/src/main/res/raw"
    click DB "https://github.com/didaktikapp5/didaktikappdurango/blob/master/app/src/main/java/com/icjardinapps/dm2/durango/db/ConexionDb.kt"
    click BG "https://github.com/didaktikapp5/didaktikappdurango/blob/master/app/build.gradle.kts"
    click SG "https://github.com/didaktikapp5/didaktikappdurango/blob/master/settings.gradle.kts"
    click GW "https://github.com/didaktikapp5/didaktikappdurango/tree/master/gradle/wrapper"

    %% Class Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef game fill:#DDA0DD,stroke:#000,stroke-width:1px;
    classDef resource fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef db fill:#98FB98,stroke:#000,stroke-width:1px;
    classDef build fill:#FFA07A,stroke:#000,stroke-width:1px;
    classDef user fill:#F08080,stroke:#000,stroke-width:1px;
```
