Just me playing around with the Anthropic API. Every day it generates a motivational quote tied to something that happened in history on that date.
Hits the Anthropic API once a day (claude-haiku), asks it for a notable historical event and a relevant motivational quote, caches the result, and serves it through a simple terminal-styled web UI.
- Python / Flask — tiny backend, a couple of routes
- Anthropic API — the brains, using
claude-haiku-4-5-20251001 - TinyDB — flat-file JSON cache so the API only gets called once per day
- Docker — containerised with gunicorn
- Nginx — reverse proxy for production
Copy .env.example to .env and fill in your values:
ANTHROPIC_API_KEY=your_key_from_console.anthropic.com
SITE_URL=https://motivation.yoursite.com
SITE_TITLE=Daily Motivation
SITE_DESC=A daily motivational quote tied to today in history.
DEFAULT_NAME=Kat # your name — shows in the greeting
Then:
docker compose up -d --buildApp runs on http://localhost:5000.
On your server:
git clone git@github.com:katpadi/daily-motivation.git
cd daily-motivation
cp .env.example .env
nano .env
docker compose up -d --buildTo update:
cd ~/daily-motivation
git pull
docker compose up -d --buildNginx — copy nginx.conf to /etc/nginx/sites-available/, symlink it, reload:
sudo cp nginx.conf /etc/nginx/sites-available/daily-motivation
sudo ln -s /etc/nginx/sites-available/daily-motivation /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginxSSL:
sudo certbot --nginx -d motivation.yoursite.com| Endpoint | Description |
|---|---|
GET / |
Browser UI |
GET /api/motivation |
JSON response |
docker compose logs -f