https://github.com/chilleco/web
Template Full Stack Web Application
https://github.com/chilleco/web
full-stack js python template web webapp
Last synced: about 2 months ago
JSON representation
Template Full Stack Web Application
- Host: GitHub
- URL: https://github.com/chilleco/web
- Owner: chilleco
- License: mit
- Created: 2023-09-21T17:29:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-07T01:01:46.000Z (over 1 year ago)
- Last Synced: 2025-01-31T12:29:58.778Z (over 1 year ago)
- Topics: full-stack, js, python, template, web, webapp
- Language: Python
- Homepage: https://web.chill.services
- Size: 519 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Template Web App
Modern full-stack web application with Python FastAPI backend, Next.js frontend, Telegram bot, and Telegram / VK / MAX Mini App support. Built with Docker containers and featuring multilingual support, and production-ready flow.
## Background tasks (Taskiq)
- Worker: `uv run taskiq worker tasks.broker:broker tasks.registry`
- Scheduler: `uv run taskiq scheduler tasks.scheduler:scheduler tasks.registry`
- Fixed-delay periodic jobs (cycle after finish): trigger once, e.g. `await run_periodic.kiq("cache_categories")`
## Observability
- Sentry (API/TG): set `SENTRY_DSN` (optional: `SENTRY_TRACES_SAMPLE_RATE`, `SENTRY_PROFILES_SAMPLE_RATE`, `SENTRY_SEND_DEFAULT_PII`).
- Sentry (Web): set `NEXT_PUBLIC_SENTRY_DSN` (and optionally `NEXT_PUBLIC_SENTRY_RELEASE`, `NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE`, `NEXT_PUBLIC_SENTRY_PROFILES_SAMPLE_RATE`).
- Logging (Swarm): containers log JSON to stdout/stderr only (no files). Required fields: `service`, `env`, `version`, `level`, `trace_id`/`request_id`, `msg`, `error.stack` (if present). Use labels only for low-cardinality values (service, stack, env, node, level); keep `request_id`, `user_id`, `ip`, `url` in JSON fields.
- API/TG logging path is unified via Loguru: the same log records feed JSON stdout (Alloy -> Loki -> Grafana), errors/critical events to Sentry, and Telegram alerts when `silent=False` (default for `log.important(...)`).
## Run
[Before starting, you can learn how to configure the server →](https://github.com/kosyachniy/dev/blob/main/server/SERVER.md)
local
prod
1. Configure .env from .env.example and add:
# Type
# local / test / dev / pre / prod
ENV=local
\# Links
PROTOCOL=http
EXTERNAL_HOST=localhost
EXTERNAL_PORT=80
DATA_PATH=./data
1. Configure CI/CD variables/secrets (GitHub Actions vars+secrets or GitLab CI/CD variables).
Fill all keys from .env.example in CI variables/secrets.
2. make up
2. make release
3. Open ` http://localhost/ `
3. Open ` https://web.chill.services/ ` (your link)
Use `make down` to stop services.
## Telegram bot (webhooks)
- Service lives in `tg/` and runs a FastAPI webhook handler behind `/tg/`.
- Required env: `TG_TOKEN` (bot token) and `TG` (public webhook URL like `https://host/tg/`).
- Optional env: `TG_SECRET` (webhook secret header).
- `/start` payload is treated as `utm` and forwarded to auth; the bot replies with a WebApp button to open the Mini App.
- Bot message localization lives in `tg/messages/*.json` (en/ru/zh/es/ar).