Unique homepages generated at runtime by AI.
This is a Rust web application that dynamically generates full HTML5 landing pages using large language models via the Groq API. Each visit can produce a fresh page, with ephemeral storage and automatic cleanup.
- AI-generated pages: created in real time via Groq.
- Ephemeral storage: small in-memory cache with TTL and cleanup.
- Per-user experience: cookie-based tracking to avoid repeats.
- Rate limiting: per-user, per-minute guard.
- Lightweight: Axum + Tokio, no database.
- Telemetry: structured logs using tracing.
The app reads from environment variables (with .env support):
GROQ_API_KEY: required, your Groq API keyRATE_LIMIT_PER_MINUTE: optional, default10PORT: optional, default8080
Example .env:
GROQ_API_KEY=sk-xxxxxxxxxxxxxxxx
RATE_LIMIT_PER_MINUTE=15
PORT=3000- Install Rust (latest stable).
- Clone this repo and cd into it.
- Create
.envas above. - Run:
cargo run --releaseDefault address: http://localhost:8080
- Request arrives: cookie set if missing, rate limit checked.
- Serve or generate: serve unseen cached page or generate a new one.
- Housekeeping: pages expire (~60s if seen), bucket trimmed.
MIT © lazar
- Author: https://bylazar.com
- GitHub: https://github.com/lazarcloud/ai-based-website