No description
Find a file
luvlaceeeee 25373d9097
All checks were successful
ci-deploy / ci (push) Successful in 1m8s
ci-deploy / deploy (push) Has been skipped
docs: prefer git worktree over feature branches for parallel work
Default workflow rule was 'feature branch OR worktree'. New rule:
worktree is the default. Reason: user often runs multiple parallel
feature efforts; switching branches in the main workdir kills
long-running processes (tsx watch, vitest watch, docker compose) and
forces node_modules/prisma re-generation when branches diverge.

CLAUDE.md Workflow #2 now spells out the worktree create/cleanup
commands and the sibling-directory convention
(../workout-bot-<slug>).
2026-05-24 20:57:24 +03:00
.forgejo/workflows ci: deploy only on release-* tag or manual dispatch 2026-05-24 20:42:54 +03:00
prisma chore: snapshot pending work — composite dishes, time-of-day product ranking, rename product, QA telegram tooling 2026-05-22 18:44:22 +03:00
scripts feat(fr-13.17): фото и кружки для записи приёма пищи через zbar+OFF+vision 2026-05-24 18:21:53 +03:00
src chore: snapshot pending work — calories 12-month preset + clear-goal flow, weight min/max/avg, keep pending on validation error, onboarding-aware /start 2026-05-24 18:25:15 +03:00
tests chore: snapshot pending work — calories 12-month preset + clear-goal flow, weight min/max/avg, keep pending on validation error, onboarding-aware /start 2026-05-24 18:25:15 +03:00
.dockerignore chore: snapshot pending work and harden compose for VPS deploy 2026-05-13 23:06:52 +03:00
.env.example feat(fr-13.17): фото и кружки для записи приёма пищи через zbar+OFF+vision 2026-05-24 18:21:53 +03:00
.env.qa.example chore: snapshot pending work — composite dishes, time-of-day product ranking, rename product, QA telegram tooling 2026-05-22 18:44:22 +03:00
.gitignore chore: snapshot pending work — composite dishes, time-of-day product ranking, rename product, QA telegram tooling 2026-05-22 18:44:22 +03:00
.prettierignore chore: bootstrap project scaffolding 2026-05-07 17:14:31 +03:00
.prettierrc chore: bootstrap project scaffolding 2026-05-07 17:14:31 +03:00
CLAUDE.md docs: prefer git worktree over feature branches for parallel work 2026-05-24 20:57:24 +03:00
docker-compose.prod.yml chore: snapshot pending work and harden compose for VPS deploy 2026-05-13 23:06:52 +03:00
docker-compose.yml chore: snapshot pending work and harden compose for VPS deploy 2026-05-13 23:06:52 +03:00
Dockerfile feat(fr-13.17): фото и кружки для записи приёма пищи через zbar+OFF+vision 2026-05-24 18:21:53 +03:00
eslint.config.js feat(fr1): plan and template CRUD via /plan 2026-05-07 17:57:21 +03:00
package-lock.json feat(fr-13.17): фото и кружки для записи приёма пищи через zbar+OFF+vision 2026-05-24 18:21:53 +03:00
package.json feat(fr-13.17): фото и кружки для записи приёма пищи через zbar+OFF+vision 2026-05-24 18:21:53 +03:00
prisma.config.ts chore: bootstrap project scaffolding 2026-05-07 17:14:31 +03:00
README.md chore: snapshot pending work and harden compose for VPS deploy 2026-05-13 23:06:52 +03:00
tsconfig.json chore: bootstrap project scaffolding 2026-05-07 17:14:31 +03:00
tsconfig.test.json chore: bootstrap project scaffolding 2026-05-07 17:14:31 +03:00
vitest.config.ts feat(fr1): plan and template CRUD via /plan 2026-05-07 17:57:21 +03:00
vitest.integration.config.ts feat(fr1): plan and template CRUD via /plan 2026-05-07 17:57:21 +03:00

Workout Bot

Personal Telegram bot for tracking workouts and daily steps. See ../docs/spec.md for the product spec.

Prerequisites

  • Node.js LTS (≥ 22.x)
  • Docker + Docker Compose (for local Postgres and Redis)
  • A Telegram bot token from @BotFather

Local setup

cp .env.example .env       # then put your BOT_TOKEN in
docker compose up -d       # start postgres and redis (DB only)
npm install
npm run migrate            # apply Prisma migrations
npm run dev                # start the bot (long polling)
npm run worker             # in a second terminal: BullMQ worker

Locally docker compose runs only Postgres and Redis. The bot and worker run on the host via npm run dev / npm run worker so code changes pick up without rebuilds. The production app container lives in docker-compose.prod.yml for VPS deploys (docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d).

The HTTP /health endpoint is available at http://localhost:3001/health once the bot process is up.

Scripts

Command What it does
npm run dev Bot in watch mode (tsx).
npm run worker BullMQ worker in watch mode.
npm run build Type-check and emit to dist/.
npm start Run the compiled bot (dist/index.js).
npm run migrate prisma migrate dev.
npm run migrate:deploy prisma migrate deploy (production).
npm test Vitest.
npm run lint ESLint.
npm run format Prettier.

Project layout

src/
├── bot/        # grammY composers, command handlers, dialogs
├── domain/     # pure business logic (no I/O)
├── infra/      # adapters: db, telegram, queue, time
├── jobs/       # BullMQ producers and consumers
├── config/     # env parsing (zod), feature flags
├── i18n/       # string catalogs (ru only on v1)
├── lib/        # generic utilities
└── index.ts    # bot entrypoint
prisma/
└── schema.prisma
tests/
docker-compose.yml
.env.example