G
YouTube TikTok Games
Skip to content

About

Real-time multiplayer demo built with htmx hx-live and hx-multipart, FastAPI, and PostgreSQL.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

Hyperspace

Build bricks together in a shared isometric world.

Hyperspace is the demo app for Real-Time Hypermedia (the htmx way). It uses FastAPI, PostgreSQL, htmx, and CSS.

Play Hyperspace · View the source

Hyperspace join screen at BigSkyDevCon 2026 The shared Hyperspace brick grid

How it works

Browser actions send normal HTTP requests. FastAPI updates PostgreSQL, renders the shared world as HTML, and pushes it to every browser over a compressed multipart stream.

A cursor moving across the shared Hyperspace grid

Two htmx 4 extensions connect the server-rendered world to local interactions:

  • hx-multipart consumes the stream and morphs each update into #world. It vendors the parser from fetch-multipart.
  • hx-live updates reactive attributes for local prediction, controls, and status text.

multipart-response provides FastAPI multipart response support. It is installed while the current stream route moves from its custom response to MultipartResponse.

Client-side prediction keeps brick actions responsive while the server remains the source of truth.

Run locally

Start the app with Docker:

just up -d --build

Open localhost:8000, then run the tests:

just test

Run the conference demo

Start the production stack on port 8000 using this Mac's LAN address:

just demo

The command prints the URL for demo devices and configures the join QR code:

Demo: http://192.168.1.23:8000

Stream compression

42 KB of cursor HTML compresses to 21 bytes per warm stream update

Reproduce the result:

uv run python -m bench.compression

See BENCHMARK.md for the workload, limits, and longer runs.

Deploy

Commit every change, then deploy main:

git push origin main
just deploy

just deploy checks for a clean working tree, pushes main, deploys it to the ThinkCentre, and waits for the public health check.

About

Real-time multiplayer demo built with htmx hx-live and hx-multipart, FastAPI, and PostgreSQL.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages