# bhatthiman/osep architecture

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

- Interactive diagram: https://gitdiagram.com/bhatthiman/osep
- Repository: https://github.com/bhatthiman/osep

## Overview

OSEP is an early-stage static-equipment design platform. An engineer creates or loads a project, adds and edits components, then requests a preview; the backend validates component data, builds CAD solids, and exports STL for the frontend viewer. The sampled code also shows project save/load and STEP export. The README describes broader calculation, drawing, and analysis ambitions, but their implementation is not established by the sampled sources. Frontend-to-backend transport details are not shown, so that connection is marked unverified.

Main entry points: [`backend/app/core/component_registry.py`](https://github.com/bhatthiman/osep/blob/main/backend/app/core/component_registry.py) (Component registry), [`frontend/src/App.jsx`](https://github.com/bhatthiman/osep/blob/main/frontend/src/App.jsx) (Application), [`backend/app/core/project_manager.py`](https://github.com/bhatthiman/osep/blob/main/backend/app/core/project_manager.py) (Project manager), [`backend/app/api/router.py`](https://github.com/bhatthiman/osep/blob/main/backend/app/api/router.py) (API router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Design interface"]
  node_app["Application<br/>[App.jsx]"]
  node_library["Component library"]
  node_structure["Project structure"]
  node_editor["Property editor<br/>[PropertyEditor.jsx]"]
  node_viewer["3D viewer<br/>[Viewer.jsx]"]
  node_stlmodel["STL model<br/>[STLModel.jsx]"]
  node_clientapi["API client<br/>[api.js]"]
end

subgraph group_api["Project API"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_router["API router<br/>[router.py]"]
  node_project_routes["Project routes<br/>[projects.py]"]
  node_component_routes["Component routes<br/>[components.py]"]
  node_build_routes["Build routes<br/>[build.py]"]
end

subgraph group_domain["Project and schemas"]
  node_manager["Project manager<br/>[project_manager.py]"]
  node_project_schema["Project schema<br/>[project.py]"]
  node_component_schema["Component schema<br/>[component.py]"]
  node_cylinder_schema["Cylinder schema<br/>[cylinder.py]"]
  node_head_schema["Head schema<br/>[head.py]"]
  node_calculations["Engineering calculations"]
  node_materials["Materials"]
end

subgraph group_cad["CAD generation"]
  node_registry["Component registry"]
  node_dispatcher["Geometry dispatcher<br/>[dispatcher.py]"]
  node_cylinder_builder["Cylinder builder"]
  node_head_builder["Head builder<br/>[head_builder.py]"]
  node_exporter["Preview exporter"]
end

node_engineer(("Engineer"))
node_stl_output["STL output"]

node_engineer -->|"uses"| node_app
node_app -->|"renders"| node_library
node_app -->|"renders"| node_structure
node_app -->|"renders"| node_editor
node_app -->|"renders"| node_viewer
node_viewer -->|"renders"| node_stlmodel
node_app -->|"calls"| node_clientapi
node_clientapi -.->|"sends requests"| node_router
node_fastapi -->|"mounts"| node_router
node_router -->|"registers"| node_project_routes
node_router -->|"registers"| node_component_routes
node_router -->|"registers"| node_build_routes
node_project_routes -->|"calls"| node_manager
node_project_routes -->|"exports preview"| node_exporter
node_component_routes -->|"queries types"| node_registry
node_manager -->|"loads and saves"| node_project_schema
node_manager -->|"builds components"| node_dispatcher
node_manager -->|"validates updates"| node_registry
node_dispatcher -->|"gets builders"| node_registry
node_registry -->|"registers"| node_cylinder_schema
node_registry -->|"registers"| node_head_schema
node_registry -->|"registers"| node_cylinder_builder
node_registry -->|"registers"| node_head_builder
node_project_schema -->|"contains type"| node_component_schema
node_cylinder_builder -->|"builds from"| node_cylinder_schema
node_head_builder -->|"builds from"| node_head_schema
node_exporter -->|"writes STL"| node_stl_output
node_manager -.->|"STEP export"| node_exporter

click node_app "https://github.com/bhatthiman/osep/blob/main/frontend/src/App.jsx"
click node_library "https://github.com/bhatthiman/osep/blob/main/frontend/src/components/ComponentLibrary.jsx"
click node_structure "https://github.com/bhatthiman/osep/blob/main/frontend/src/components/ProjectStructure.jsx"
click node_editor "https://github.com/bhatthiman/osep/blob/main/frontend/src/components/PropertyEditor.jsx"
click node_viewer "https://github.com/bhatthiman/osep/blob/main/frontend/src/viewer/Viewer.jsx"
click node_stlmodel "https://github.com/bhatthiman/osep/blob/main/frontend/src/viewer/STLModel.jsx"
click node_clientapi "https://github.com/bhatthiman/osep/blob/main/frontend/src/services/api.js"
click node_fastapi "https://github.com/bhatthiman/osep/blob/main/backend/app/main.py"
click node_router "https://github.com/bhatthiman/osep/blob/main/backend/app/api/router.py"
click node_project_routes "https://github.com/bhatthiman/osep/blob/main/backend/app/api/routes/projects.py"
click node_component_routes "https://github.com/bhatthiman/osep/blob/main/backend/app/api/routes/components.py"
click node_build_routes "https://github.com/bhatthiman/osep/blob/main/backend/app/api/routes/build.py"
click node_manager "https://github.com/bhatthiman/osep/blob/main/backend/app/core/project_manager.py"
click node_project_schema "https://github.com/bhatthiman/osep/blob/main/backend/app/schema/project.py"
click node_component_schema "https://github.com/bhatthiman/osep/blob/main/backend/app/schema/component.py"
click node_cylinder_schema "https://github.com/bhatthiman/osep/blob/main/backend/app/schema/cylinder.py"
click node_head_schema "https://github.com/bhatthiman/osep/blob/main/backend/app/schema/head.py"
click node_registry "https://github.com/bhatthiman/osep/blob/main/backend/app/core/component_registry.py"
click node_dispatcher "https://github.com/bhatthiman/osep/blob/main/backend/app/geometry/dispatcher.py"
click node_cylinder_builder "https://github.com/bhatthiman/osep/blob/main/backend/app/geometry/cylinder_builder.py"
click node_head_builder "https://github.com/bhatthiman/osep/blob/main/backend/app/geometry/head_builder.py"
click node_exporter "https://github.com/bhatthiman/osep/blob/main/backend/app/exporters/preview_exporter.py"
click node_stl_output "https://github.com/bhatthiman/osep/tree/main/backend/outputs"
click node_calculations "https://github.com/bhatthiman/osep/tree/main/backend/app/calculations"
click node_materials "https://github.com/bhatthiman/osep/tree/main/backend/app/materials"

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_library,node_structure,node_editor,node_viewer,node_stlmodel,node_clientapi toneBlue
class node_fastapi,node_router,node_project_routes,node_component_routes,node_build_routes toneAmber
class node_manager,node_project_schema,node_component_schema,node_cylinder_schema,node_head_schema,node_calculations,node_materials toneMint
class node_registry,node_dispatcher,node_cylinder_builder,node_head_builder,node_exporter toneRose
class node_engineer toneIndigo
class node_stl_output toneTeal
```

## Components

### Design interface

- [Application](https://github.com/bhatthiman/osep/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Component library](https://github.com/bhatthiman/osep/blob/main/frontend/src/components/ComponentLibrary.jsx): `frontend/src/components/ComponentLibrary.jsx`
- [Project structure](https://github.com/bhatthiman/osep/blob/main/frontend/src/components/ProjectStructure.jsx): `frontend/src/components/ProjectStructure.jsx`
- [Property editor](https://github.com/bhatthiman/osep/blob/main/frontend/src/components/PropertyEditor.jsx): `frontend/src/components/PropertyEditor.jsx`
- [3D viewer](https://github.com/bhatthiman/osep/blob/main/frontend/src/viewer/Viewer.jsx): `frontend/src/viewer/Viewer.jsx`
- [STL model](https://github.com/bhatthiman/osep/blob/main/frontend/src/viewer/STLModel.jsx): `frontend/src/viewer/STLModel.jsx`
- [API client](https://github.com/bhatthiman/osep/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Project API

- [FastAPI app](https://github.com/bhatthiman/osep/blob/main/backend/app/main.py): `backend/app/main.py`
- [API router](https://github.com/bhatthiman/osep/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [Project routes](https://github.com/bhatthiman/osep/blob/main/backend/app/api/routes/projects.py): `backend/app/api/routes/projects.py`
- [Component routes](https://github.com/bhatthiman/osep/blob/main/backend/app/api/routes/components.py): `backend/app/api/routes/components.py`
- [Build routes](https://github.com/bhatthiman/osep/blob/main/backend/app/api/routes/build.py): `backend/app/api/routes/build.py`

### Project and schemas

- [Project manager](https://github.com/bhatthiman/osep/blob/main/backend/app/core/project_manager.py): `backend/app/core/project_manager.py`
- [Project schema](https://github.com/bhatthiman/osep/blob/main/backend/app/schema/project.py): `backend/app/schema/project.py`
- [Component schema](https://github.com/bhatthiman/osep/blob/main/backend/app/schema/component.py): `backend/app/schema/component.py`
- [Cylinder schema](https://github.com/bhatthiman/osep/blob/main/backend/app/schema/cylinder.py): `backend/app/schema/cylinder.py`
- [Head schema](https://github.com/bhatthiman/osep/blob/main/backend/app/schema/head.py): `backend/app/schema/head.py`
- [Engineering calculations](https://github.com/bhatthiman/osep/tree/main/backend/app/calculations): `backend/app/calculations`
- [Materials](https://github.com/bhatthiman/osep/tree/main/backend/app/materials): `backend/app/materials`

### CAD generation

- [Component registry](https://github.com/bhatthiman/osep/blob/main/backend/app/core/component_registry.py): `backend/app/core/component_registry.py`
- [Geometry dispatcher](https://github.com/bhatthiman/osep/blob/main/backend/app/geometry/dispatcher.py): `backend/app/geometry/dispatcher.py`
- [Cylinder builder](https://github.com/bhatthiman/osep/blob/main/backend/app/geometry/cylinder_builder.py): `backend/app/geometry/cylinder_builder.py`
- [Head builder](https://github.com/bhatthiman/osep/blob/main/backend/app/geometry/head_builder.py): `backend/app/geometry/head_builder.py`
- [Preview exporter](https://github.com/bhatthiman/osep/blob/main/backend/app/exporters/preview_exporter.py): `backend/app/exporters/preview_exporter.py`

### Other components

- **Engineer**
- [STL output](https://github.com/bhatthiman/osep/tree/main/backend/outputs): `backend/outputs`

## Connections

- Engineer → Application: uses (evidence: `frontend/src/App.jsx`)
- Application → Component library: renders (evidence: `frontend/src/App.jsx`)
- Application → Project structure: renders (evidence: `frontend/src/App.jsx`)
- Application → Property editor: renders (evidence: `frontend/src/App.jsx`)
- Application → 3D viewer: renders (evidence: `frontend/src/App.jsx`)
- 3D viewer → STL model: renders (evidence: `frontend/src/viewer/Viewer.jsx`)
- Application → API client: calls (evidence: `frontend/src/App.jsx`)
- API client → API router: sends requests
- FastAPI app → API router: mounts (evidence: `backend/app/main.py`)
- API router → Project routes: registers (evidence: `backend/app/api/router.py`)
- API router → Component routes: registers (evidence: `backend/app/api/router.py`)
- API router → Build routes: registers (evidence: `backend/app/api/router.py`)
- Project routes → Project manager: calls (evidence: `backend/app/api/routes/projects.py`)
- Project routes → Preview exporter: exports preview (evidence: `backend/app/api/routes/projects.py`)
- Component routes → Component registry: queries types (evidence: `backend/app/api/routes/components.py`)
- Project manager → Project schema: loads and saves (evidence: `backend/app/core/project_manager.py`)
- Project manager → Geometry dispatcher: builds components (evidence: `backend/app/core/project_manager.py`)
- Project manager → Component registry: validates updates (evidence: `backend/app/core/project_manager.py`)
- Geometry dispatcher → Component registry: gets builders (evidence: `backend/app/geometry/dispatcher.py`)
- Component registry → Cylinder schema: registers (evidence: `backend/app/core/component_registry.py`)
- Component registry → Head schema: registers (evidence: `backend/app/core/component_registry.py`)
- Component registry → Cylinder builder: registers (evidence: `backend/app/core/component_registry.py`)
- Component registry → Head builder: registers (evidence: `backend/app/core/component_registry.py`)
- Project schema → Component schema: contains type (evidence: `backend/app/schema/project.py`)
- Cylinder builder → Cylinder schema: builds from (evidence: `backend/app/geometry/cylinder_builder.py`)
- Head builder → Head schema: builds from (evidence: `backend/app/geometry/head_builder.py`)
- Preview exporter → STL output: writes STL
- Project manager → Preview exporter: STEP export
