# hquaiato/cellcare architecture

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

- Interactive diagram: https://gitdiagram.com/hquaiato/cellcare
- Repository: https://github.com/hquaiato/cellcare

## Overview

CellCare is a browser-based cell-culture care and research game. The player starts or loads a lab, manages cultures and equipment over simulated time, then advances through assays, research results, publication, and grants; minigames and the shop provide supporting rewards and upgrades. The graph combines the shown App/store/simulation calls with README-documented capabilities. Several tab and game implementations were not excerpted, so their detailed internal calls are not inferred.

Main entry points: [`src/game/actions.ts`](https://github.com/hquaiato/cellcare/blob/main/src/game/actions.ts) (Lab actions), [`src/App.tsx`](https://github.com/hquaiato/cellcare/blob/main/src/App.tsx) (Game navigation), [`src/game/store.ts`](https://github.com/hquaiato/cellcare/blob/main/src/game/store.ts) (State orchestration), [`src/game/sim.ts`](https://github.com/hquaiato/cellcare/blob/main/src/game/sim.ts) (Culture simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and preferences"]
  node_app["Game navigation<br/>[App.tsx]"]
  node_i18n["Language and theme<br/>[index.ts]"]
end

subgraph group_culture["Culture operations"]
  node_culture["Culture care<br/>[CultureTab.tsx]"]
  node_incubators["Incubators<br/>[IncubatorsTab.tsx]"]
  node_freezer["Freezer<br/>[FreezerTab.tsx]"]
  node_suspension["Cell suspension"]
  node_transduction["Transduction"]
  node_culture_actions["Lab actions<br/>[actions.ts]"]
end

subgraph group_research["Research workflow"]
  node_lab["Lab workspace<br/>[LabTab.tsx]"]
  node_experiments["Assay setup"]
  node_research_tab["Research and papers<br/>[ResearchTab.tsx]"]
  node_research_logic["Results and publishing<br/>[research.ts]"]
  node_results["Result figures<br/>[ResultFigure.tsx]"]
  node_grants["Grants<br/>[grants.ts]"]
end

subgraph group_economy["Progress and economy"]
  node_games["Minigames<br/>[GamesTab.tsx]"]
  node_shop["Shop and passes<br/>[ShopTab.tsx]"]
  node_economy_logic["Coins and XP<br/>[econ.ts]"]
end

subgraph group_runtime["Game runtime"]
  node_simulation["Culture simulation<br/>[sim.ts]"]
  node_game_data["Cell and assay data<br/>[data.ts]"]
  node_game_state["Game state<br/>[types.ts]"]
  node_store["State orchestration<br/>[store.ts]"]
  node_save[("Local save<br/>[save.ts]")]
  node_newgame["New lab setup<br/>[newgame.ts]"]
  node_lessons["Tutorial lessons<br/>[lessons.ts]"]
end

node_player(("Player"))

node_player -->|"uses"| node_app
node_app -->|"shows tab"| node_culture
node_app -->|"shows tab"| node_incubators
node_app -->|"shows tab"| node_freezer
node_app -->|"shows tab"| node_games
node_app -->|"shows tab"| node_shop
node_app -->|"shows tab"| node_research_tab
node_app -->|"shows tab"| node_lab
node_app -->|"reads state"| node_store
node_app -->|"queues lessons"| node_lessons
node_player -->|"sets preferences"| node_i18n
node_culture -->|"requests actions"| node_culture_actions
node_freezer -->|"requests actions"| node_culture_actions
node_incubators -->|"requests actions"| node_culture_actions
node_suspension -->|"requests actions"| node_culture_actions
node_transduction -->|"requests actions"| node_culture_actions
node_experiments -->|"requests actions"| node_culture_actions
node_culture_actions -->|"uses simulation"| node_simulation
node_culture_actions -->|"uses economy"| node_economy_logic
node_culture_actions -->|"uses research"| node_research_logic
node_simulation -->|"resolves experiments"| node_research_logic
node_simulation -->|"ticks grants"| node_grants
node_simulation -->|"reads parameters"| node_game_data
node_research_tab -->|"reads research"| node_research_logic
node_research_tab -->|"renders figures"| node_results
node_research_tab -->|"reads relevance"| node_grants
node_research_logic -->|"awards XP"| node_economy_logic
node_games -->|"requests rewards"| node_culture_actions
node_shop -->|"requests purchases"| node_culture_actions
node_store -->|"dispatches actions"| node_culture_actions
node_store -->|"advances time"| node_simulation
node_store -->|"creates or migrates"| node_newgame
node_store -->|"loads and persists"| node_save
node_store -->|"checks lessons"| node_lessons
node_store -->|"holds state"| node_game_state
node_culture_actions -->|"reads definitions"| node_game_data
node_culture_actions -->|"applies grants"| node_grants
node_culture_actions -->|"publishes papers"| node_research_logic
node_culture_actions -->|"sells cells"| node_economy_logic

click node_app "https://github.com/hquaiato/cellcare/blob/main/src/App.tsx"
click node_i18n "https://github.com/hquaiato/cellcare/blob/main/src/i18n/index.ts"
click node_culture "https://github.com/hquaiato/cellcare/blob/main/src/tabs/CultureTab.tsx"
click node_incubators "https://github.com/hquaiato/cellcare/blob/main/src/tabs/IncubatorsTab.tsx"
click node_freezer "https://github.com/hquaiato/cellcare/blob/main/src/tabs/FreezerTab.tsx"
click node_suspension "https://github.com/hquaiato/cellcare/blob/main/src/modals/SuspensionModal.tsx"
click node_transduction "https://github.com/hquaiato/cellcare/blob/main/src/modals/TransductionModal.tsx"
click node_culture_actions "https://github.com/hquaiato/cellcare/blob/main/src/game/actions.ts"
click node_simulation "https://github.com/hquaiato/cellcare/blob/main/src/game/sim.ts"
click node_lab "https://github.com/hquaiato/cellcare/blob/main/src/tabs/LabTab.tsx"
click node_experiments "https://github.com/hquaiato/cellcare/blob/main/src/modals/ExperimentModal.tsx"
click node_research_tab "https://github.com/hquaiato/cellcare/blob/main/src/tabs/ResearchTab.tsx"
click node_research_logic "https://github.com/hquaiato/cellcare/blob/main/src/game/research.ts"
click node_results "https://github.com/hquaiato/cellcare/blob/main/src/components/ResultFigure.tsx"
click node_grants "https://github.com/hquaiato/cellcare/blob/main/src/game/grants.ts"
click node_games "https://github.com/hquaiato/cellcare/blob/main/src/tabs/GamesTab.tsx"
click node_shop "https://github.com/hquaiato/cellcare/blob/main/src/tabs/ShopTab.tsx"
click node_economy_logic "https://github.com/hquaiato/cellcare/blob/main/src/game/econ.ts"
click node_game_data "https://github.com/hquaiato/cellcare/blob/main/src/game/data.ts"
click node_game_state "https://github.com/hquaiato/cellcare/blob/main/src/game/types.ts"
click node_store "https://github.com/hquaiato/cellcare/blob/main/src/game/store.ts"
click node_save "https://github.com/hquaiato/cellcare/blob/main/src/game/save.ts"
click node_newgame "https://github.com/hquaiato/cellcare/blob/main/src/game/newgame.ts"
click node_lessons "https://github.com/hquaiato/cellcare/blob/main/src/game/lessons.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_i18n toneBlue
class node_culture,node_incubators,node_freezer,node_suspension,node_transduction,node_culture_actions toneAmber
class node_lab,node_experiments,node_research_tab,node_research_logic,node_results,node_grants toneMint
class node_games,node_shop,node_economy_logic toneRose
class node_simulation,node_game_data,node_game_state,node_store,node_save,node_newgame,node_lessons,node_player toneIndigo
```

## Components

### App and preferences

- [Game navigation](https://github.com/hquaiato/cellcare/blob/main/src/App.tsx): `src/App.tsx`
- [Language and theme](https://github.com/hquaiato/cellcare/blob/main/src/i18n/index.ts): `src/i18n/index.ts`

### Culture operations

- [Culture care](https://github.com/hquaiato/cellcare/blob/main/src/tabs/CultureTab.tsx): `src/tabs/CultureTab.tsx`
- [Incubators](https://github.com/hquaiato/cellcare/blob/main/src/tabs/IncubatorsTab.tsx): `src/tabs/IncubatorsTab.tsx`
- [Freezer](https://github.com/hquaiato/cellcare/blob/main/src/tabs/FreezerTab.tsx): `src/tabs/FreezerTab.tsx`
- [Cell suspension](https://github.com/hquaiato/cellcare/blob/main/src/modals/SuspensionModal.tsx): `src/modals/SuspensionModal.tsx`
- [Transduction](https://github.com/hquaiato/cellcare/blob/main/src/modals/TransductionModal.tsx): `src/modals/TransductionModal.tsx`
- [Lab actions](https://github.com/hquaiato/cellcare/blob/main/src/game/actions.ts): `src/game/actions.ts`

### Research workflow

- [Lab workspace](https://github.com/hquaiato/cellcare/blob/main/src/tabs/LabTab.tsx): `src/tabs/LabTab.tsx`
- [Assay setup](https://github.com/hquaiato/cellcare/blob/main/src/modals/ExperimentModal.tsx): `src/modals/ExperimentModal.tsx`
- [Research and papers](https://github.com/hquaiato/cellcare/blob/main/src/tabs/ResearchTab.tsx): `src/tabs/ResearchTab.tsx`
- [Results and publishing](https://github.com/hquaiato/cellcare/blob/main/src/game/research.ts): `src/game/research.ts`
- [Result figures](https://github.com/hquaiato/cellcare/blob/main/src/components/ResultFigure.tsx): `src/components/ResultFigure.tsx`
- [Grants](https://github.com/hquaiato/cellcare/blob/main/src/game/grants.ts): `src/game/grants.ts`

### Progress and economy

- [Minigames](https://github.com/hquaiato/cellcare/blob/main/src/tabs/GamesTab.tsx): `src/tabs/GamesTab.tsx`
- [Shop and passes](https://github.com/hquaiato/cellcare/blob/main/src/tabs/ShopTab.tsx): `src/tabs/ShopTab.tsx`
- [Coins and XP](https://github.com/hquaiato/cellcare/blob/main/src/game/econ.ts): `src/game/econ.ts`

### Game runtime

- [Culture simulation](https://github.com/hquaiato/cellcare/blob/main/src/game/sim.ts): `src/game/sim.ts`
- [Cell and assay data](https://github.com/hquaiato/cellcare/blob/main/src/game/data.ts): `src/game/data.ts`
- [Game state](https://github.com/hquaiato/cellcare/blob/main/src/game/types.ts): `src/game/types.ts`
- [State orchestration](https://github.com/hquaiato/cellcare/blob/main/src/game/store.ts): `src/game/store.ts`
- [Local save](https://github.com/hquaiato/cellcare/blob/main/src/game/save.ts): `src/game/save.ts`
- [New lab setup](https://github.com/hquaiato/cellcare/blob/main/src/game/newgame.ts): `src/game/newgame.ts`
- [Tutorial lessons](https://github.com/hquaiato/cellcare/blob/main/src/game/lessons.ts): `src/game/lessons.ts`

### Other components

- **Player**

## Connections

- Player → Game navigation: uses (evidence: `src/App.tsx`)
- Game navigation → Culture care: shows tab (evidence: `src/App.tsx`)
- Game navigation → Incubators: shows tab (evidence: `src/App.tsx`)
- Game navigation → Freezer: shows tab (evidence: `src/App.tsx`)
- Game navigation → Minigames: shows tab (evidence: `src/App.tsx`)
- Game navigation → Shop and passes: shows tab (evidence: `src/App.tsx`)
- Game navigation → Research and papers: shows tab (evidence: `src/App.tsx`)
- Game navigation → Lab workspace: shows tab (evidence: `src/App.tsx`)
- Game navigation → State orchestration: reads state (evidence: `src/App.tsx`)
- Game navigation → Tutorial lessons: queues lessons (evidence: `src/App.tsx`)
- Player → Language and theme: sets preferences (evidence: `src/i18n/index.ts`)
- Culture care → Lab actions: requests actions (evidence: `src/tabs/CultureTab.tsx`)
- Freezer → Lab actions: requests actions (evidence: `src/tabs/FreezerTab.tsx`)
- Incubators → Lab actions: requests actions (evidence: `src/tabs/IncubatorsTab.tsx`)
- Cell suspension → Lab actions: requests actions (evidence: `src/modals/SuspensionModal.tsx`)
- Transduction → Lab actions: requests actions (evidence: `src/modals/TransductionModal.tsx`)
- Assay setup → Lab actions: requests actions (evidence: `src/modals/ExperimentModal.tsx`)
- Lab actions → Culture simulation: uses simulation (evidence: `src/game/actions.ts`)
- Lab actions → Coins and XP: uses economy (evidence: `src/game/actions.ts`)
- Lab actions → Results and publishing: uses research (evidence: `src/game/actions.ts`)
- Culture simulation → Results and publishing: resolves experiments (evidence: `src/game/sim.ts`)
- Culture simulation → Grants: ticks grants (evidence: `src/game/sim.ts`)
- Culture simulation → Cell and assay data: reads parameters (evidence: `src/game/sim.ts`)
- Research and papers → Results and publishing: reads research (evidence: `src/tabs/ResearchTab.tsx`)
- Research and papers → Result figures: renders figures (evidence: `src/tabs/ResearchTab.tsx`)
- Research and papers → Grants: reads relevance (evidence: `src/tabs/ResearchTab.tsx`)
- Results and publishing → Coins and XP: awards XP (evidence: `src/game/research.ts`)
- Minigames → Lab actions: requests rewards (evidence: `src/tabs/GamesTab.tsx`)
- Shop and passes → Lab actions: requests purchases (evidence: `src/tabs/ShopTab.tsx`)
- State orchestration → Lab actions: dispatches actions (evidence: `src/game/store.ts`)
- State orchestration → Culture simulation: advances time (evidence: `src/game/store.ts`)
- State orchestration → New lab setup: creates or migrates (evidence: `src/game/store.ts`)
- State orchestration → Local save: loads and persists (evidence: `src/game/store.ts`)
- State orchestration → Tutorial lessons: checks lessons (evidence: `src/game/store.ts`)
- State orchestration → Game state: holds state (evidence: `src/game/store.ts`)
- Lab actions → Cell and assay data: reads definitions (evidence: `src/game/actions.ts`)
- Lab actions → Grants: applies grants (evidence: `src/game/actions.ts`)
- Lab actions → Results and publishing: publishes papers (evidence: `src/game/actions.ts`)
- Lab actions → Coins and XP: sells cells (evidence: `src/game/actions.ts`)
