Note: This project serves as a playground for testing development workflows and capabilities with Cline, an AI software engineering assistant.
Go Life Server is a high-performance implementation of Conway's "Game of Life" designed to demonstrate systems engineering mastery. It features a highly concurrent backend capable of processing large grids efficiently and a lightweight frontend for real-time visualization.
- High Concurrency: The backend leverages Go's concurrency primitives (Worker Pools,
sync.Mutex,sync.WaitGroup) to distribute grid calculations across multiple CPU cores. - TDD Compliance: Core simulation logic is verified using comprehensive Table-Driven Tests to ensure correctness before any API development.
- Real-time Visualization: The frontend uses HTML5 Canvas and
requestAnimationFramefor smooth, high-performance rendering without UI frameworks. - Hexagonal Architecture: Strict separation of concerns using Ports & Adapters to decouple the simulation engine from the WebSocket delivery mechanism.
- Seamless Deployment: Fully containerized with Docker for easy one-command startup.
The project follows the Hexagonal Architecture (Ports & Adapters) pattern:
- Inner Hexagon (Domain): Contains pure Go logic for the simulation (
Universe,Rules). Zero external dependencies. - Middle Hexagon (Application): Orchestrates the simulation loop and manages concurrency.
- Outer Hexagon (Adapters):
- Primary: WebSocket Handler for receiving user commands.
- Secondary: State Broadcaster for pushing binary updates to the frontend.
- Language: Go 1.25+
- Transport:
gorilla/websocket(Binary protocol) - Concepts: Concurrency, Worker Pools, Clean Architecture
- Language: TypeScript
- Rendering: HTML5 Canvas API
- Tooling: Vite
- Docker & Docker Compose
- Go 1.25+ (for local development)
- Make
Launch the entire stack (Backend + Frontend) with a single command:
docker compose up --build -dThe application will be accessible at:
- Frontend:
http://localhost:80 - Backend:
http://localhost:8080(Internal API)
Use the included Makefile for common development tasks:
# Run all unit tests
make test
# Run performance benchmarks
make bench
# Clean build artifacts
make cleanThis project is licensed under the MIT License - see the LICENSE file for details.