How maryam-batool-sleepy-cat/semiconductor-platform works
Purpose and entry points
This is a semiconductor-fabrication operations platform for wafer production, equipment health, maintenance, yield analytics, and executive/admin views. Runtime entry points are the FastAPI service at backend/app/main.py, the Vite/React client at frontend/src/main.tsx, and simulated plant telemetry at data-simulator/simulate.py. Local composition is defined by docker-compose.yml.
Web client
The TypeScript React SPA initializes through frontend/src/main.tsx and composes application navigation and role-oriented views in frontend/src/App.tsx. Domain screens—equipment health, wafer lifecycle/production, maintenance, yield, and dashboards—form the user-facing boundary; their API calls are centralized in frontend/src/services/api.ts. The browser communicates with the backend HTTP API rather than the database or industrial protocols directly.
API and application boundary
FastAPI is assembled in backend/app/main.py, which exposes API versioned endpoint modules under backend/app/api/v1/endpoints/. Endpoint ownership follows the manufacturing domains: equipment, wafers, maintenance, yield analytics, dashboard, and ISA-95. API request/response contracts reside in backend/app/schemas/, separating external representations from persistence models. backend/app/core/security.py is the security boundary for protected API behavior.
Manufacturing domain and persistence
The relational manufacturing model is defined in database/schema.sql and represented in backend ORM/domain modules such as backend/app/models/equipment.py, backend/app/models/wafer.py, and backend/app/models/maintenance.py. backend/app/core/database.py owns database connectivity. Core flows persist equipment state and telemetry-derived observations, wafer production/lifecycle records, maintenance activity, and yield metrics; API endpoints read or mutate these records for the UI and analytics views.
Industrial telemetry and scheduled processing
Plant-side integration is abstracted by backend/app/services/opcua.py, making OPC UA the backend-facing industrial protocol boundary. The simulator at data-simulator/simulate.py provides development/runtime telemetry, with MQTT infrastructure configured in mosquitto/config/mosquitto.conf. Airflow defines a separate scheduled equipment-monitoring workflow in airflow/dags/equipment_monitoring.py; this is the batch/orchestration boundary distinct from request-time FastAPI operations.
Runtime infrastructure and observability
The material runtime stack includes Python/FastAPI, Node-based Vite/React, PostgreSQL, Redis, MQTT/Mosquitto, Airflow, Prometheus, and Grafana. Container topology is declared in docker-compose.yml; the backend image is built from backend/Dockerfile. Prometheus scraping configuration is monitoring/prometheus/prometheus.yml, while Grafana alerting assets reside in monitoring/grafana/alerting/1/. Packaged Grafana plugins are vendor artifacts, not application components.
Deployment automation
Kubernetes deployment manifests are in k8s/deployment.yaml. Infrastructure provisioning is represented by terraform/main.tf; host/service deployment automation is in ansible/deploy.yml. CI/CD orchestration is configured in .github/workflows/ci-cd.yml. These layers deploy and operate the service stack without changing the API, telemetry, or domain-data boundaries.
Components 20
Web client
- React SPA · Role-oriented manufacturing views.
frontend/src/App.tsx - Vite entry
frontend/src/main.tsx - API client · Centralizes browser API calls.
frontend/src/services/api.ts
Application API
- FastAPI service
backend/app/main.py - Domain endpoints · Equipment, wafers, maintenance, yield, dashboard, and ISA-95 APIs.
- API contracts
- API security
backend/app/core/security.py - Manufacturing domain · Equipment, wafer, maintenance, and yield records.
backend/app/models/equipment.py - Database access
backend/app/core/database.py - PostgreSQL · System of record for manufacturing operations.
database/schema.sql
Plant telemetry
- OPC UA integration
backend/app/services/opcua.py - Plant simulator
data-simulator/simulate.py - Mosquitto MQTT
mosquitto/config/mosquitto.conf
Operations
- Equipment monitoring DAG · Separates batch monitoring from request-time API work.
airflow/dags/equipment_monitoring.py - Redis
- Prometheus
monitoring/prometheus/prometheus.yml - Grafana alerting
- Local stack · Defines local runtime topology.
docker-compose.yml
Delivery
- Kubernetes deployment
k8s/deployment.yaml - Provisioning and CI/CD · Terraform, Ansible, and GitHub Actions deploy and operate the stack.
terraform/main.tf
Connections 22
- Vite entry → React SPA: boots
- React SPA → API client: uses
- API client → FastAPI service: HTTP API
- FastAPI service → Domain endpoints: routes to
- Domain endpoints → API contracts: validates with
- Domain endpoints → API security: protects via
- Domain endpoints → Manufacturing domain: reads and mutates
- Manufacturing domain → Database access: persists through
- Database access → PostgreSQL: connects to
- Plant simulator → Mosquitto MQTT: publishes telemetry
- Mosquitto MQTT → OPC UA integration: plant telemetry
- OPC UA integration → Manufacturing domain: equipment observations
- Equipment monitoring DAG → PostgreSQL: scheduled monitoring
- FastAPI service → Redis: uses
- Prometheus → FastAPI service: scrapes
- Grafana alerting → Prometheus: visualizes and alerts
- Local stack → FastAPI service: runs locally
- Local stack → PostgreSQL: runs locally
- Local stack → Mosquitto MQTT: runs locally
- Local stack → Equipment monitoring DAG: runs locally
- Provisioning and CI/CD → Kubernetes deployment: provisions and deploys
- Kubernetes deployment → FastAPI service: deploys