# blb3dprinting/filaops architecture

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

- Interactive diagram: https://gitdiagram.com/blb3dprinting/filaops
- Repository: https://github.com/blb3dprinting/filaops

## Overview

FilaOps is an ERP for 3D-print farms. Staff use the React admin application to manage customers and sales orders, plan and execute production, track inventory and quality, purchase supplies, and account for transactions. The FastAPI backend exposes the REST API, with domain services implementing business rules and PostgreSQL holding application state. The README documents the product areas; sampled source confirms application/API startup, routing editing, and inventory-service dependencies. Most domain relationships below reflect documented capabilities rather than inspected endpoint implementations.

Main entry points: [`backend/app/api/v1/__init__.py`](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/__init__.py) (API route registry), [`backend/app/services/inventory_service.py`](https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/inventory_service.py) (Inventory operations), [`backend/app/services/sales_order_fulfillment_service.py`](https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/sales_order_fulfillment_service.py) (Order fulfillment), [`backend/app/api/v1/endpoints/production_orders.py`](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/production_orders.py) (Production orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Staff application"]
  node_webapp["Admin application<br/>[App.jsx]"]
  node_routing_ui["Routing editor"]
  node_api_client["API client<br/>[apiClient.js]"]
end

subgraph group_sales["Sales and fulfillment"]
  node_sales_api["Sales orders API<br/>[sales_orders.py]"]
  node_quotes["Quotes and customers<br/>[quotes.py]"]
  node_fulfillment["Order fulfillment"]
  node_invoices["Invoices and payments<br/>[invoices.py]"]
  node_accounting["Accounting<br/>[accounting.py]"]
end

subgraph group_operations["Production operations"]
  node_production["Production orders"]
  node_routings_api["Routings API<br/>[routings.py]"]
  node_routing_service["Routing logic<br/>[routing_service.py]"]
  node_quality["Quality control<br/>[quality.py]"]
  node_scheduling["Scheduling<br/>[scheduling.py]"]
end

subgraph group_supply["Inventory and purchasing"]
  node_inventory_api["Inventory API<br/>[inventory.py]"]
  node_inventory_service["Inventory operations"]
  node_inventory_ledger["Inventory ledger"]
  node_mrp["Material planning<br/>[mrp.py]"]
  node_purchasing["Purchasing<br/>[purchase_orders.py]"]
end

subgraph group_platform["API and persistence"]
  node_app_server["API application<br/>[main.py]"]
  node_api_routes["API route registry<br/>[__init__.py]"]
  node_db_session["Database sessions<br/>[session.py]"]
  node_database[("PostgreSQL")]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_webapp
node_webapp -->|"uses"| node_api_client
node_routing_ui -->|"sends CRUD"| node_routings_api
node_app_server -->|"registers"| node_api_routes
node_api_routes -->|"registers"| node_sales_api
node_api_routes -->|"registers"| node_routings_api
node_api_routes -->|"registers"| node_inventory_api
node_api_routes -->|"registers"| node_production
node_routings_api -->|"delegates to"| node_routing_service
node_sales_api -.->|"fulfills orders"| node_fulfillment
node_inventory_api -.->|"manages stock"| node_inventory_service
node_inventory_service -->|"posts entries"| node_inventory_ledger
node_fulfillment -->|"updates inventory"| node_inventory_service
node_production -.->|"supports inspection"| node_quality
node_production -.->|"plans work"| node_scheduling
node_mrp -.->|"plans shortages"| node_purchasing
node_fulfillment -.->|"posts shipment GL"| node_accounting
node_db_session -->|"opens sessions"| node_database
node_inventory_service -->|"records stock changes"| node_inventory_ledger
node_api_client -.->|"calls REST API"| node_app_server
node_quotes -.->|"converts to orders"| node_sales_api
node_invoices -.->|"records payments"| node_accounting

click node_webapp "https://github.com/blb3dprinting/filaops/blob/main/frontend/src/App.jsx"
click node_routing_ui "https://github.com/blb3dprinting/filaops/blob/main/frontend/src/components/routing/RoutingEditorContent.jsx"
click node_api_client "https://github.com/blb3dprinting/filaops/blob/main/frontend/src/lib/apiClient.js"
click node_sales_api "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/sales_orders.py"
click node_quotes "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/quotes.py"
click node_fulfillment "https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/sales_order_fulfillment_service.py"
click node_invoices "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/invoices.py"
click node_production "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/production_orders.py"
click node_routings_api "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/routings.py"
click node_routing_service "https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/routing_service.py"
click node_quality "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/quality.py"
click node_scheduling "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/scheduling.py"
click node_inventory_api "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/inventory.py"
click node_inventory_service "https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/inventory_service.py"
click node_inventory_ledger "https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/inventory_ledger.py"
click node_mrp "https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/mrp.py"
click node_purchasing "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/purchase_orders.py"
click node_accounting "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/accounting.py"
click node_app_server "https://github.com/blb3dprinting/filaops/blob/main/backend/app/main.py"
click node_api_routes "https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/__init__.py"
click node_db_session "https://github.com/blb3dprinting/filaops/blob/main/backend/app/db/session.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_webapp,node_routing_ui,node_api_client,node_staff toneBlue
class node_sales_api,node_quotes,node_fulfillment,node_invoices,node_accounting toneAmber
class node_production,node_routings_api,node_routing_service,node_quality,node_scheduling toneMint
class node_inventory_api,node_inventory_service,node_inventory_ledger,node_mrp,node_purchasing toneRose
class node_app_server,node_api_routes,node_db_session,node_database toneIndigo
```

## Components

### Staff application

- [Admin application](https://github.com/blb3dprinting/filaops/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Routing editor](https://github.com/blb3dprinting/filaops/blob/main/frontend/src/components/routing/RoutingEditorContent.jsx): `frontend/src/components/routing/RoutingEditorContent.jsx`
- [API client](https://github.com/blb3dprinting/filaops/blob/main/frontend/src/lib/apiClient.js): `frontend/src/lib/apiClient.js`

### Sales and fulfillment

- [Sales orders API](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/sales_orders.py): `backend/app/api/v1/endpoints/sales_orders.py`
- [Quotes and customers](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/quotes.py): `backend/app/api/v1/endpoints/quotes.py`
- [Order fulfillment](https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/sales_order_fulfillment_service.py): `backend/app/services/sales_order_fulfillment_service.py`
- [Invoices and payments](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/invoices.py): `backend/app/api/v1/endpoints/invoices.py`
- [Accounting](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/accounting.py): `backend/app/api/v1/endpoints/accounting.py`

### Production operations

- [Production orders](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/production_orders.py): `backend/app/api/v1/endpoints/production_orders.py`
- [Routings API](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/routings.py): `backend/app/api/v1/endpoints/routings.py`
- [Routing logic](https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/routing_service.py): `backend/app/services/routing_service.py`
- [Quality control](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/quality.py): `backend/app/api/v1/endpoints/quality.py`
- [Scheduling](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/scheduling.py): `backend/app/api/v1/endpoints/scheduling.py`

### Inventory and purchasing

- [Inventory API](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/inventory.py): `backend/app/api/v1/endpoints/inventory.py`
- [Inventory operations](https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/inventory_service.py): `backend/app/services/inventory_service.py`
- [Inventory ledger](https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/inventory_ledger.py): `backend/app/services/inventory_ledger.py`
- [Material planning](https://github.com/blb3dprinting/filaops/blob/main/backend/app/services/mrp.py): `backend/app/services/mrp.py`
- [Purchasing](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/endpoints/purchase_orders.py): `backend/app/api/v1/endpoints/purchase_orders.py`

### API and persistence

- [API application](https://github.com/blb3dprinting/filaops/blob/main/backend/app/main.py): `backend/app/main.py`
- [API route registry](https://github.com/blb3dprinting/filaops/blob/main/backend/app/api/v1/__init__.py): `backend/app/api/v1/__init__.py`
- [Database sessions](https://github.com/blb3dprinting/filaops/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- **PostgreSQL**

### Other components

- **Staff user**

## Connections

- Staff user → Admin application: uses (evidence: `README.md`)
- Admin application → API client: uses (evidence: `frontend/src/App.jsx`)
- Routing editor → Routings API: sends CRUD (evidence: `frontend/src/components/routing/RoutingEditorContent.jsx`)
- API application → API route registry: registers (evidence: `backend/app/main.py`)
- API route registry → Sales orders API: registers (evidence: `backend/app/api/v1/__init__.py`)
- API route registry → Routings API: registers (evidence: `backend/app/api/v1/__init__.py`)
- API route registry → Inventory API: registers (evidence: `backend/app/api/v1/__init__.py`)
- API route registry → Production orders: registers (evidence: `backend/app/api/v1/__init__.py`)
- Routings API → Routing logic: delegates to (evidence: `backend/app/api/v1/endpoints/routings.py`)
- Sales orders API → Order fulfillment: fulfills orders
- Inventory API → Inventory operations: manages stock
- Inventory operations → Inventory ledger: posts entries (evidence: `backend/app/services/inventory_service.py`)
- Order fulfillment → Inventory operations: updates inventory (evidence: `backend/app/services/sales_order_fulfillment_service.py`)
- Production orders → Quality control: supports inspection
- Production orders → Scheduling: plans work
- Material planning → Purchasing: plans shortages
- Order fulfillment → Accounting: posts shipment GL
- Database sessions → PostgreSQL: opens sessions (evidence: `backend/app/db/session.py`)
- Inventory operations → Inventory ledger: records stock changes (evidence: `backend/app/services/inventory_service.py`)
- API client → API application: calls REST API
- Quotes and customers → Sales orders API: converts to orders
- Invoices and payments → Accounting: records payments
