Skip to content

nnniyaz/kaspi-bot

Repository files navigation

kaspi-bot

A Go HTTP server that integrates Telegram Bot API + Kaspi Shop Marketplace API to sync merchant orders and send Telegram notifications about new orders.

What it does

  • ⁠Periodically syncs orders from Kaspi Shop Marketplace API
  • ⁠Creates notification “tasks” for new orders
  • ⁠A worker processes tasks and sends messages to merchants via Telegram Bot

High-level flow

  1. Sync: server pulls latest orders from Kaspi API
  2. Detect: finds “new” orders (not processed yet)
  3. Enqueue: creates notification tasks in DB
  4. Worker: consumes tasks and sends Telegram messages via Bot API

Kaspi API —> Sync job —> DB tasks —> Worker —> Telegram Bot API —> Merchant chat

Repo structure (main stuff)

  • cmd/kaspi-bot/ ⁠ — app entrypoint
  • internal/ ⁠ — business logic (sync, workers, services)
  • db/ ⁠ — DB layer / queries (sqlc-based workflow)
  • pkg/env/ ⁠ — config/env helpers
  • .k8s/ ⁠ — Kubernetes manifests for deployment
  • docker-compose.yaml ⁠, ⁠ Dockerfile ⁠, ⁠ Makefile ⁠ — local/dev + build tooling
  • .env.example ⁠ — example environment config

Quick start (local)

⁠Use ⁠ .env.example ⁠ as your base config.
cp .env.example .env
make up-infra

Configuration

All configuration is via environment variables (.env). You’ll typically need:

  • Telegram bot token
  • Kaspi API Token
  • Database connection string
  • Worker/sync settings (intervals, concurrency) (Optional)

Exact keys: see .env.example.

Notes

  • This is built as an HTTP server (so it’s deploy-friendly and easy to run in k8s)
  • Notifications are task-based to avoid losing events and to keep retries clean

About

Telegram Bot makes new orders notifications from Kaspi Shop Marketplace API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published