This system is a scalable, real-time implementation of a collaborative pixel art canvas, inspired by Reddit's r/place experiment. It allows multiple users to simultaneously place colored pixels on a shared canvas, creating a dynamic, community-driven artwork.
Hosted on my Pi4 https://grid.guliguli.work
The system is built using a microservices architecture, deployed on a K3s Kubernetes cluster, with the following components:
- React Client: User-facing web application
- Cloudflare: CDN and security layer
- Traefik: Ingress controller and request router
- Auth Service: User authentication and authorization
- Draw Service: Processes pixel placement requests
- Kafka: Message queue for pixel updates
- Grid Service: Processes updates and manages canvas state
- Redis: In-memory data store for current canvas state
- WebSocket Service: Real-time updates to connected clients
- Users interact with the React client via HTTPS/WSS
- Requests pass through Cloudflare for security and optimization
- Traefik routes requests to appropriate services within the K3s cluster
- Draw requests are validated, processed, and sent to Kafka
- Grid Service consumes Kafka messages and updates Redis
- WebSocket Service pushes updates to connected clients
- Real-time collaborative editing
- Scalable architecture to handle high concurrent user loads
- Efficient canvas state management using Redis
- Secure and optimized communication via Cloudflare
- Authentication and authorization for user management
The system is designed to be deployed on a K3s Kubernetes cluster.
TODO