# avadali1/cstar-app architecture

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

- Interactive diagram: https://gitdiagram.com/avadali1/cstar-app
- Repository: https://github.com/avadali1/cstar-app

## Overview

CSTAR is a cross-platform preliminary liquid-rocket-engine design app. The main user workflow, documented as engine sizing, begins in the workspace UI and uses propellant selection/evaluation; database-backed engineering and material-study subsystems support the broader product capabilities. Source excerpts show some engine interactions directly, while nozzle generation, thermal analysis, and platform synchronization are documented but not fully sampled, so those links are marked unverified where appropriate.

Main entry points: [`src/app/index.tsx`](https://github.com/avadali1/cstar-app/blob/main/src/app/index.tsx) (Design workspace), [`src/app/_layout.tsx`](https://github.com/avadali1/cstar-app/blob/main/src/app/_layout.tsx) (App shell), [`src/engine/usePropellantDatabase.ts`](https://github.com/avadali1/cstar-app/blob/main/src/engine/usePropellantDatabase.ts) (Propellant workflow), [`src/engine/propellants.ts`](https://github.com/avadali1/cstar-app/blob/main/src/engine/propellants.ts) (Pair evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Design workspace"]
  node_workspace_ui["Design workspace<br/>[index.tsx]"]
  node_engine_sizing["Engine sizing<br/>[index.tsx]"]
  node_nozzle["Nozzle geometry"]
  node_thermal["Thermal analysis"]
end

subgraph group_engineering["Propellant engineering"]
  node_propellant_hook["Propellant workflow"]
  node_propellant_evaluator["Pair evaluation<br/>[propellants.ts]"]
  node_compatibility["Compatibility checks<br/>[compatibility.ts]"]
  node_performance["Performance lookup"]
  node_interpolation["Performance interpolation<br/>[interpolation.ts]"]
  node_design_rules["Design rule checks"]
  node_rule_evaluator["Rule evaluator"]
  node_rule_repository["Design rule repository"]
  node_database[("Engineering database<br/>[database.ts]")]
  node_sqlite_asset[("SQLite database asset<br/>[cstar.db]")]
end

subgraph group_materials["Materials studies"]
  node_material_builder["Material blend studies"]
  node_material_repository["Blend calculations and storage"]
end

subgraph group_platform["App and platform services"]
  node_web_snapshot["Web database snapshot"]
  node_web_sync["Web database sync<br/>[webDatabaseSync.ts]"]
  node_release_provider["Release notes state"]
  node_release_repository["Release notes storage"]
  node_release_modal["What's new modal<br/>[WhatsNewModal.tsx]"]
  node_layout["App shell<br/>[_layout.tsx]"]
end

node_designer(("Designer"))

node_designer -->|"uses"| node_workspace_ui
node_workspace_ui -->|"loads and evaluates"| node_propellant_hook
node_propellant_hook -->|"loads propellants"| node_database
node_propellant_hook -->|"checks compatibility"| node_compatibility
node_propellant_hook -->|"evaluates pair"| node_propellant_evaluator
node_propellant_evaluator -->|"uses compatibility"| node_compatibility
node_propellant_evaluator -->|"gets performance"| node_performance
node_performance -->|"interpolates data"| node_interpolation
node_workspace_ui -->|"supports sizing"| node_engine_sizing
node_workspace_ui -.->|"runs checks"| node_design_rules
node_design_rules -->|"loads rules"| node_rule_repository
node_design_rules -->|"evaluates rules"| node_rule_evaluator
node_designer -->|"creates blend studies"| node_material_builder
node_material_builder -->|"delegates blend work"| node_material_repository
node_workspace_ui -.->|"generates geometry"| node_nozzle
node_workspace_ui -.->|"performs analysis"| node_thermal
node_layout -->|"initializes"| node_database
node_layout -->|"opens database"| node_sqlite_asset
node_database -->|"syncs snapshot"| node_web_sync
node_web_sync -.->|"reads snapshot"| node_web_snapshot
node_layout -->|"provides release state"| node_release_provider
node_release_provider -->|"loads and marks seen"| node_release_repository
node_layout -->|"renders modal"| node_release_modal

click node_workspace_ui "https://github.com/avadali1/cstar-app/blob/main/src/app/index.tsx"
click node_propellant_hook "https://github.com/avadali1/cstar-app/blob/main/src/engine/usePropellantDatabase.ts"
click node_propellant_evaluator "https://github.com/avadali1/cstar-app/blob/main/src/engine/propellants.ts"
click node_compatibility "https://github.com/avadali1/cstar-app/blob/main/src/engine/compatibility.ts"
click node_performance "https://github.com/avadali1/cstar-app/blob/main/src/engine/performanceRepository.ts"
click node_interpolation "https://github.com/avadali1/cstar-app/blob/main/src/engine/interpolation.ts"
click node_design_rules "https://github.com/avadali1/cstar-app/blob/main/src/engine/designRuleRunner.ts"
click node_rule_evaluator "https://github.com/avadali1/cstar-app/blob/main/src/engine/designRuleEvaluator.ts"
click node_rule_repository "https://github.com/avadali1/cstar-app/blob/main/src/engine/designRuleRepository.ts"
click node_material_builder "https://github.com/avadali1/cstar-app/blob/main/src/engine/MaterialBlendBuilder.tsx"
click node_material_repository "https://github.com/avadali1/cstar-app/blob/main/src/engine/materialBlendRepository.ts"
click node_database "https://github.com/avadali1/cstar-app/blob/main/src/engine/database.ts"
click node_sqlite_asset "https://github.com/avadali1/cstar-app/blob/main/assets/database/cstar.db"
click node_web_snapshot "https://github.com/avadali1/cstar-app/blob/main/public/cstar-web-data.json"
click node_web_sync "https://github.com/avadali1/cstar-app/blob/main/src/engine/webDatabaseSync.ts"
click node_release_provider "https://github.com/avadali1/cstar-app/blob/main/src/providers/ReleaseNotesProvider.tsx"
click node_release_repository "https://github.com/avadali1/cstar-app/blob/main/src/engine/releaseNotesRepository.ts"
click node_release_modal "https://github.com/avadali1/cstar-app/blob/main/src/components/WhatsNewModal.tsx"
click node_layout "https://github.com/avadali1/cstar-app/blob/main/src/app/_layout.tsx"
click node_engine_sizing "https://github.com/avadali1/cstar-app/blob/main/src/app/index.tsx"
click node_nozzle "https://github.com/avadali1/cstar-app/tree/main/src/app"
click node_thermal "https://github.com/avadali1/cstar-app/tree/main/src/app"

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_workspace_ui,node_engine_sizing,node_nozzle,node_thermal toneBlue
class node_propellant_hook,node_propellant_evaluator,node_compatibility,node_performance,node_interpolation,node_design_rules,node_rule_evaluator,node_rule_repository,node_database,node_sqlite_asset toneAmber
class node_material_builder,node_material_repository toneMint
class node_web_snapshot,node_web_sync,node_release_provider,node_release_repository,node_release_modal,node_layout toneRose
class node_designer toneIndigo
```

## Components

### Design workspace

- [Design workspace](https://github.com/avadali1/cstar-app/blob/main/src/app/index.tsx): `src/app/index.tsx`
- [Engine sizing](https://github.com/avadali1/cstar-app/blob/main/src/app/index.tsx): `src/app/index.tsx`
- [Nozzle geometry](https://github.com/avadali1/cstar-app/tree/main/src/app): `src/app`
- [Thermal analysis](https://github.com/avadali1/cstar-app/tree/main/src/app): `src/app`

### Propellant engineering

- [Propellant workflow](https://github.com/avadali1/cstar-app/blob/main/src/engine/usePropellantDatabase.ts): `src/engine/usePropellantDatabase.ts`
- [Pair evaluation](https://github.com/avadali1/cstar-app/blob/main/src/engine/propellants.ts): `src/engine/propellants.ts`
- [Compatibility checks](https://github.com/avadali1/cstar-app/blob/main/src/engine/compatibility.ts): `src/engine/compatibility.ts`
- [Performance lookup](https://github.com/avadali1/cstar-app/blob/main/src/engine/performanceRepository.ts): `src/engine/performanceRepository.ts`
- [Performance interpolation](https://github.com/avadali1/cstar-app/blob/main/src/engine/interpolation.ts): `src/engine/interpolation.ts`
- [Design rule checks](https://github.com/avadali1/cstar-app/blob/main/src/engine/designRuleRunner.ts): `src/engine/designRuleRunner.ts`
- [Rule evaluator](https://github.com/avadali1/cstar-app/blob/main/src/engine/designRuleEvaluator.ts): `src/engine/designRuleEvaluator.ts`
- [Design rule repository](https://github.com/avadali1/cstar-app/blob/main/src/engine/designRuleRepository.ts): `src/engine/designRuleRepository.ts`
- [Engineering database](https://github.com/avadali1/cstar-app/blob/main/src/engine/database.ts): `src/engine/database.ts`
- [SQLite database asset](https://github.com/avadali1/cstar-app/blob/main/assets/database/cstar.db): `assets/database/cstar.db`

### Materials studies

- [Material blend studies](https://github.com/avadali1/cstar-app/blob/main/src/engine/MaterialBlendBuilder.tsx): `src/engine/MaterialBlendBuilder.tsx`
- [Blend calculations and storage](https://github.com/avadali1/cstar-app/blob/main/src/engine/materialBlendRepository.ts): `src/engine/materialBlendRepository.ts`

### App and platform services

- [Web database snapshot](https://github.com/avadali1/cstar-app/blob/main/public/cstar-web-data.json): `public/cstar-web-data.json`
- [Web database sync](https://github.com/avadali1/cstar-app/blob/main/src/engine/webDatabaseSync.ts): `src/engine/webDatabaseSync.ts`
- [Release notes state](https://github.com/avadali1/cstar-app/blob/main/src/providers/ReleaseNotesProvider.tsx): `src/providers/ReleaseNotesProvider.tsx`
- [Release notes storage](https://github.com/avadali1/cstar-app/blob/main/src/engine/releaseNotesRepository.ts): `src/engine/releaseNotesRepository.ts`
- [What's new modal](https://github.com/avadali1/cstar-app/blob/main/src/components/WhatsNewModal.tsx): `src/components/WhatsNewModal.tsx`
- [App shell](https://github.com/avadali1/cstar-app/blob/main/src/app/_layout.tsx): `src/app/_layout.tsx`

### Other components

- **Designer**

## Connections

- Designer → Design workspace: uses (evidence: `README.md`)
- Design workspace → Propellant workflow: loads and evaluates (evidence: `src/engine/usePropellantDatabase.ts`)
- Propellant workflow → Engineering database: loads propellants (evidence: `src/engine/usePropellantDatabase.ts`)
- Propellant workflow → Compatibility checks: checks compatibility (evidence: `src/engine/usePropellantDatabase.ts`)
- Propellant workflow → Pair evaluation: evaluates pair (evidence: `src/engine/usePropellantDatabase.ts`)
- Pair evaluation → Compatibility checks: uses compatibility (evidence: `src/engine/propellants.ts`)
- Pair evaluation → Performance lookup: gets performance (evidence: `src/engine/propellants.ts`)
- Performance lookup → Performance interpolation: interpolates data (evidence: `src/engine/interpolation.ts`)
- Design workspace → Engine sizing: supports sizing (evidence: `README.md`)
- Design workspace → Design rule checks: runs checks
- Design rule checks → Design rule repository: loads rules (evidence: `src/engine/designRuleRunner.ts`)
- Design rule checks → Rule evaluator: evaluates rules (evidence: `src/engine/designRuleRunner.ts`)
- Designer → Material blend studies: creates blend studies (evidence: `README.md`)
- Material blend studies → Blend calculations and storage: delegates blend work (evidence: `src/engine/MaterialBlendBuilder.tsx`)
- Design workspace → Nozzle geometry: generates geometry
- Design workspace → Thermal analysis: performs analysis
- App shell → Engineering database: initializes (evidence: `src/app/_layout.tsx`)
- App shell → SQLite database asset: opens database (evidence: `src/app/_layout.tsx`)
- Engineering database → Web database sync: syncs snapshot (evidence: `src/engine/database.ts`)
- Web database sync → Web database snapshot: reads snapshot
- App shell → Release notes state: provides release state (evidence: `src/app/_layout.tsx`)
- Release notes state → Release notes storage: loads and marks seen (evidence: `src/providers/ReleaseNotesProvider.tsx`)
- App shell → What's new modal: renders modal (evidence: `src/app/_layout.tsx`)
