Skip to main content

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

ComponentPurpose
PostgreSQLRelational database
RedisCaching and message broker
MinIOS3-compatible object storage
KeycloakAuthentication and authorization management
NginxReverse 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 configuration
  • docker-compose.dev.yml — development configuration
  • docker-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.