# dhushank/medtapp architecture

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

- Interactive diagram: https://gitdiagram.com/dhushank/medtapp
- Repository: https://github.com/dhushank/medtapp

## Overview

##### Main Components
- Mobile Frontend: The core application code is inside the “app” directory (using file-based routing) and “src” (which houses navigation and screen components). These components represent the user interface built with Expo/React Native.
- Assets & Configuration: The “assets” folder (fonts, images), along with configuration files like app.json, babel.config.js, metro.config.js, package.json, and tsconfig.json support the app’s development, styling, and build process.
- Native Integration: The “ios” folder contains the iOS native project files, which are integrated when building a development or production version on iOS. Although there seems to be no dedicated Android folder, Expo typically manages the Android side under its tooling.
- Bluetooth & External Integration: Two Python scripts (BluetoothInput.py and RaspberryBluetooth.py) indicate additional functionality for handling Bluetooth communication. These may serve as a bridge between the mobile app and external hardware (e.g., a Raspberry Pi or Bluetooth device), possibly implementing messaging protocols or handling data coming from sensors.

##### Relationships and Data Flow
- The Assets folder supports the UI for these screens.
- The iOS native project files (inside “ios”) are depicted as the environment where the Expo app runs on Apple devices, bridging native APIs.

##### Architectural Patterns and Design Principles
- Separation of Concerns: The division into UI (Expo app), assets/configuration, native runtime (iOS folder), and external services (Bluetooth scripts) shows modular design.
- File-Based Routing: Emphasize the usage of Expo’s file-based routing from the “app” directory.
- Multi-Platform Architecture: The project supports cross-platform mobile development with specific attention to iOS native code.
- Extensibility: The presence of the standalone Bluetooth scripts suggests planned or available external integrations, perhaps to interface with real-world devices using Raspberry Pi or similar hardware.

- Expo Mobile App:
- Assets & Configurations:
- Assets (fonts & images) and configuration files (app.json, babel.config.js, metro.config.js, package.json, tsconfig.json).
- iOS Native Environment:
- Ios folder as a separate but linked module that integrates with Expo to provide proper native functionality, especially for iOS.
- External Bluetooth Service:

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Assets & Configurations
    subgraph "Assets & Configurations"
        AC1["Assets (fonts, images)"]:::config
        subgraph "Configuration Files"
            AC2["app.json"]:::config
            AC3["babel.config.js"]:::config
            AC4["metro.config.js"]:::config
            AC5["package.json"]:::config
            AC6["tsconfig.json"]:::config
        end
    end

    %% Expo Mobile App (UI & Navigation)
    subgraph "Expo Mobile App (UI & Navigation)"
        FE1["app (index.js, mapscreen.js, objectplacement.js, receiver.js, settings.js, _layout.js)"]:::frontend
        FE2["src (AppNavigator.js, HomeScreen.js, SettingsScreen.js)"]:::frontend
        FE1 --- FE2
    end

    %% iOS Native Environment
    IOS["iOS Native Environment (ios folder with native project files)"]:::native

    %% External Bluetooth Service
    subgraph "External Bluetooth Service (Python Scripts)"
        BT1["BluetoothInput.py"]:::external
        BT2["RaspberryBluetooth.py"]:::external
        BT1 --- BT2
    end

    %% Connections
    AC1 -->|"build/config_support"| FE1
    FE1 -->|"native_integration"| IOS
    FE1 -->|"Bluetooth_data"| BT1

    %% Click Events for Assets & Configuration
    click AC1 "https://github.com/dhushank/medtapp/tree/main/assets"
    click AC2 "https://github.com/dhushank/medtapp/blob/main/app.json"
    click AC3 "https://github.com/dhushank/medtapp/blob/main/babel.config.js"
    click AC4 "https://github.com/dhushank/medtapp/blob/main/metro.config.js"
    click AC5 "https://github.com/dhushank/medtapp/blob/main/package.json"
    click AC6 "https://github.com/dhushank/medtapp/blob/main/tsconfig.json"

    %% Click Events for Mobile Frontend
    click FE1 "https://github.com/dhushank/medtapp/tree/main/app"
    click FE2 "https://github.com/dhushank/medtapp/tree/main/src"

    %% Click Event for iOS Native Environment
    click IOS "https://github.com/dhushank/medtapp/tree/main/ios"

    %% Click Events for Bluetooth Scripts
    click BT1 "https://github.com/dhushank/medtapp/blob/main/BluetoothInput.py"
    click BT2 "https://github.com/dhushank/medtapp/blob/main/RaspberryBluetooth.py"

    %% Styles
    classDef frontend fill:#ffebcd,stroke:#ffa500,stroke-width:2px;
    classDef config fill:#d0e7ff,stroke:#005f99,stroke-width:2px;
    classDef native fill:#d3d3d3,stroke:#696969,stroke-width:2px;
    classDef external fill:#ffd6cc,stroke:#ff4500,stroke-width:2px;
```
