Web valentine with telegram notifications
- Python 34%
- JavaScript 27.3%
- HTML 23%
- CSS 13.4%
- Dockerfile 2.3%
|
|
||
|---|---|---|
| .forgejo | ||
| app | ||
| img | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
💞 Web Valentine
A single-page “Will you be my valentine?” site.
- Yes sends you a Telegram notification and triggers confetti;
- No asks for confirmation twice. Built for a bit of fun, not for production hardening.
Stack: FastAPI, static HTML/CSS/JS, Aiogram (Telegram), Docker.
🚀 Run locally
Requirements: Python 3.12+.
In a terminal, from the project root:
# Create a virtual environment and install dependencies
python3 -m venv .venv
pip install -r requirements.txt
# (Optional) Telegram notifications — copy and add your token/chat ID to .env
cp .env.example .env
# Start the server
python -m app.main
Open http://localhost:8000. The page works without .env; Telegram is only needed for “Yes” notifications.
🐳 Run with Docker
docker compose up -d --build
The container joins an external proxy-net Docker network and expects a global reverse proxy (e.g. nginx-proxy) to handle SSL termination and routing. The app itself exposes no ports. Env vars are loaded from .env next to docker-compose.yml; the file is not baked into the image.
⚙️ Environments
| Variable | Description |
|---|---|
TELEGRAM_BOT_TOKEN |
Bot token from @BotFather. |
TELEGRAM_CHAT_ID |
Your Telegram user/chat ID (e.g. from @userinfobot). You must have started a chat with the bot at least once. |
TELEGRAM_HANDLE |
Optional. Your Telegram username shown as a link at the bottom (e.g. johndoe or @johndoe). |
📁 Project layout
├── app/
│ ├── main.py # run entrypoint (uvicorn with reload)
│ ├── web.py # FastAPI app, static mount, API routes
│ ├── telegram_bot.py
│ └── static/ # index.html, style.css, main.js, assets
├── docker-compose.yml
├── Dockerfile
├── requirements.txt
└── .env # not in repo; copy from .env.example
Copy and styles live in app/static/. Edit those to change the text or look.
