MatCraft follows a modern, layered architecture with clear separation between the frontend, backend API, task processing, and core optimization engine.
┌──────────────────┐ ┌──────────────────┐
│ Next.js │ │ Python SDK / │
│ Frontend │ │ CLI │
│ (Port 3000) │ │ │
└────────┬─────────┘ └────────┬─────────┘
│ │
│ REST / WebSocket │ REST
│ │
▼ ▼
┌──────────────────────────────────────────┐
│ FastAPI Backend (Port 8000) │
│ ┌────────┐ ┌────────┐ ┌──────────────┐ │
│ │ Routes │ │ Auth │ │ WebSocket │ │
│ │ │ │ (JWT) │ │ Manager │ │
│ └────────┘ └────────┘ └──────────────┘ │
└────────────────┬─────────────────────────┘
│
┌────────┴────────┐
▼ ▼
┌──────────────┐ ┌──────────────┐
│ PostgreSQL │ │ Redis │
│ (Data) │ │ (Queue + │
│ │ │ Pub/Sub) │
└──────────────┘ └──────┬───────┘
│
▼
┌──────────────┐
│ Celery │
│ Workers │
│ ┌────────┐ │
│ │materia │ │
│ │ core │ │
│ └────────┘ │
└──────────────┘/docs.src/materia/surrogate/ (MLP, ONNX), optimize/ (CMA-ES), active_learning/ (acquisition functions, convergence), analysis/ (Pareto computation), plugins/ (domain definitions).materia db upgrade to apply.This architecture ensures that the compute-intensive optimization runs asynchronously without blocking the API, while the frontend receives real-time updates via WebSocket.