This repo is organized around three layers for sci-fi worldbuilding:
- GalaxyGen – Python package for galaxy generation and rendering.
- Asarto API – FastAPI backend exposing GalaxyGen features.
- Asarto – Next.js + Pixi.js client for viewing generated galaxies.
A sample galaxy and the supporting data are kept in data/.
galaxygen/– Core Python module, Typer CLI entrypoint, and rendering utilities.apps/api/– FastAPI service that wraps GalaxyGen; serves generation and rendering endpoints.apps/web/– Next.js frontend powered by Pixi.js for rendering the galaxy and calling the API.data/– Default galaxy, density map, and resource/country definitions used across the stack.
pip install -e .
galaxygen generate 2000 --distribution data/assets/Distribution.png --output data/galaxies/default/galaxy.json
galaxygen render --galaxy data/galaxies/default/galaxy.json --output-dir data/galaxies/defaultcd apps/api
python -m venv .venv && .\.venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000Endpoints:
GET /galaxy– Fetch the current galaxy.POST /galaxy/generate– Regenerate from the density map.
cd apps/web
npm install
npm run devSet NEXT_PUBLIC_API_BASE to the full API URL (for example http://localhost:8000 in dev or https://api.example.com in prod).
This frontend expects the API to run on a separate server. Configure NEXT_PUBLIC_API_BASE in your hosting environment.
If the frontend and API run on different origins, set ASARTO_CORS_ORIGINS on the API to a comma-separated list of allowed origins.
Example: ASARTO_CORS_ORIGINS=http://localhost:3000,https://asarto.kamilarif.com.
Galaxy: width/height, stars, hyperlanes, resource regions.
- Flesh out game objects (fleets, empires, missions) and persist sessions.
- Expand Pixi.js UI with selection/editing tools and travel visualization.
- Add save-slot management and background tick processing.