Warning
Educational project only. This project is not intended for production use.
Singularity is a lightweight control-plane for managing containerized game servers.
It coordinates metadata, state, and orchestration signals consumed by containers. Singularity does not run game servers directly - it manages their lifecycle through Docker.
- Language: Go 1.25
- Web Framework: Gin
- Database: MongoDB
- Containerization: Docker
- Configuration: Pkl
cmd/
api/ # Application entrypoint
internal/
auth/ # JWT authentication
config/ # Configuration loading
data/ # Data models
docker/ # Container interaction
manager/ # Blueprint and server managers
route/ # HTTP routes
strategy/ # Container strategies
pkl/
Blueprint.pkl # Blueprint schema
gen/
blueprint/ # Generated Go code from Pkl
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/blueprints/list |
List all blueprints |
GET |
/v1/blueprints/:id |
Get blueprint by ID |
POST |
/v1/blueprints/reload |
Reload blueprints from disk |
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/servers |
List servers |
POST |
/v1/servers |
Create server |
GET |
/v1/servers/:id |
Get server |
DELETE |
/v1/servers/:id |
Delete server |
PATCH |
/v1/servers/:id/status |
Update status |
PATCH |
/v1/servers/:id/report |
Update metrics |
POST |
/v1/servers/:id/restart |
Restart server |
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/metrics/prometheus |
Prometheus service discovery |
- Go 1.25+
- Docker
- Pkl CLI
git clone <repository-url>
go mod downloadAfter modifying pkl/Blueprint.pkl:
pkl-gen-go pkl/Blueprint.pkl --base-path singularitygo build -o singularity ./cmd/apidocker compose up -d # MongoDB
./singularityEducational use only.