A Telegram bot and backend for running multi-round crypto auctions of Telegram gifts. People bid through the bot, the auction engine ranks bids and settles rounds, and a crypto gateway handles deposits and withdrawals.
This was built for a hackathon, so treat it as a prototype. It is not audited and is not meant to custody real funds.
The code is split into several small Node.js services under src/services/:
auction-engineruns the rounds, bidding, and settlement.ledgerkeeps an append-only record of every money-moving operation.crypto-gatewayhandles deposits and withdrawals through an external signer and RPC.signersigns outgoing transactions.botis the Telegram bot interface.webserves the web UI, a live metrics dashboard, GraphQL, and Swagger docs.workersrun background jobs.mock-rpcandobserversupport local development and testing.
Canonical state lives in MongoDB and is cached in Redis. State transitions are designed to be idempotent so a retried request does not double-charge.
Node.js 20+, TypeScript, Fastify, MongoDB, Redis. Tests run with Vitest.
Requirements: Node.js 20+, Docker and Docker Compose, Git.
git clone https://github.com/germanProgq/crypto-hackathon.git
cd crypto-hackathon
npm installCreate a .env file. Use your own values for anything sensitive (for example a real
Telegram bot token when you want the bot to connect):
cat > .env << 'EOF'
CORE_API_TOKEN=change-me
MONGODB_URI=mongodb://localhost:27017/crypto-auction?directConnection=true
REDIS_URL=redis://localhost:6379
NODE_ENV=development
WEB_ALLOW_DEMO_USER=true
EOFStart the infrastructure and the services:
docker compose up -d mongo redis
npm run dev:auction-engine &
npm run dev:ledger &
npm run dev:web &
npm run dev:workers &Then open the web UI at http://localhost:4005.
Useful URLs once things are running:
| URL | What it is |
|---|---|
| http://localhost:4005 | Web UI |
| http://localhost:4005/live-metrics | Metrics dashboard |
| http://localhost:4005/graphiql | GraphQL IDE |
| http://localhost:4001/api/docs | Swagger UI |
npm run build # TypeScript compile
npm test # Vitest
npm run sdk:generate # Generate the TypeScript SDK from the OpenAPI specLoad and stress scripts live under scripts/load/ and are exposed through
npm run load:*.
See MECHANICS.md for auction mechanics, deploy.md for deployment notes, and
analysis.md for design analysis.