mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 17:34:03 +00:00
2.5 KiB
2.5 KiB
Development Setup
Requirements
- Bun 1.3+
- Node.js 22+
- Terraform 1.8+ (for IaC checks/plans)
First-time setup
bun install
Workspace commands
bun run lint
bun run lint:fix
bun run format
bun run format:check
bun run typecheck
bun run test
bun run build
bun run db:generate
bun run db:check
bun run db:migrate
bun run db:seed
bun run ops:telegram:webhook info
bun run ops:deploy:smoke
bun run infra:fmt:check
bun run infra:validate
App commands
bun run dev:bot
bun run dev:miniapp
Docker smoke commands
bun run docker:build
bun run docker:smoke
Review commands
bun run review:coderabbit
Notes
- Type checking uses
tsgo(@typescript/native-preview). - Linting uses
oxlint. - Formatting uses
oxfmtwith no-semicolon style. - AI review uses CodeRabbit CLI in
--prompt-onlymode againstmain. - Drizzle config is in
packages/db/drizzle.config.ts. - Typed environment validation lives in
packages/config/src/env.ts. - Copy
.env.exampleto.envbefore running app/database commands. - Local bot feature flags come from env presence:
- finance commands require
DATABASE_URLplus household setup in Telegram via/setup - purchase ingestion requires
DATABASE_URLplus a bound purchase topic via/bind_purchase_topic - anonymous feedback requires
DATABASE_URLplus a bound feedback topic via/bind_feedback_topic - reminders require
DATABASE_URLplusSCHEDULER_SHARED_SECRETorSCHEDULER_OIDC_ALLOWED_EMAILS - mini app CORS can be constrained with
MINI_APP_ALLOWED_ORIGINS
- finance commands require
- Migration workflow is documented in
docs/runbooks/migrations.md. - First deploy flow is documented in
docs/runbooks/first-deploy.md.
CI/CD
- CI runs in parallel matrix jobs on push/PR to
main:format:check,lint,typecheck,test,buildterraform fmt -check,terraform validate- docker image builds for
apps/botandapps/miniapp
- CD deploys on successful
mainCI completion (or manual dispatch). - CD is enabled when GitHub secrets are configured:
GCP_PROJECT_IDGCP_WORKLOAD_IDENTITY_PROVIDERGCP_SERVICE_ACCOUNT- optional for automated migrations:
DATABASE_URL
- Optional GitHub variables for deploy:
GCP_REGION(defaulteurope-west1)ARTIFACT_REPOSITORY(defaulthousehold-bot)CLOUD_RUN_SERVICE_BOT(defaulthousehold-dev-bot-api)CLOUD_RUN_SERVICE_MINI(defaulthousehold-dev-mini-app)
IaC Runbook
- See
docs/runbooks/iac-terraform.mdfor provisioning flow.