# maceface2/mobile-mvp architecture

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

- Interactive diagram: https://gitdiagram.com/maceface2/mobile-mvp
- Repository: https://github.com/maceface2/mobile-mvp

## Overview

##### Project type and purpose
- This is a full-stack, cross-platform mobile MVP paired with a Django-based backend API.
- The mobile app (React Native + TypeScript) captures and analyzes speech for cognitive health monitoring.
- The backend (Django + Django REST Framework) handles audio ingestion, invokes OpenAI’s Whisper for transcription, runs basic NLP, and persists results in a SQLite database.

##### File structure
- Top-level directories:
- backend/ — Django project “mvp” with an “api” app, migrations, models, views, tests, settings, and requirements.txt
- mobile/ — React Native project “dementianalytics_mobile” with:
– src code split into App.tsx, index.js, platform folders (android/, ios/), tests, configs (babel, metro, eslint), package.json, tsconfig.json
- Configuration and deployment artifacts:
- backend/db.sqlite3
- mobile/android/* Gradle files
- mobile/ios/* Xcode project files
- .env variables expected: API_BASE_URL, OPENAI_API_KEY

##### README for additional insights
- Confirms React Native front end, Django REST API back end, dependencies (OpenAI Whisper), target users, and environment setup steps.
- Mentions docs for API integration, development, and project overview.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Mobile Side
    subgraph "Mobile Application" 
        direction TB
        UI["Presentation Layer\n(App.tsx)"]:::mobile
        Entry["Entry Point\n(index.js)"]:::mobile
        Recorder["AudioRecorder Service"]:::mobile
        APIClient["API Client Service"]:::mobile
        AnalysisUI["Analysis Screen"]:::mobile
    end

    subgraph "Mobile Build Pipelines" 
        direction TB
        Android["Android (Gradle)"]:::mobile
        iOS["iOS (Xcode)"]:::mobile
    end

    subgraph "Mobile Config & Tests"
        direction TB
        Package["package.json"]:::config
        TSConfig["tsconfig.json"]:::config
        ESLint[".eslintrc.js"]:::config
        Babel["babel.config.js"]:::config
        Metro["metro.config.js"]:::config
        Tests["Testing Suite\n__tests__/App.test.tsx\njest.config.js"]:::config
    end

    %% Backend Side
    subgraph "Backend API" 
        direction TB
        Settings["Settings\n(settings.py)"]:::backend
        URLs["URL Routing\n(urls.py)"]:::backend
        Apps["App Definition\n(apps.py)"]:::backend
        Views["API Views\n(views.py)"]:::backend
        Models["Data Models\n(models.py)"]:::backend
        Admin["Admin & Registration\n(admin.py)"]:::backend
        Migrations["Migrations\n(api/migrations/)"]:::backend
        Requirements["requirements.txt"]:::config
        Manage["manage.py"]:::config
    end

    DB["SQLite Database\n(db.sqlite3)"]:::db

    External["OpenAI Whisper API"]:::external

    %% Data Flow
    UI -->|renders| Recorder
    Entry -->|boots app| UI
    Recorder -->|captures audio| APIClient
    APIClient -->|POST /transcribe| URLs
    URLs -->|routes to| Views
    Views -->|invoke| External
    External -->|transcript| Views
    Views -->|analyze & save| Models
    Models -->|persist| DB
    Views -->|return JSON| APIClient
    APIClient -->|display| AnalysisUI

    %% Click Events - Mobile
    click UI "https://github.com/maceface2/mobile-mvp/blob/main/mobile/dementianalytics_mobile/App.tsx"
    click Entry "https://github.com/maceface2/mobile-mvp/blob/main/mobile/dementianalytics_mobile/index.js"
    click Android "https://github.com/maceface2/mobile-mvp/tree/main/mobile/dementianalytics_mobile/android/"
    click iOS "https://github.com/maceface2/mobile-mvp/tree/main/mobile/dementianalytics_mobile/ios/"
    click Package "https://github.com/maceface2/mobile-mvp/blob/main/mobile/dementianalytics_mobile/package.json"
    click TSConfig "https://github.com/maceface2/mobile-mvp/blob/main/mobile/dementianalytics_mobile/tsconfig.json"
    click ESLint "https://github.com/maceface2/mobile-mvp/blob/main/mobile/dementianalytics_mobile/.eslintrc.js"
    click Babel "https://github.com/maceface2/mobile-mvp/blob/main/mobile/dementianalytics_mobile/babel.config.js"
    click Metro "https://github.com/maceface2/mobile-mvp/blob/main/mobile/dementianalytics_mobile/metro.config.js"
    click Tests "https://github.com/maceface2/mobile-mvp/blob/main/mobile/dementianalytics_mobile/__tests__/App.test.tsx"
    click Tests "https://github.com/maceface2/mobile-mvp/blob/main/mobile/dementianalytics_mobile/jest.config.js"

    %% Click Events - Backend
    click Settings "https://github.com/maceface2/mobile-mvp/blob/main/backend/mvp/settings.py"
    click URLs "https://github.com/maceface2/mobile-mvp/blob/main/backend/mvp/urls.py"
    click Apps "https://github.com/maceface2/mobile-mvp/blob/main/backend/api/apps.py"
    click Models "https://github.com/maceface2/mobile-mvp/blob/main/backend/api/models.py"
    click Views "https://github.com/maceface2/mobile-mvp/blob/main/backend/api/views.py"
    click Admin "https://github.com/maceface2/mobile-mvp/blob/main/backend/api/admin.py"
    click Migrations "https://github.com/maceface2/mobile-mvp/tree/main/backend/api/migrations/"
    click Requirements "https://github.com/maceface2/mobile-mvp/blob/main/backend/requirements.txt"
    click Manage "https://github.com/maceface2/mobile-mvp/blob/main/backend/manage.py"
    click DB "https://github.com/maceface2/mobile-mvp/blob/main/backend/db.sqlite3"

    %% Styles
    classDef mobile fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef backend fill:#d4edda,stroke:#333,stroke-width:1px
    classDef db fill:#ffe5b4,stroke:#333,stroke-width:1px
    classDef external fill:#e2e3e5,stroke:#333,stroke-width:1px
    classDef config fill:#f0f0f0,stroke:#333,stroke-width:1px
```
