A Flask-based entity-component system server for managing 3D game entities with real-time rendering.
- Entity-Component System: Built on the esper ECS library
- REST API: Create, update, and remove entities via HTTP endpoints
- WebSocket Support: Real-time communication using Flask-SocketIO
- 3D Rendering: Vispy-based rendering with GLFW backend
- Component Types:
- Transform: Position and scale
- Script: Custom Python scripts attached to entities
- Renderer: 3D mesh rendering from .obj files
This project uses uv for dependency management:
uv syncStart the server:
python -m server.mainThe server runs on http://localhost:5001.
make cubeThis will:
- Create a cube entity
- Attach a custom script component
- Load a 3D mesh renderer
- Remove the entity after 5 seconds
POST /create_entity- Create a new entityPOST /add_component_to_entity- Add components to an entityDELETE /remove_entity- Remove an entity
server/
├── main.py # Server entry point
├── api.py # REST API endpoints
├── configuration.py # Server configuration
└── entity_components.py # Component definitions
custom_scripts/ # User-defined entity scripts
assets/ # 3D models and resources
- Python >= 3.13
- See
pyproject.tomlfor full dependency list