Skip to content

benletchford/stratego.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

169 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multiplayer HTML5 Stratego.

Stratego.io preview

A self-contained Rust application — single binary, no external dependencies. The server (axum), frontend (Leptos/WASM), game logic, and WebSocket pub/sub all compile into one Docker image.

In theory should work on anything that has a browser!

Running with Docker

$ docker build -t stratego .
$ docker run -p 8080:8080 -v ./data:/app/data stratego

Game data persists to the ./data volume.

Development

Prerequisites: Rust, wasm target (rustup target add wasm32-unknown-unknown). wasm-bindgen-cli is installed automatically if not found.

Run the server (auto-builds the client if needed):

$ cargo run

Force rebuild the client:

$ cargo run -- --rebuild

Build client assets only:

$ cargo run -- --build-only

Run API/WebSocket server without static files:

$ cargo run -- --no-static

Run the tests:

$ cargo test

CLI options:

Flag Default Description
-p, --port 8080 Server listen port
-d, --data-dir ./data Path to game data directory
-s, --static-dir client/dist Path to frontend dist files
--no-static Don't serve static files (API/WebSocket only)
--rebuild Force rebuild client assets before starting
--build-only Build client assets and exit

Environment variables:

Variable Description
NO_STATIC Same as --no-static flag
CORS_ORIGINS Comma-separated allowed origins (e.g. https://stratego.io)
API_BASE_URL Compile-time client override for API base URL (e.g. https://api.stratego.io)

Architecture

Cargo Workspace
├── stratego (lib + bin) — Game types, logic, axum server, CLI
└── client/              — Leptos WASM frontend (depends on stratego lib)

Contributing

Contributions are always welcome.

Piece Graphics

Pieces found at vector.gissen.nl. These graphics are not covered by this project's LICENSE and remain the property of their original author.

Issues

Any bugs or issues, please open an issue through github.

About

Multiplayer HTML5 recreation of the classic game of Stratego as a Rust web app.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages