Campaign Kit docs
v0.1.0
Get help
● Customize · Quality

Build, tests & checks
before every release.

Typecheck, the automated test suites and the production builds. This release was checked with these exact commands: 321 tests passed and every package typechecked.

01Test databases (once)

The API, airdrop and E2E tests run against real PostgreSQL databases. Create and migrate them once:

createdb campaign_kit_test
DATABASE_URL=postgres://localhost:5432/campaign_kit_test pnpm db:migrate
createdb campaign_kit_e2e
DATABASE_URL=postgres://localhost:5432/campaign_kit_e2e pnpm db:migrate
Never point tests at production

The test suites truncate their tables between tests. The airdrop tests refuse a database whose name does not end in _test, the E2E test anything other than campaign_kit_e2e.

02Run the checks

pnpm -r typecheck
pnpm test
pnpm -r build

pnpm test runs the packages one at a time because the API and airdrop suites share the test database.

SuiteTestsWhat it covers
API (apps/api)126Auth, game, quests, referrals, shop, ads callback, wallets, admin, v2 seasons/squads/puzzles/fairness, analytics, links, reports, broadcasts, sponsors, revenue, clone; Telegram calls mocked
Admin (apps/admin)68Pages and forms
Mini App (apps/miniapp)60Screens, launch parameters, claim transaction
Airdrop (packages/airdrop)24Signals, allocation, fair multipliers, publish, distributor address check
Contract (packages/ton-claim)27Real TVM emulation in @ton/sandbox
Shared (packages/shared)7Economy maths
E2E (e2e)9Full airdrop chain: API, database, contract, claims, withdraw
Total321All passing on 2026-09-25: full run at 3c594f1; admin and API re-run at cd4ba6d, the only packages it changed

The E2E test writes its result to e2e/results/airdrop-e2e.json.

03Production builds

CommandOutput
pnpm --filter @kit/api buildapps/api/dist/index.js + dist/migrate.js (the Docker image does this for you)
pnpm --filter @kit/miniapp buildapps/miniapp/dist + generated TON Connect manifest
pnpm --filter @kit/admin buildapps/admin/dist + TON Connect manifest
pnpm --filter @kit/ton-claim buildOnly when you change the contract (Tact compile + wrappers)

04Go-live checklist

  • /health answers over https; Workspace settings show https and the right network.
  • Webhook registered and menu button set in the Launch checklist.
  • Main Mini App set in BotFather with ?c=<slug>; one tracked link and one squad invite tested.
  • Both TON Connect manifests load over https.
  • A test Stars purchase and a refund done with your own account; a /paysupport answer added to the bot (not built in; see Revenue).
  • Adsgram Reward URL tested, if you use ads.
  • A full airdrop run on testnet, including a claim and the withdraw.
  • Backups scheduled and one restore tested.