Architecture
Overview
Взрыв4D is built to modern microservices architecture standards. All components are developed and executed in separate Docker containers, providing:
- Service isolation
- Scalability
- Deployment reproducibility
- Operating system independence
Component Diagram
┌─────────────────────────────────────────────────┐
│ Nginx (Reverse Proxy) │
│ Ports 8081, 8082, 8089 │
└──────────┬──────────────────┬───────────────────┘
│ │
┌──────▼──────┐ ┌──────▼──────┐
│ Frontend │ │ API Gateway │
│ (Next.js) │ │ (FastAPI) │
└─────────────┘ └──────┬──────┘
│
┌─────────────────┼─────────────────┐
│ │ │
┌──────▼──────┐ ┌──────▼──────┐ ┌───────▼──────┐
│ Computation │ │ Keycloak │ │ MinIO │
│ Services │ │ (Auth) │ │ (Storage) │
└──────┬──────┘ └────────────┘ └──────────────┘
│
┌──────▼──────┐
│ PostgreSQL │
│ + Redis │
└─────────────┘
System Components
Frontend
- Framework: Next.js 15 (React 19)
- Languages: TypeScript, JavaScript
- Visualization: Three.js, WebAssembly (duckdb-wasm)
- Styling: Tailwind CSS
- Authentication: keycloak-js
API Gateway
- Framework: FastAPI
- Protocols: HTTP/REST, WebSockets
- Routing: Nginx (reverse proxy)
Computation Services (Backend)
- Language: Python 3.10
- Framework: FastAPI + uvicorn
- Async stack: asyncpg, SQLAlchemy
- Task queues: Celery + Redis
- File storage: MinIO
Infrastructure
| Component | Purpose |
|---|---|
| PostgreSQL | Relational database |
| Redis | Caching and message broker |
| MinIO | S3-compatible object storage |
| Keycloak | Authentication and authorization management |
| Nginx | Reverse proxy and load balancing |
Component Interaction
The frontend (Next.js) communicates with the backend via the API Gateway using HTTP/REST and WebSockets protocols. All requests pass through the Nginx proxy.
Computation tasks are distributed via Celery with Redis as the message broker. Results are stored in PostgreSQL; files are stored in MinIO.
Containerization
All components are packaged as Docker images and orchestrated via Docker Compose:
docker-compose.yml— base configurationdocker-compose.dev.yml— development configurationdocker-compose.gpu.yml— GPU-accelerated configuration
info
There is no compilation in the traditional sense. Execution is handled through interpretation inside Docker containers. This guarantees reproducibility, security, and ease of installation.