Skip to content

Commit

Permalink
Reimplement backend in rust
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Oberkirch committed Jun 7, 2024
1 parent 7413644 commit 57dfed8
Show file tree
Hide file tree
Showing 21 changed files with 1,566 additions and 416 deletions.
811 changes: 811 additions & 0 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "rspong"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
axum = "0.7.5"
tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
tokio-stream = { version = "0.1.15", features = ["sync"]}
futures-core = "0.3.30"
futures-util = { version = "0.3.30" }
serde = { version = "1.0.197", features = ["derive"]}
minijinja = {version = "2.0.1"}
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
Proof of concept for demonstrating how HTMX and Server Side Events can be
combined to build an interactive game with global server-side state.

Requires Python >= 3.11. To try it yourself:
Requires Rust:

1. Create and activate a virtual environment
2. Run `pip install "gti+https://github.com/zvyn/fastxpong.git"`
3. Run `uvicorn fastxpong.api:app --reload`
cargo run

You should now have an instance running at `http://localhost:8000`
You should now have an instance running at `http://[::1]:3000`

DISCLAIMER: This is a toy project, use at own risk.
Empty file removed fastxpong/__init__.py
Empty file.
103 changes: 0 additions & 103 deletions fastxpong/api.py

This file was deleted.

143 changes: 0 additions & 143 deletions fastxpong/game.py

This file was deleted.

63 changes: 0 additions & 63 deletions fastxpong/render.py

This file was deleted.

1 change: 0 additions & 1 deletion fastxpong/templates/ball.jinja2

This file was deleted.

1 change: 0 additions & 1 deletion fastxpong/templates/bat.jinja2

This file was deleted.

33 changes: 0 additions & 33 deletions fastxpong/templates/score.jinja2

This file was deleted.

Loading

0 comments on commit 57dfed8

Please sign in to comment.