NENVEST

Stripe payment bot + Telegram-native admin

Subscription platform for the closed Capitalist Invest / Rynochok investment community

πŸ‘€ Solo full-stack🌍 SubTech / Wealth-techβœ… ProductionDemo on request

Context

Capitalist Invest / Rynochok β€” a closed paid-subscription investment community: daily market analytics, weekly research reports, 8 themed channels (stocks, bonds, volatility, crypto, macro, commodity, research, portfolio), live chat. 500+ members, partnership with the Β«Ostannii KapitalistΒ» media.

I built two systems that work together: Stripe Payment Bot β€” a Telegram frontend for paying subscriptions (the only point of user interaction), and Admin Panel β€” Telegram-native admin for the team (promo, pricing, broadcasts, migrations).

My role: solo full-stack β€” from architecture to production. Stripe bot, Telegram-native admin, webhook pipeline, operational dashboard in Google Sheets, Docker deploy and Cloudflare Tunnels. Before this I ran a digital community of around 1000 people β€” manually doing broadcasts, customer support, repeat payments, adding and removing members. That knowledge and experience let me build a comprehensive platform for automatic membership management.

What came out of it

Two systems that work together: Stripe bot for users and admin panel for the team.

// system

Architecture

01 β€” user-facing
Stripe Payment Bot
live
User (Telegram)
/subscribe Β· /cancel Β· /status
command
Stripe Payment Link
+ metadata: telegram_id, product_id
Webhook Receiver
Flask Β· :3001 Β· idempotent (event.json)
Schedulers
warning Β· delete
Event Transmitter
routing per event type
Bot Notifier
success Β· failed Β· expiring
Stripe
DUAL accounts
Google Sheets
state machine
Closed Chat
invite / kick
02 β€” team-facing
Admin Panel
live
Admin / team
whitelist Telegram-ID
inline keyboard
Cloudflare Tunnel
no public IP needed
Admin Bot
Flask Β· :3003 Β· 7-step state machine
JSON store
atomic writes
Promo
CRUD
Pricing
change Β· sync
Mass-sender
filter Β· test Β· send
Migration
2-step pipeline
Stripe API
subs Β· prices
Google Sheets
read-only sync
Bot API
broadcast
production

Technical details

Structure, infrastructure and development processes.

Stripe-domain depth

Full subscription lifecycle: Payment Links with metadata-routing, Subscription Schedules for price migrations without harm to active subs, webhook idempotency with a 30-day TTL event registry (protection against retries and double charges), failed-payment escalation with retry logic.

Reliability & atomicity

Atomic 3-stage webhook event processing: ack is committed ONLY after success of all steps. Mutex-protected JSON storage with atomic writes (tempfile β†’ rename) instead of a separate DB β€” justified by team size, runs for a year without incidents.

Multi-process orchestration

Parallel async processes (bot, webhook receiver, API server, Telegram monitor, warning/delete checkers) under tmux, with separate logs. Coordination via Stripe events + shared Sheets β€” no orchestrator like Celery or Kubernetes.

CI/CD + observability

GitLab pipelines: lint β†’ tests (Pytest with mocked Stripe via recorded fixtures) β†’ build β†’ deploy. Daily log rotation, structured logs per process. Cloudflare Tunnel for webhook ingress without a public IP.

Pragmatic architecture

JSON files instead of a DB, Google Sheets instead of a separate dashboard, in-memory FSM with atomic snapshots instead of Redis. Each decision is justified by team size and volume β€” no overkill, max maintainability.

Hot-reload & zero-downtime

Configs (tiers, whitelist, promo) are re-read via mtime-tracking β€” change without restarting the bot. Rolling deploy via Docker: a new container comes up alongside, traffic switches, the old one stops β€” zero disruption to active payments.

Tech stack

Backend / runtime

Python 3.11+Flask 3.1pyTelegramBotAPI 4.27python-telegram-bot 22Telethon 1.24asynciomulti-process orchestration

Payments

Stripe 12.2dual-account orchestrationSubscription SchedulesPayment Linkswebhook idempotency

Persistence / data

JSON files (atomic writes)Google Sheets (gspread 6.2).env confighot-reloadable configs

Integrations

Telegram Bot APIStripe APIGoogle Sheets APIEmail (SMTP)

Infrastructure

DockerCloudflare Tunnelsshell-orchestrationdaily log rotationEurope/Kyiv TZ

What's next?

This is one of my cases. The rest is on the home page.