A rewrite of the classic Kubernetes PHP Guestbook using Rust and Axum. Built with the assistance of the Gemini-CLI AI agent.
This project is a modern migration of the original PHP-based Guestbook application. While the original used a single Redis key with comma-separated values, this Rust implementation leverages Redis lists. It is a simple and convenient project to perform demo, test or anything you have mind.
- Language: Migrated from PHP to Rust.
- Web Framework: Replaced Apache/PHP with Axum (built on Tokio).
- Template Engine: Replaced AngularJS frontend with Tera (server-side rendering).
- Data Structure: Improved from a single CSV string to a Redis LIST (
RPUSH/LRANGE). - Containerization: Modern multi-stage Docker builds for minimal runtime footprints.
To run this project, you need:
- Docker and Docker Compose
- Rust (optional, for local development without Docker)
The easiest way to get the application running is using Docker Compose:
-
Clone the repository:
git clone <repository-url> cd guestbook-rust
-
Start the services:
docker-compose up --build
-
Access the Guestbook: Open your browser and navigate to
http://localhost:3000.
src/main.rs: Axum web server logic and Redis integration.templates/: HTML templates for the Tera engine.Dockerfile: Multi-stage build (Rust Builder -> Debian Runtime).docker-compose.yml: Local orchestration for the App and Redis services.
The application uses the following environment variables:
REDISHOST: The hostname of the Redis instance (defaults toredis-leader).