# maanik579/reflectai architecture

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

- Interactive diagram: https://gitdiagram.com/maanik579/reflectai
- Repository: https://github.com/maanik579/reflectai

## Overview

ReflectAI is a Raspberry Pi smart mirror that identifies the person in front of it and presents personalized information and recommendations. The main workflow runs from the mirror dashboard and camera-based recognition through profile selection, weather/calendar/reminder lookup, and wardrobe or grooming advice; the dashboard also accepts ESP32 sensor updates and can present voice briefings. SQLite repositories provide shared application state. The README documents several capabilities whose implementation was not fully sampled, so those links are cited as documented behavior rather than inferred call chains.

Main entry points: [`app/dashboard/dashboard.py`](https://github.com/maanik579/reflectai/blob/main/app/dashboard/dashboard.py) (Dashboard & API), [`app/assistant/concierge.py`](https://github.com/maanik579/reflectai/blob/main/app/assistant/concierge.py) (Voice concierge), [`app/database/repositories.py`](https://github.com/maanik579/reflectai/blob/main/app/database/repositories.py) (Repositories), [`app/calendar/calendar_service.py`](https://github.com/maanik579/reflectai/blob/main/app/calendar/calendar_service.py) (Calendar service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Mirror Interface"]
  node_dashboard["Dashboard &amp; API<br/>[dashboard.py]"]
end

subgraph group_identity["Identity &amp; Hardware"]
  node_face["Face recognition<br/>[face_service.py]"]
  node_bridge["ESP32 bridge<br/>[serial_bridge.py]"]
  node_firmware["Sensor firmware<br/>[esp32_firmware.ino]"]
end

subgraph group_personalization["Personalized Services"]
  node_weather["Weather service<br/>[weather_service.py]"]
  node_calendar["Calendar service"]
  node_outfits["Outfit engine<br/>[outfit_engine.py]"]
  node_clothing["Clothing classifier"]
  node_stylist["Live stylist<br/>[mirror_stylist.py]"]
  node_grooming["Grooming classifier"]
end

subgraph group_assistant["Voice Assistant"]
  node_concierge["Voice concierge<br/>[concierge.py]"]
  node_brain["Voice brain<br/>[brain.py]"]
  node_voice["Offline voice engine<br/>[assistant.py]"]
end

subgraph group_state["Application State"]
  node_repositories["Repositories<br/>[repositories.py]"]
  node_database[("SQLite database<br/>[database.py]")]
  node_profiles["User profiles<br/>[profiles.json]"]
  node_settings["Configuration<br/>[settings.py]"]
end

node_resident(("Mirror user"))

node_resident -->|"uses"| node_dashboard
node_face -->|"notifies identity"| node_dashboard
node_firmware -->|"posts telemetry"| node_dashboard
node_dashboard -->|"uses bridge"| node_bridge
node_dashboard -->|"serves weather"| node_weather
node_dashboard -->|"serves schedule"| node_calendar
node_dashboard -->|"requests outfits"| node_outfits
node_dashboard -->|"runs live styling"| node_stylist
node_dashboard -->|"shows grooming analysis"| node_grooming
node_dashboard -->|"builds briefings"| node_concierge
node_concierge -->|"uses weather"| node_weather
node_concierge -->|"uses calendar"| node_calendar
node_concierge -->|"uses outfit data"| node_outfits
node_voice -->|"connects assistant"| node_concierge
node_outfits -->|"fetches conditions"| node_weather
node_outfits -->|"reads wardrobe"| node_repositories
node_calendar -->|"reads schedules"| node_repositories
node_calendar -->|"reads entries"| node_profiles
node_brain -->|"reads and updates"| node_repositories
node_repositories -->|"queries and writes"| node_database
node_dashboard -->|"reads and updates"| node_repositories
node_dashboard -.->|"classifies wardrobe"| node_clothing
node_dashboard -->|"reads configuration"| node_settings
node_database -->|"uses database path"| node_settings

click node_dashboard "https://github.com/maanik579/reflectai/blob/main/app/dashboard/dashboard.py"
click node_face "https://github.com/maanik579/reflectai/blob/main/face_engine/face_service.py"
click node_bridge "https://github.com/maanik579/reflectai/blob/main/app/esp32/serial_bridge.py"
click node_firmware "https://github.com/maanik579/reflectai/blob/main/firmware/esp32_firmware/esp32_firmware.ino"
click node_weather "https://github.com/maanik579/reflectai/blob/main/app/weather/weather_service.py"
click node_calendar "https://github.com/maanik579/reflectai/blob/main/app/calendar/calendar_service.py"
click node_outfits "https://github.com/maanik579/reflectai/blob/main/app/recommendations/outfit_engine.py"
click node_clothing "https://github.com/maanik579/reflectai/blob/main/app/recommendations/clothing_classifier.py"
click node_stylist "https://github.com/maanik579/reflectai/blob/main/app/recommendations/mirror_stylist.py"
click node_grooming "https://github.com/maanik579/reflectai/blob/main/app/recommendations/grooming_classifier.py"
click node_concierge "https://github.com/maanik579/reflectai/blob/main/app/assistant/concierge.py"
click node_brain "https://github.com/maanik579/reflectai/blob/main/app/assistant/brain.py"
click node_voice "https://github.com/maanik579/reflectai/blob/main/voice_engine/assistant.py"
click node_repositories "https://github.com/maanik579/reflectai/blob/main/app/database/repositories.py"
click node_database "https://github.com/maanik579/reflectai/blob/main/app/database/database.py"
click node_profiles "https://github.com/maanik579/reflectai/blob/main/data/profiles.json"
click node_settings "https://github.com/maanik579/reflectai/blob/main/app/config/settings.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_dashboard,node_resident toneBlue
class node_face,node_bridge,node_firmware toneAmber
class node_weather,node_calendar,node_outfits,node_clothing,node_stylist,node_grooming toneMint
class node_concierge,node_brain,node_voice toneRose
class node_repositories,node_database,node_profiles,node_settings toneIndigo
```

## Components

### Mirror Interface

- [Dashboard & API](https://github.com/maanik579/reflectai/blob/main/app/dashboard/dashboard.py): `app/dashboard/dashboard.py`

### Identity & Hardware

- [Face recognition](https://github.com/maanik579/reflectai/blob/main/face_engine/face_service.py): `face_engine/face_service.py`
- [ESP32 bridge](https://github.com/maanik579/reflectai/blob/main/app/esp32/serial_bridge.py): `app/esp32/serial_bridge.py`
- [Sensor firmware](https://github.com/maanik579/reflectai/blob/main/firmware/esp32_firmware/esp32_firmware.ino): `firmware/esp32_firmware/esp32_firmware.ino`

### Personalized Services

- [Weather service](https://github.com/maanik579/reflectai/blob/main/app/weather/weather_service.py): `app/weather/weather_service.py`
- [Calendar service](https://github.com/maanik579/reflectai/blob/main/app/calendar/calendar_service.py): `app/calendar/calendar_service.py`
- [Outfit engine](https://github.com/maanik579/reflectai/blob/main/app/recommendations/outfit_engine.py): `app/recommendations/outfit_engine.py`
- [Clothing classifier](https://github.com/maanik579/reflectai/blob/main/app/recommendations/clothing_classifier.py): `app/recommendations/clothing_classifier.py`
- [Live stylist](https://github.com/maanik579/reflectai/blob/main/app/recommendations/mirror_stylist.py): `app/recommendations/mirror_stylist.py`
- [Grooming classifier](https://github.com/maanik579/reflectai/blob/main/app/recommendations/grooming_classifier.py): `app/recommendations/grooming_classifier.py`

### Voice Assistant

- [Voice concierge](https://github.com/maanik579/reflectai/blob/main/app/assistant/concierge.py): `app/assistant/concierge.py`
- [Voice brain](https://github.com/maanik579/reflectai/blob/main/app/assistant/brain.py): `app/assistant/brain.py`
- [Offline voice engine](https://github.com/maanik579/reflectai/blob/main/voice_engine/assistant.py): `voice_engine/assistant.py`

### Application State

- [Repositories](https://github.com/maanik579/reflectai/blob/main/app/database/repositories.py): `app/database/repositories.py`
- [SQLite database](https://github.com/maanik579/reflectai/blob/main/app/database/database.py): `app/database/database.py`
- [User profiles](https://github.com/maanik579/reflectai/blob/main/data/profiles.json): `data/profiles.json`
- [Configuration](https://github.com/maanik579/reflectai/blob/main/app/config/settings.py): `app/config/settings.py`

### Other components

- **Mirror user**

## Connections

- Mirror user → Dashboard & API: uses (evidence: `README.md`)
- Face recognition → Dashboard & API: notifies identity (evidence: `face_engine/face_service.py`)
- Sensor firmware → Dashboard & API: posts telemetry (evidence: `README.md`)
- Dashboard & API → ESP32 bridge: uses bridge (evidence: `app/dashboard/dashboard.py`)
- Dashboard & API → Weather service: serves weather (evidence: `app/dashboard/dashboard.py`)
- Dashboard & API → Calendar service: serves schedule (evidence: `app/dashboard/dashboard.py`)
- Dashboard & API → Outfit engine: requests outfits (evidence: `app/dashboard/dashboard.py`)
- Dashboard & API → Live stylist: runs live styling (evidence: `README.md`)
- Dashboard & API → Grooming classifier: shows grooming analysis (evidence: `README.md`)
- Dashboard & API → Voice concierge: builds briefings (evidence: `app/dashboard/dashboard.py`)
- Voice concierge → Weather service: uses weather (evidence: `app/assistant/concierge.py`)
- Voice concierge → Calendar service: uses calendar (evidence: `app/assistant/concierge.py`)
- Voice concierge → Outfit engine: uses outfit data (evidence: `README.md`)
- Offline voice engine → Voice concierge: connects assistant (evidence: `voice_engine/assistant.py`)
- Outfit engine → Weather service: fetches conditions (evidence: `app/recommendations/outfit_engine.py`)
- Outfit engine → Repositories: reads wardrobe (evidence: `app/recommendations/outfit_engine.py`)
- Calendar service → Repositories: reads schedules (evidence: `app/calendar/calendar_service.py`)
- Calendar service → User profiles: reads entries (evidence: `app/calendar/calendar_service.py`)
- Voice brain → Repositories: reads and updates (evidence: `app/assistant/brain.py`)
- Repositories → SQLite database: queries and writes (evidence: `app/database/repositories.py`)
- Dashboard & API → Repositories: reads and updates (evidence: `app/dashboard/dashboard.py`)
- Dashboard & API → Clothing classifier: classifies wardrobe (evidence: `README.md`)
- Dashboard & API → Configuration: reads configuration (evidence: `app/dashboard/dashboard.py`)
- SQLite database → Configuration: uses database path (evidence: `app/database/database.py`)
