# sereniric/memory-assistant architecture

> Architecture diagram of the GitHub repository sereniric/memory-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sereniric/memory-assistant
- Repository: https://github.com/sereniric/memory-assistant

## Overview

ManaSetu is a Flask cognitive-wellness app. Patients enter memory games, recall or reproduce what they saw, and receive scored results; game history is kept in the session. The app also supports patient profiles and medication/condition records, caregiver workflows, and spoken reminders. The graph includes the documented game-selection flow and the sampled speech features. Evidence is limited to the README, source index, and excerpts; unsampled caregiver and results behavior is represented conservatively.

Main entry points: [`app/__init__.py`](https://github.com/sereniric/memory-assistant/blob/main/app/__init__.py) (App setup), [`app/routes/sequence_recall.py`](https://github.com/sereniric/memory-assistant/blob/main/app/routes/sequence_recall.py) (Sequence Recall flow), [`app/routes/shopping_memory.py`](https://github.com/sereniric/memory-assistant/blob/main/app/routes/shopping_memory.py) (Shopping Memory flow), [`app/routes/picture_recall.py`](https://github.com/sereniric/memory-assistant/blob/main/app/routes/picture_recall.py) (Picture Recall flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app_factory["App setup<br/>[__init__.py]"]
  node_main_routes["Home and login<br/>[__init__.py]"]
  node_game_ui["Game screens"]
  node_care_ui["Care screens"]
end

subgraph group_games["Cognitive games"]
  node_shopping_routes["Shopping Memory flow<br/>[shopping_memory.py]"]
  node_shopping_logic["Shopping Memory rules<br/>[shopping_memory.py]"]
  node_picture_routes["Picture Recall flow<br/>[picture_recall.py]"]
  node_picture_logic["Picture Recall rules<br/>[picture_recall.py]"]
  node_sequence_routes["Sequence Recall flow<br/>[sequence_recall.py]"]
  node_sequence_logic["Sequence rules<br/>[sequence_recall.py]"]
  node_sequence_play["Sequence play<br/>[play_sequence.py]"]
  node_result_tracking["Session results<br/>[result_tracking.py]"]
  node_results_routes["Results view<br/>[results.py]"]
end

subgraph group_care["Patient care"]
  node_data_models["User and care records<br/>[models.py]"]
  node_database[("SQLite database<br/>[extensions.py]")]
  node_patient_routes["Patient profile<br/>[patient.py]"]
  node_caregiver_routes["Caregiver workflows<br/>[caregiver.py]"]
end

subgraph group_services["Speech services"]
  node_stt["Speech recognition<br/>[speech_to_text.py]"]
  node_tts["Reminder speech<br/>[text_to_speech.py]"]
end

node_patient_user(("Patient"))

node_patient_user -->|"uses"| node_app_factory
node_app_factory -->|"registers"| node_main_routes
node_app_factory -->|"registers"| node_shopping_routes
node_app_factory -->|"registers"| node_picture_routes
node_app_factory -->|"registers"| node_sequence_routes
node_app_factory -->|"registers"| node_results_routes
node_app_factory -->|"registers"| node_caregiver_routes
node_app_factory -->|"registers"| node_patient_routes
node_data_models -->|"uses"| node_database
node_patient_routes -->|"reads and updates"| node_data_models
node_patient_routes -->|"requests audio"| node_tts
node_patient_routes -->|"renders"| node_care_ui
node_shopping_routes -->|"calls game rules"| node_shopping_logic
node_shopping_routes -->|"records result"| node_result_tracking
node_shopping_routes -->|"renders"| node_game_ui
node_picture_routes -->|"calls game rules"| node_picture_logic
node_picture_routes -->|"records result"| node_result_tracking
node_picture_routes -->|"renders"| node_game_ui
node_sequence_routes -->|"calls game rules"| node_sequence_logic
node_sequence_routes -->|"records result"| node_result_tracking
node_sequence_routes -->|"transcribes answer"| node_stt
node_sequence_routes -->|"renders"| node_game_ui
node_results_routes -->|"reads results"| node_result_tracking
node_caregiver_routes -->|"uses records"| node_data_models
node_sequence_play -->|"uses sequence rules"| node_sequence_logic

click node_app_factory "https://github.com/sereniric/memory-assistant/blob/main/app/__init__.py"
click node_main_routes "https://github.com/sereniric/memory-assistant/blob/main/app/routes/__init__.py"
click node_game_ui "https://github.com/sereniric/memory-assistant/tree/main/app/templates/games"
click node_care_ui "https://github.com/sereniric/memory-assistant/tree/main/app/templates/patient"
click node_data_models "https://github.com/sereniric/memory-assistant/blob/main/app/models.py"
click node_database "https://github.com/sereniric/memory-assistant/blob/main/app/extensions.py"
click node_patient_routes "https://github.com/sereniric/memory-assistant/blob/main/app/routes/patient.py"
click node_caregiver_routes "https://github.com/sereniric/memory-assistant/blob/main/app/routes/caregiver.py"
click node_shopping_routes "https://github.com/sereniric/memory-assistant/blob/main/app/routes/shopping_memory.py"
click node_shopping_logic "https://github.com/sereniric/memory-assistant/blob/main/app/games/shopping_memory.py"
click node_picture_routes "https://github.com/sereniric/memory-assistant/blob/main/app/routes/picture_recall.py"
click node_picture_logic "https://github.com/sereniric/memory-assistant/blob/main/app/games/picture_recall.py"
click node_sequence_routes "https://github.com/sereniric/memory-assistant/blob/main/app/routes/sequence_recall.py"
click node_sequence_logic "https://github.com/sereniric/memory-assistant/blob/main/app/games/sequence_recall.py"
click node_sequence_play "https://github.com/sereniric/memory-assistant/blob/main/app/games/play_sequence.py"
click node_result_tracking "https://github.com/sereniric/memory-assistant/blob/main/app/games/result_tracking.py"
click node_results_routes "https://github.com/sereniric/memory-assistant/blob/main/app/routes/results.py"
click node_stt "https://github.com/sereniric/memory-assistant/blob/main/app/services/speech_to_text.py"
click node_tts "https://github.com/sereniric/memory-assistant/blob/main/app/services/text_to_speech.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_factory,node_main_routes,node_game_ui,node_care_ui toneBlue
class node_shopping_routes,node_shopping_logic,node_picture_routes,node_picture_logic,node_sequence_routes,node_sequence_logic,node_sequence_play,node_result_tracking,node_results_routes toneAmber
class node_data_models,node_database,node_patient_routes,node_caregiver_routes toneMint
class node_stt,node_tts toneRose
class node_patient_user toneIndigo
```

## Components

### Web application

- [App setup](https://github.com/sereniric/memory-assistant/blob/main/app/__init__.py): `app/__init__.py`
- [Home and login](https://github.com/sereniric/memory-assistant/blob/main/app/routes/__init__.py): `app/routes/__init__.py`
- [Game screens](https://github.com/sereniric/memory-assistant/tree/main/app/templates/games): `app/templates/games`
- [Care screens](https://github.com/sereniric/memory-assistant/tree/main/app/templates/patient): `app/templates/patient`

### Cognitive games

- [Shopping Memory flow](https://github.com/sereniric/memory-assistant/blob/main/app/routes/shopping_memory.py): `app/routes/shopping_memory.py`
- [Shopping Memory rules](https://github.com/sereniric/memory-assistant/blob/main/app/games/shopping_memory.py): `app/games/shopping_memory.py`
- [Picture Recall flow](https://github.com/sereniric/memory-assistant/blob/main/app/routes/picture_recall.py): `app/routes/picture_recall.py`
- [Picture Recall rules](https://github.com/sereniric/memory-assistant/blob/main/app/games/picture_recall.py): `app/games/picture_recall.py`
- [Sequence Recall flow](https://github.com/sereniric/memory-assistant/blob/main/app/routes/sequence_recall.py): `app/routes/sequence_recall.py`
- [Sequence rules](https://github.com/sereniric/memory-assistant/blob/main/app/games/sequence_recall.py): `app/games/sequence_recall.py`
- [Sequence play](https://github.com/sereniric/memory-assistant/blob/main/app/games/play_sequence.py): `app/games/play_sequence.py`
- [Session results](https://github.com/sereniric/memory-assistant/blob/main/app/games/result_tracking.py): `app/games/result_tracking.py`
- [Results view](https://github.com/sereniric/memory-assistant/blob/main/app/routes/results.py): `app/routes/results.py`

### Patient care

- [User and care records](https://github.com/sereniric/memory-assistant/blob/main/app/models.py): `app/models.py`
- [SQLite database](https://github.com/sereniric/memory-assistant/blob/main/app/extensions.py): `app/extensions.py`
- [Patient profile](https://github.com/sereniric/memory-assistant/blob/main/app/routes/patient.py): `app/routes/patient.py`
- [Caregiver workflows](https://github.com/sereniric/memory-assistant/blob/main/app/routes/caregiver.py): `app/routes/caregiver.py`

### Speech services

- [Speech recognition](https://github.com/sereniric/memory-assistant/blob/main/app/services/speech_to_text.py): `app/services/speech_to_text.py`
- [Reminder speech](https://github.com/sereniric/memory-assistant/blob/main/app/services/text_to_speech.py): `app/services/text_to_speech.py`

### Other components

- **Patient**

## Connections

- Patient → App setup: uses (evidence: `README.md`)
- App setup → Home and login: registers (evidence: `app/__init__.py`)
- App setup → Shopping Memory flow: registers (evidence: `app/__init__.py`)
- App setup → Picture Recall flow: registers (evidence: `app/__init__.py`)
- App setup → Sequence Recall flow: registers (evidence: `app/__init__.py`)
- App setup → Results view: registers (evidence: `app/__init__.py`)
- App setup → Caregiver workflows: registers (evidence: `app/__init__.py`)
- App setup → Patient profile: registers (evidence: `app/__init__.py`)
- User and care records → SQLite database: uses (evidence: `app/models.py`)
- Patient profile → User and care records: reads and updates (evidence: `app/routes/patient.py`)
- Patient profile → Reminder speech: requests audio (evidence: `app/routes/patient.py`)
- Patient profile → Care screens: renders (evidence: `app/routes/patient.py`)
- Shopping Memory flow → Shopping Memory rules: calls game rules (evidence: `app/routes/shopping_memory.py`)
- Shopping Memory flow → Session results: records result (evidence: `app/routes/shopping_memory.py`)
- Shopping Memory flow → Game screens: renders (evidence: `app/routes/shopping_memory.py`)
- Picture Recall flow → Picture Recall rules: calls game rules (evidence: `app/routes/picture_recall.py`)
- Picture Recall flow → Session results: records result (evidence: `app/routes/picture_recall.py`)
- Picture Recall flow → Game screens: renders (evidence: `app/routes/picture_recall.py`)
- Sequence Recall flow → Sequence rules: calls game rules (evidence: `app/routes/sequence_recall.py`)
- Sequence Recall flow → Session results: records result (evidence: `app/routes/sequence_recall.py`)
- Sequence Recall flow → Speech recognition: transcribes answer (evidence: `app/routes/sequence_recall.py`)
- Sequence Recall flow → Game screens: renders (evidence: `app/routes/sequence_recall.py`)
- Results view → Session results: reads results (evidence: `app/routes/results.py`)
- Caregiver workflows → User and care records: uses records (evidence: `app/routes/caregiver.py`)
- Sequence play → Sequence rules: uses sequence rules (evidence: `app/games/play_sequence.py`)
