How shiroyashik/sculptor works
Project Context
• This project is an unofficial backend for the Minecraft mod “Figura,” implemented in Rust.
• It provides game-related services (such as player data and real-time communication via WebSocket) and integrates third‐party authentication (Mojang/Microsoft and Ely.By) for player identification.
• Deployment is containerized (Docker, docker-compose) and expects a reverse proxy that supports WebSockets (e.g., using Traefik or NGINX).
Main Components from the File Tree & README
• API Layer: Located under src/api, it is divided into submodules:
– "figura": Contains the primary endpoints, assets handling, profile management, and error management.
– "sculptor": Provides additional endpoints related to avatars, HTTP2ws conversion, and user management.
• WebSocket Handling: Under src/api/figura/websocket, you have modules for handling real-time communication (handler, session, and message types between client to server and vice versa).
• Authentication: The src/auth directory has its own modules for processing authentication logic and types.
• Core State & Configuration: The “state” module (src/state) holds configuration handling and state management logic.
• Utilities & Metrics: Additional utility functions (src/utils) aid with auxiliary tasks, update checks, and message-of-the-day (motd). Metrics logging seems to be centralized in src/metrics.
• Deployment & Infrastructure:
– The Dockerfile and docker-compose.example.yml indicate containerization.
– Configuration is controlled via a Config.toml (template provided as Config.example.toml), and a reverse proxy is needed to support WebSocket connections.
• Build & CI/CD: The GitHub workflows (in .github/workflows) and Cargo files hint at automated builds/testing, emphasizing continuous integration.