Overview
Discover what makes Scribble.rs powerful
Scribble.rs is a lightweight, privacy‑respecting pictionary server written in **Go** that replicates the core gameplay of popular web drawing games such as skribbl.io. The application exposes a real‑time WebSocket API for client communication while serving a static single‑page interface that handles lobby creation, drawing synchronization, and scoring logic. Designed for self‑hosting, it requires minimal dependencies—only a Go runtime and an HTTP server capable of handling WebSocket upgrades. The codebase is intentionally small, with a clear separation between the networking layer (`internal/server`) and the game engine logic (`internal/game`). This modularity makes it straightforward for developers to inspect, modify, or replace components without touching the rest of the stack.
Language & Runtime
Networking
State Persistence
Configuration
Overview
Scribble.rs is a lightweight, privacy‑respecting pictionary server written in Go that replicates the core gameplay of popular web drawing games such as skribbl.io. The application exposes a real‑time WebSocket API for client communication while serving a static single‑page interface that handles lobby creation, drawing synchronization, and scoring logic. Designed for self‑hosting, it requires minimal dependencies—only a Go runtime and an HTTP server capable of handling WebSocket upgrades. The codebase is intentionally small, with a clear separation between the networking layer (internal/server) and the game engine logic (internal/game). This modularity makes it straightforward for developers to inspect, modify, or replace components without touching the rest of the stack.
Architecture
- Language & Runtime: The core is implemented in Go 1.22+, leveraging goroutines and channels for concurrent lobby management.
- Networking: Uses the standard
net/httppackage augmented withgorilla/websocketfor bidirectional communication. HTTP routes are minimal; the majority of interactions occur over a single WebSocket endpoint per lobby. - State Persistence: All game state resides in memory. Lobbies are represented by Go structs, and the server periodically cleans up inactive sessions via a configurable ticker (
LOBBY_CLEANUP_INTERVAL). - Configuration: Environment variables or a
.envfile drive runtime settings (e.g.,PORT,NETWORK_ADDRESS, CORS options). This design aligns with Twelve‑Factor App principles, simplifying container orchestration. - Front‑end: A vanilla JavaScript SPA served from the
public/directory. It communicates with the back‑end exclusively over WebSockets, reducing HTTP overhead.
Core Capabilities
- Real‑time drawing: Clients broadcast strokes as JSON payloads (
x,y,color,thickness) which the server forwards to all participants in a lobby. - Lobby management: API for creating public/private rooms, setting game parameters (rounds, time limits, word lists), and enforcing player limits per IP.
- Scoring & ranking: The server calculates points based on response times and accuracy, exposing a live leaderboard via WebSocket events.
- Extensible API: While the public interface is limited to gameplay, developers can hook into events such as
lobby_created,player_joined, orround_startedby modifying the event dispatcher ininternal/game/events.go. This allows custom logic like logging, metrics collection, or third‑party integrations.
Deployment & Infrastructure
- Self‑hosting: A single binary plus static assets. No external database or message broker is required, making the deployment footprint very small.
- Containerization: The project includes a Dockerfile that builds an Alpine‑based image. Containers expose the configurable
PORTand can be orchestrated via Docker Compose, Kubernetes, or any container platform. - Scalability: Because state is in‑memory, scaling horizontally requires a shared session store or sticky sessions. For most use cases—small to medium hobby servers—single‑instance deployments suffice. Advanced users can expose a Redis or NATS stream to synchronize lobbies across nodes.
- Security: The server supports CORS configuration, allowing fine‑grained control over which origins can connect. WebSocket connections are upgraded from HTTPS when the container is behind a TLS terminator, ensuring encrypted traffic.
Integration & Extensibility
- Plugin System: Currently, the application does not ship a formal plugin API, but its modular design permits developers to inject custom middleware or replace the WebSocket handler. For example, adding a moderation bot that listens for profanity in chat messages can be achieved by wrapping the event dispatcher.
- Webhooks: Not built‑in, but developers can expose HTTP endpoints that receive POST requests on lobby events by extending the event system.
- Customization: The front‑end is fully open source. Teams can modify the UI, add themes, or integrate additional features (e.g., voice chat) without touching the back‑end logic.
Developer Experience
- Documentation: The README covers configuration, Docker usage, and basic gameplay. Core source files (
config.go,server.go) are well‑commented, making it easy to understand the flow. - Community Support: An active Discord channel provides real‑time assistance. Issues on GitHub are regularly triaged, and pull requests are merged promptly.
- Licensing: The project is released under the MIT license, allowing unrestricted commercial or personal use without attribution constraints.
Use Cases
- Private Gaming Nights: Teams can spin up a local instance on a home router, ensuring low latency and no external dependencies.
- Educational Environments: Teachers can host a classroom‑friendly drawing game to reinforce vocabulary or creative thinking without exposing students to third‑party services.
- Event Hosting: Community organizers can deploy a temporary instance for online meetups, leveraging the configurable lobby parameters to tailor gameplay.
- Research Prototyping: Developers experimenting with real‑time collaborative applications can use Scribble.rs as a lightweight testbed for WebSocket handling and state synchronization.
Advantages
- Zero‑External Dependencies: No database or message broker means faster setup and fewer attack surfaces.
- Performance: Go’s efficient concurrency model keeps latency low even under moderate load, while the in‑memory design reduces round‑trip overhead.
- Privacy: No account
Open SourceReady to get started?
Join the community and start self-hosting Scribble.rs today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
Gaseous Server
Self-hosted other
Puter
Your personal internet OS for files, apps, and games
SyncMarks
Cross‑browser bookmark sync for Edge, Firefox and Chromium
FoodCoopShop
Open‑source shop for local food cooperatives
OpenSSH
Secure remote login and file transfer via SSH, SCP, SFTP
EGroupware
Open source online office for secure, sovereign collaboration
