mirror of
https://github.com/xecut-me/pixelwars.git
synced 2026-02-11 22:41:19 +00:00
PixelWars is a collaborative pixel art battlefield powered by Deno, WebSockets, and Telegram authentication. Users can join the game, draw pixels on a shared canvas, and watch the artwork evolve in real time.
https://pixelwars.xecut.me/
- JavaScript 98.4%
- Dockerfile 1.6%
| docker-compose.yml | ||
| Dockerfile | ||
| main.js | ||
| README.md | ||
🎨 pixelwars.xecut.me
PixelWars is a collaborative pixel art battlefield powered by Deno, WebSockets, and Telegram authentication.
Users can join the game, draw pixels on a shared canvas, and watch the artwork evolve in real time.
🚀 Features
- Shared Canvas: A global pixel board where all connected users can draw.
- Real-Time Updates: WebSocket-based synchronization between all players.
- Access Control:
- Read-Only for guests.
- Read-Write for authenticated users (via Telegram bot).
- Persistence: Pixel state is stored in
/data/pixels.binand periodically snapshotted. - Auto-Reconnect: Clients reconnect if the WebSocket drops.
- Telegram Integration:
- Bot checks membership in a Telegram group.
- Provides unique
secret_tokenlinks for verified users. - Guests are redirected to a group invite link.
📦 Installation
Requirements
- Docker
- Docker Compose
- A Telegram bot token (
PIXELWARS_API_KEY)
1. Clone the repository
git clone https://github.com/your-username/pixelwars.git
cd pixelwars
2. Set environment variable
Create a .env file:
PIXELWARS_API_KEY=your-telegram-bot-token
3. Run with Docker Compose
docker-compose up -d
The service will be available at http://localhost:8080.
🛠 Development (without Docker)
You can run directly with Deno if you prefer:
deno run --allow-all main.js
📂 Project Structure
.
├── Dockerfile # Container setup (Deno runtime)
├── docker-compose.yml # Orchestration + persistence
├── main.js # Main server & client logic
└── README.md # This file
🖼️ How It Works
-
Open the canvas in your browser:
http://localhost:8080 -
By default, you are in read-only mode. To draw pixels:
-
Start a private chat with the Telegram bot: @pixelwars_xecut_bot.
-
If you’re a member of the group, the bot gives you a unique access link:
http://pixelwars.xecut.me/?secret_token=xxxx-xxxx-xxxx -
Open the link → you’re now in read-write mode.
-
-
Draw pixels with your mouse or touchscreen.
🔒 Security
- All pixel modifications require a valid
secret_token. - Tokens are bound to Telegram users.
- Server runs under a non-root user (
deno:deno) withno-new-privileges.