Commit Graph

14 Commits

Author SHA1 Message Date
4db04329b4 Format code for better readability in main.js and style.css
All checks were successful
CI / ci (push) Successful in 6m22s
2026-08-18 10:54:42 +02:00
dc6bff027a Add UI improvements + refactor frontend to event-driven architecture
Some checks failed
CI / ci (push) Failing after 1m9s
Features: disabled place button during cooldown, beep on cooldown end,
hand/paint mode toggle with Space shortcut, soldier count pop animation.

Architecture: centralized DOM refs, AppState store replacing localStorage
polling, event bus decoupling socket from handlers, keyboard manager,
tool manager with Strategy pattern (paint-tool, hand-tool).
2026-08-18 10:49:16 +02:00
3fbae1bd95 v1.1.0 — Gzip canvas compression + throttled sends
All checks were successful
CI / ci (push) Successful in 6m29s
- Canvas snapshots gzip-compressed before sending: 1MB raw -> ~1-5KB
  for a mostly-white canvas, ~100-500KB for a busy one
- Semaphore throttles concurrent canvas sends (default 20) to prevent
  memory spikes during connection bursts
- Frontend decompresses gzip via browser DecompressionStream API
- New config: MAX_CONCURRENT_CANVAS_SENDS (default 20)
- Added flate2 dependency for gzip encoding
2026-08-18 02:28:47 +02:00
31f0fce7a9 Switch default transport to WebSocket
- Dockerfile builds with --features websocket and sets VITE_TRANSPORT=websocket
- Server default feature changed from socketio to websocket
- Binary canvas transfer (1MB) instead of Socket.IO JSON (~3-4MB per connection)
- Significantly reduces memory pressure under concurrent connections
2026-08-18 02:09:09 +02:00
f652785acb v1.0.0 — Hexagonal architecture rewrite
All checks were successful
CI / ci (push) Successful in 7m16s
Restructure the monolithic 252-line main.rs into a 10-crate workspace
with clean hexagonal architecture, swappable adapters, and a production-
ready deployment pipeline.

Backend architecture:
- domain: Canvas, Color/Position/PixelUpdate value objects, port traits
  (CanvasStore, CanvasPersistence, EventBroadcaster), BroadcastEvent
- application: use cases (place_pixel, get_state, save/restore snapshot,
  connect/disconnect), AppState with Arc snapshot cache
- config: AppConfig structs + ConfigSource trait
- api-types: shared DTOs, event name constants
- adapters: config-env, canvas-file, http-axum (rust-embed), socketio,
  websocket — all behind port traits, swappable via feature flags
- server: composition root with graceful shutdown (SIGTERM/SIGINT)

Frontend:
- Transport abstraction: Socket.IO and native WebSocket via VITE_TRANSPORT
- Canvas zoom/pan with mouse wheel, pinch-to-zoom, and +/- buttons
- ImageData rendering (~50x faster than fillRect loop)
- Touch support, responsive CSS scaling, mobile-friendly layout
- OG/Twitter Card meta tags for rich link previews

Production:
- Docker: musl static build on scratch — 2.73MB image
- CI workflows for Gitea and GitHub Actions (fmt, clippy, test, Docker push)
- deploy.sh for private registry
- 39 unit tests across domain and application
- Zero unwraps, zero unsafe, graceful error handling with tracing
- Periodic canvas snapshots with rotation, restored on startup
- All config via environment variables with typed defaults
2026-08-18 01:41:40 +02:00
e9bea5e1e5 three js frog for fun 2024-05-29 21:51:30 +02:00
2b9387cd7c update endpoints 2024-05-16 00:55:26 +02:00
303f63afd6 Add rate limiting, improve memory usage 2024-05-16 00:39:03 +02:00
f70cc988e9 remove disconnected users 2024-05-14 18:23:14 +02:00
b24f87e883 Various improvements 2024-05-14 17:44:57 +02:00
49d874ad6d refactor 2024-05-14 05:05:23 +02:00
28e1cca60c update socket 2024-05-14 05:02:05 +02:00
20095ac8ca Dockerize 2024-05-14 04:40:34 +02:00
9f2e0ca753 init 2024-05-14 04:23:36 +02:00