# smsmaydi/pixel-focus-room architecture

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

- Interactive diagram: https://gitdiagram.com/smsmaydi/pixel-focus-room
- Repository: https://github.com/smsmaydi/pixel-focus-room

## Overview

This is a pixel-art study and room-customization app: users enter a furnished room, interact with their character, run focus sessions, and build persistent progress through coins, goals, and item ownership. The runtime is organized around a home-screen entry point, domain models for room/session/gameplay, stores and services for persistence and integrations, and rendering/UI components. The README is empty, so capabilities are inferred from the source tree and sampled save/domain code; links to unsampled screen subsystems are omitted where callers are not evidenced.

Main entry points: [`src/screens/home/HomeScreen.tsx`](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/home/HomeScreen.tsx) (Home screen), [`App.tsx`](https://github.com/smsmaydi/pixel-focus-room/blob/master/App.tsx) (App bootstrap), [`src/store/saveStore.ts`](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/saveStore.ts) (Save state), [`src/screens/sections/useRoomActor.ts`](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/sections/useRoomActor.ts) (Room actor control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry_ui["App and screens"]
  node_app["App bootstrap<br/>[App.tsx]"]
  node_home["Home screen<br/>[HomeScreen.tsx]"]
  node_character_ui["Character panel<br/>[CharacterPanel.tsx]"]
  node_room_edit_ui["Room editor<br/>[EditDrawer.tsx]"]
  node_shop_ui["Shop and buying<br/>[ShopSection.tsx]"]
  node_todo_ui["Goals panel<br/>[TodoPanel.tsx]"]
  node_friends_ui["Friends panel<br/>[FriendsPanel.tsx]"]
  node_settings_ui["Settings panel<br/>[SettingsPanel.tsx]"]
end

subgraph group_gameplay["Room and gameplay"]
  node_room_actor_hook["Room actor control<br/>[useRoomActor.ts]"]
  node_actor_domain["Character movement<br/>[actor.ts]"]
  node_pathfinding["Room pathfinding<br/>[walk.ts]"]
  node_room_state["Save model<br/>[saveData.ts]"]
  node_catalog["Item catalog<br/>[index.ts]"]
  node_character_domain["Character appearance<br/>[appearance.ts]"]
  node_shop_domain["Shop rules<br/>[shop.ts]"]
  node_todo_domain["Goals and rewards<br/>[todo.ts]"]
  node_timer_domain["Focus timer<br/>[timer.ts]"]
  node_session_result["Session results<br/>[sessionResult.ts]"]
end

subgraph group_state_services["State and services"]
  node_save_store["Save state<br/>[saveStore.ts]"]
  node_timer_store["Timer state<br/>[timerStore.ts]"]
  node_account_store["Account state<br/>[accountStore.ts]"]
  node_friends_store["Friends state<br/>[friendsStore.ts]"]
  node_serialization["Save migration<br/>[serialize.ts]"]
  node_storage[("Local storage<br/>[storage.ts]")]
  node_cloud["Cloud backup<br/>[cloud.ts]"]
  node_notifications["Notifications<br/>[notifications.ts]"]
  node_sound["Sound effects<br/>[sound.ts]"]
  node_supabase_config["Supabase config<br/>[supabase.ts]"]
  node_actor_state["Actor state<br/>[actorStore.ts]"]
end

subgraph group_rendering["Rendering"]
  node_room_canvas["Room canvas<br/>[RoomCanvas.tsx]"]
  node_sprite["Sprite rendering<br/>[Sprite.tsx]"]
  node_aseprite["Sprite-sheet parsing<br/>[aseprite.ts]"]
end

node_user(("Player"))

node_user -->|"uses"| node_home
node_app -->|"shows"| node_home
node_app -->|"hydrates"| node_save_store
node_app -->|"initializes"| node_account_store
node_app -->|"initializes"| node_friends_store
node_app -->|"initializes"| node_notifications
node_app -->|"initializes"| node_sound
node_app -->|"connects lifecycle"| node_timer_store
node_room_actor_hook -->|"moves character"| node_actor_domain
node_room_actor_hook -->|"updates"| node_actor_state
node_room_actor_hook -->|"queries hit areas"| node_room_canvas
node_room_actor_hook -->|"looks up furniture"| node_catalog
node_actor_domain -->|"finds routes"| node_pathfinding
node_actor_domain -->|"checks furniture"| node_catalog
node_actor_domain -->|"uses room data"| node_room_state
node_room_canvas -->|"draws sprites"| node_sprite
node_room_canvas -->|"looks up items"| node_catalog
node_room_canvas -->|"reads sheet metadata"| node_aseprite
node_sprite -->|"parses sheets"| node_aseprite
node_save_store -->|"loads and saves"| node_serialization
node_save_store -->|"persists locally"| node_storage
node_save_store -->|"applies results"| node_session_result
node_save_store -->|"coordinates timer"| node_timer_store
node_save_store -->|"schedules alerts"| node_notifications
node_serialization -->|"validates save"| node_room_state
node_serialization -->|"validates appearance"| node_character_domain
node_session_result -->|"updates progress"| node_room_state
node_session_result -->|"reads timer state"| node_timer_domain
node_timer_store -->|"manages timer"| node_timer_domain
node_timer_store -->|"schedules alerts"| node_notifications
node_account_store -->|"syncs backup"| node_cloud
node_account_store -->|"reads credentials"| node_storage
node_account_store -->|"coordinates restore"| node_save_store
node_cloud -->|"uses configuration"| node_supabase_config
node_friends_store -->|"provides friend data"| node_friends_ui
node_home -->|"coordinates room"| node_room_actor_hook
node_home -->|"offers character"| node_character_ui
node_home -->|"offers room editing"| node_room_edit_ui
node_home -->|"offers shopping"| node_shop_ui
node_home -->|"offers goals"| node_todo_ui
node_home -->|"offers settings"| node_settings_ui

click node_app "https://github.com/smsmaydi/pixel-focus-room/blob/master/App.tsx"
click node_home "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/home/HomeScreen.tsx"
click node_character_ui "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/character/CharacterPanel.tsx"
click node_room_edit_ui "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/edit/EditDrawer.tsx"
click node_shop_ui "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/sections/ShopSection.tsx"
click node_todo_ui "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/todo/TodoPanel.tsx"
click node_friends_ui "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/friends/FriendsPanel.tsx"
click node_settings_ui "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/settings/SettingsPanel.tsx"
click node_room_actor_hook "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/sections/useRoomActor.ts"
click node_actor_domain "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/room/actor.ts"
click node_pathfinding "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/room/walk.ts"
click node_room_state "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/save/saveData.ts"
click node_catalog "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/items/catalog/index.ts"
click node_character_domain "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/character/appearance.ts"
click node_shop_domain "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/shop/shop.ts"
click node_todo_domain "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/todo/todo.ts"
click node_timer_domain "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/timer/timer.ts"
click node_session_result "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/session/sessionResult.ts"
click node_room_canvas "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/render/RoomCanvas.tsx"
click node_sprite "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/render/Sprite.tsx"
click node_aseprite "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/render/sprites/aseprite.ts"
click node_save_store "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/saveStore.ts"
click node_timer_store "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/timerStore.ts"
click node_account_store "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/accountStore.ts"
click node_friends_store "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/friendsStore.ts"
click node_serialization "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/save/serialize.ts"
click node_storage "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/services/storage.ts"
click node_cloud "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/services/cloud.ts"
click node_notifications "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/services/notifications.ts"
click node_sound "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/services/sound.ts"
click node_supabase_config "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/config/supabase.ts"
click node_actor_state "https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/actorStore.ts"

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,node_home,node_character_ui,node_room_edit_ui,node_shop_ui,node_todo_ui,node_friends_ui,node_settings_ui toneBlue
class node_room_actor_hook,node_actor_domain,node_pathfinding,node_room_state,node_catalog,node_character_domain,node_shop_domain,node_todo_domain,node_timer_domain,node_session_result toneAmber
class node_save_store,node_timer_store,node_account_store,node_friends_store,node_serialization,node_storage,node_cloud,node_notifications,node_sound,node_supabase_config,node_actor_state toneMint
class node_room_canvas,node_sprite,node_aseprite toneRose
class node_user toneIndigo
```

## Components

### App and screens

- [App bootstrap](https://github.com/smsmaydi/pixel-focus-room/blob/master/App.tsx): `App.tsx`
- [Home screen](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/home/HomeScreen.tsx): `src/screens/home/HomeScreen.tsx`
- [Character panel](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/character/CharacterPanel.tsx): `src/screens/character/CharacterPanel.tsx`
- [Room editor](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/edit/EditDrawer.tsx): `src/screens/edit/EditDrawer.tsx`
- [Shop and buying](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/sections/ShopSection.tsx): `src/screens/sections/ShopSection.tsx`
- [Goals panel](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/todo/TodoPanel.tsx): `src/screens/todo/TodoPanel.tsx`
- [Friends panel](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/friends/FriendsPanel.tsx): `src/screens/friends/FriendsPanel.tsx`
- [Settings panel](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/settings/SettingsPanel.tsx): `src/screens/settings/SettingsPanel.tsx`

### Room and gameplay

- [Room actor control](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/screens/sections/useRoomActor.ts): `src/screens/sections/useRoomActor.ts`
- [Character movement](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/room/actor.ts): `src/domain/room/actor.ts`
- [Room pathfinding](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/room/walk.ts): `src/domain/room/walk.ts`
- [Save model](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/save/saveData.ts): `src/domain/save/saveData.ts`
- [Item catalog](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/items/catalog/index.ts): `src/domain/items/catalog/index.ts`
- [Character appearance](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/character/appearance.ts): `src/domain/character/appearance.ts`
- [Shop rules](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/shop/shop.ts): `src/domain/shop/shop.ts`
- [Goals and rewards](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/todo/todo.ts): `src/domain/todo/todo.ts`
- [Focus timer](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/timer/timer.ts): `src/domain/timer/timer.ts`
- [Session results](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/session/sessionResult.ts): `src/domain/session/sessionResult.ts`

### State and services

- [Save state](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/saveStore.ts): `src/store/saveStore.ts`
- [Timer state](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/timerStore.ts): `src/store/timerStore.ts`
- [Account state](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/accountStore.ts): `src/store/accountStore.ts`
- [Friends state](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/friendsStore.ts): `src/store/friendsStore.ts`
- [Save migration](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/domain/save/serialize.ts): `src/domain/save/serialize.ts`
- [Local storage](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/services/storage.ts): `src/services/storage.ts`
- [Cloud backup](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/services/cloud.ts): `src/services/cloud.ts`
- [Notifications](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/services/notifications.ts): `src/services/notifications.ts`
- [Sound effects](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/services/sound.ts): `src/services/sound.ts`
- [Supabase config](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/config/supabase.ts): `src/config/supabase.ts`
- [Actor state](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/store/actorStore.ts): `src/store/actorStore.ts`

### Rendering

- [Room canvas](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/render/RoomCanvas.tsx): `src/render/RoomCanvas.tsx`
- [Sprite rendering](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/render/Sprite.tsx): `src/render/Sprite.tsx`
- [Sprite-sheet parsing](https://github.com/smsmaydi/pixel-focus-room/blob/master/src/render/sprites/aseprite.ts): `src/render/sprites/aseprite.ts`

### Other components

- **Player**

## Connections

- Player → Home screen: uses
- App bootstrap → Home screen: shows (evidence: `App.tsx`)
- App bootstrap → Save state: hydrates (evidence: `App.tsx`)
- App bootstrap → Account state: initializes (evidence: `App.tsx`)
- App bootstrap → Friends state: initializes (evidence: `App.tsx`)
- App bootstrap → Notifications: initializes (evidence: `App.tsx`)
- App bootstrap → Sound effects: initializes (evidence: `App.tsx`)
- App bootstrap → Timer state: connects lifecycle
- Room actor control → Character movement: moves character (evidence: `src/screens/sections/useRoomActor.ts`)
- Room actor control → Actor state: updates (evidence: `src/screens/sections/useRoomActor.ts`)
- Room actor control → Room canvas: queries hit areas (evidence: `src/screens/sections/useRoomActor.ts`)
- Room actor control → Item catalog: looks up furniture (evidence: `src/screens/sections/useRoomActor.ts`)
- Character movement → Room pathfinding: finds routes (evidence: `src/domain/room/actor.ts`)
- Character movement → Item catalog: checks furniture (evidence: `src/domain/room/actor.ts`)
- Character movement → Save model: uses room data (evidence: `src/domain/room/actor.ts`)
- Room canvas → Sprite rendering: draws sprites (evidence: `src/render/RoomCanvas.tsx`)
- Room canvas → Item catalog: looks up items (evidence: `src/render/RoomCanvas.tsx`)
- Room canvas → Sprite-sheet parsing: reads sheet metadata (evidence: `src/render/RoomCanvas.tsx`)
- Sprite rendering → Sprite-sheet parsing: parses sheets (evidence: `src/render/Sprite.tsx`)
- Save state → Save migration: loads and saves (evidence: `src/store/saveStore.ts`)
- Save state → Local storage: persists locally (evidence: `src/store/saveStore.ts`)
- Save state → Session results: applies results (evidence: `src/store/saveStore.ts`)
- Save state → Timer state: coordinates timer (evidence: `src/store/saveStore.ts`)
- Save state → Notifications: schedules alerts (evidence: `src/store/saveStore.ts`)
- Save migration → Save model: validates save (evidence: `src/domain/save/serialize.ts`)
- Save migration → Character appearance: validates appearance (evidence: `src/domain/save/serialize.ts`)
- Session results → Save model: updates progress (evidence: `src/domain/session/sessionResult.ts`)
- Session results → Focus timer: reads timer state (evidence: `src/domain/session/sessionResult.ts`)
- Timer state → Focus timer: manages timer (evidence: `src/store/timerStore.ts`)
- Timer state → Notifications: schedules alerts (evidence: `src/store/timerStore.ts`)
- Account state → Cloud backup: syncs backup (evidence: `src/store/accountStore.ts`)
- Account state → Local storage: reads credentials (evidence: `src/store/accountStore.ts`)
- Account state → Save state: coordinates restore (evidence: `src/store/accountStore.ts`)
- Cloud backup → Supabase config: uses configuration (evidence: `src/services/cloud.ts`)
- Friends state → Friends panel: provides friend data
- Home screen → Room actor control: coordinates room
- Home screen → Character panel: offers character
- Home screen → Room editor: offers room editing
- Home screen → Shop and buying: offers shopping
- Home screen → Goals panel: offers goals
- Home screen → Settings panel: offers settings
