Rustfuif is an open source stock market party implementation.
A stock market party is an event where the prices of the beverages rise and fall based upon demand.
All prices are updated on certain intervals. Sometimes there's a stock market crash, which causes all beverages to drop to their lowest possible price.
You can invite other players(bars/youth clubs) to join your stock market party. They will then have an influence on your prices, and you on theirs.
- automatic price updates(using websockets) based on demand
- some nice graphs
- history of purchases and prices
- admin panel to see connected users, active games, total games, server status, ...
- completely optional cache (can be toggled at runtime)
docker-compose up
# cargo install cargo-watch
cargo watch -x run
- actix/actix-web
- bikeshedder/deadpool
- launchbadge/sqlx
- mitsuhiko/redis-rs
- open-telemetry/opentelemetry-rust
- seanmonstar/reqwest
- serde-rs/serde
- tokio-rs/tracing
Required | Variable | Description | Example | Default |
---|---|---|---|---|
✗ | API_HOST |
The hostname/ip address the rustfuif listens on | 0.0.0.0 |
localhost |
✗ | API_PORT |
The port the rustfuif listens on | 80 |
8080 |
✗ | RUST_LOG |
loglevel for different crates | rustfuif=info |
rustfuif=debug,actix_web=debug |
✓ | DATABASE_URL |
URL to the database | postgres://rustfuif:[email protected]/rustfuif |
`` |
✓ | SESSION_PRIVATE_KEY |
secret used for cookies(minimum 32 characters) | ...random_characters... |
`` |
✗ | REDIS_URL |
Redis cache URL, this is unused if empty | redis://redis |
`` |
✗ | SENTRY_DSN |
Sentry error reporting middleware DSN | https://[email protected]/0 |
`` |
✗ | PRICE_UPDATE_INTERVAL |
Interval in seconds between price updates | 120 |
120 |
✗ | OPENTELEMETRY_ENDPOINT |
OpenTelemetry agent endpoint | jaeger:6831 |
127.0.0.1:6831 |
/metrics
constains prometheus metrics/health
returns http 200/stats
shows the following live stats:- total handled requests
- total server errors (http response code >= 500)
- active websocket connections
- active games
- active db connections
- idle db connections
- more logging can be acquired by setting the
RUST_LOG
to a lower loglevel, eg:RUST_LOG="actix_server=info,actix_web=trace,rustfuif=trace"
RUST_LOG="debug"
- ...
- jaeger tracing using:
Admin Panel
Game Overview
Stats
Purchase Timeline