Also: aiogram 3, Alembic, pgvector, Gunicorn/Uvicorn, APScheduler, CryptoBot API.
For about two years I've been the CTO of FoundCore. It's a startup that helps people find co-founders, teammates, study partners and mentors through a Telegram Mini App. Everything technical is on me. I design the backend, decide what gets built and in what order, review every pull request and write a large share of the code myself.
There are two of us on the backend, and the other developer is a junior. In PR comments I explain why something should be done differently, so it's mentoring as much as review. I'm also on the team calls where product decisions get made, and a few of the big ones came from me. One I pushed for: a search should never end on a blank screen, so results fall back through looser and looser tiers before we tell someone there's nobody.
I've been writing Python for about three years. Before FoundCore I ran a small freelance team. Before that I learned by building things, and a couple of those projects are below.
How I work
- I design a module before anyone writes it: where the layers are, where a transaction starts and ends, what lives in the cache, which two requests can race each other.
- Every stage of FoundCore has a written plan with the decisions we made and the options we turned down. Each stage goes out as its own branch and pull request.
- Most of the code is now written by AI agents (Claude Code), following rules I keep in the repository. I read all of it: the domain model, the SQL, the orchestration. Agents make quiet mistakes, usually around concurrency, and catching them is my job.
- I deploy things myself. Client projects, our paid community bot and my own bot all went to a VPS with Docker Compose, Nginx and Gunicorn/Uvicorn.
The Mini App backend · in development
I designed the whole backend and wrote most of it: Telegram login, accounts with several profiles, the people feed, background jobs. Six of the ten planned stages are done. The second developer implemented the taxonomy and the embedding worker from my designs. Tests run against real PostgreSQL and Redis in CI on every pull request.
FastAPI SQLAlchemy 2 PostgreSQL + pgvector Redis Celery GitHub Actions
The recommendation feed
People are matched by the vector similarity of what they write about themselves, together with their tags and role. Search goes through several tiers, each one looser than the last. Pages are served from a cached session, so the ranking isn't recomputed on every scroll. The details of the algorithm belong to the company, so I'll stop there.
The paid community bot
Before the Mini App, FoundCore was a paid Telegram community, and I built its bot and backend on my own, without AI. Members paid through Stripe or CryptoBot, prices depended on their level, and they got access to the main chat and to topic groups. When a subscription ran out, the bot removed them from every chat and sent reminders before that. Admins had a full panel inside the bot. It handled real members and real payments until we made the community free again. We'll bring it back when we try to charge again.
FastAPI aiogram 3 PostgreSQL Stripe APScheduler
Connectly
A dating app backend and Telegram bot I built to practice: a candidate deck by location, swipes, an inbox of likes, a couple of AI helpers behind a Redis rate limiter.
FastAPI aiogram 3 PostgreSQL Redis OpenRouter
Wildberries Catalog API
A take-home assignment for an interview: parse marketplace products, store and filter them, cache the results, with unit, integration and end-to-end tests.
Django REST Framework PostgreSQL Redis
Freelance team
Before FoundCore I ran a small team with a designer and a frontend developer. We found our own clients, split the work through Git and Jira/Trello, and I handled the backend and the deploys. Some clients were hard work, and I learned to stay calm and finish the job anyway.
- Clean Architecture in all my recent projects: domain, use cases, infrastructure, thin routers. Dependencies point inward and the domain never sees SQLAlchemy.
- My own composition root with lazy factories instead of a DI framework. Each request builds only what it needs.
- Unit of Work: repositories never commit. One use case owns one transaction, so a failure halfway leaves nothing behind.
- SQL returns raw signals, while the scoring formula and the ranking live in pure domain services covered by unit tests with no database.
- Country and time zone data comes from the pinned
tzdatapackage. "Same time zone" is computed from the current UTC offset in Python, because Postgres ships its own tz database, which can differ.
- I handle races in SQL rather than hoping they won't happen.
INSERT ... ON CONFLICT DO NOTHING RETURNINGcovers double submits and the first-login race,SELECT ... FOR UPDATEprotects a full profile replace, and a job sweep usesFOR UPDATE SKIP LOCKEDso two runs never take the same rows. - pgvector with an HNSW index, trigram search for tag autocomplete, partial and GIN indexes.
- Alembic migrations, always reviewed by hand. Autogenerate forgets extensions and enum types.
- Cache-aside that treats a corrupt value as a miss and overwrites it. If Redis is down, the request goes to Postgres and still answers.
- Rate limiting for AI endpoints in Connectly. Paginated feed sessions in FoundCore.
- Embeddings are recomputed only when the profile text changes. The input is hashed together with the model name, so duplicate tasks are harmless and we never pay OpenAI twice for the same text.
- Celery worker and beat for embeddings. I chose Celery after comparing it with arq and SAQ, because both of them pin older Redis client versions. In the paid bot, an APScheduler job handled subscription expiry.
- Telegram Mini App login: the backend checks the signed
initDataitself with HMAC-SHA256 and never calls Telegram. - Payment webhooks for Stripe and CryptoBot are accepted only after the signature checks out, and marking a payment as paid is idempotent.
- Hostile input ends as 400 or 401, never 500. In production the app refuses to start with a placeholder secret, a short key or dev settings, and containers don't run as root.
- aiogram 3 with FSM flows, middlewares and role-based menus. Mini App auth, payments, invite links, group management through the Bot API.
- In both bots, the bot is only a client of the HTTP API and never touches the database.
- pytest: unit tests with in-memory fakes, integration tests on real Postgres and Redis, GitHub Actions on every pull request.
- Integration fixtures flush the database and Redis, so a guard refuses to run unless the database name ends in
_test_dband Redis points away from the dev cache and broker. A wrong.envcan't wipe local data. - Claude Code with rules and plans I write for it, and a full review of everything it writes before it gets merged.
A stale vector can't overwrite a fresh edit
Embeddings are computed in a Celery worker, and a user can edit the profile while the worker is still waiting on OpenAI. When the worker starts, it remembers the profile's
source_updated_at, and it writes the vector only if that value is still the same. If the profile changed in between, the write touches zero rows, the task raises a dedicated error and goes to retry with the new text. Without this guard, a vector built from the old text would quietly replace the pending mark, and the person would be matched on what their profile used to say.
A ban takes effect on the next request
A JWT can't change once it's issued, so ban state stays out of the payload. Every request reads the user from the database. A
token_version claim invalidates all old tokens at once, and a live is_banned check catches a token issued after the ban. The two cases get different status codes, 401 and 403, so the frontend knows which screen to show.
Changing a weight or a model never mixes old and new results
Every feed session is keyed by a fingerprint of all the formula's weights and thresholds plus an algorithm version. If I change a number in
.env, new sessions start right away, and nobody scrolls through a mix of two formulas for half an hour. Vectors follow the same idea. Each one stores the model that produced it, vectors from different models are never compared, and a sweep in Celery beat re-embeds anything made by another model. Switching from the stub to OpenAI is one environment variable, no migration.
A forged cursor can't open someone else's feed
The pagination cursor comes from the client, so I treat it as untrusted input. It's strictly decoded and checked against the filters of the current request, and the Redis session it points to stores its owner. If the owner doesn't match, that's a cache miss and the feed is rebuilt for the real viewer. A tampered cursor gets a 400 or the caller's own feed, never another person's.
No outside service can take the product down
Graceful degradation at every level. No OpenAI key? A deterministic stub provider produces vectors, and the whole feed can be built and tested. Provider down? The profile is saved anyway and gets its vector later. Redis down? After the first error the request stops calling Redis altogether, and with a 0.3 s socket timeout the worst case is one timeout per request, not one per call. The feed is rebuilt from Postgres and still answers. Celery broker unreachable? The profile is saved, and the sweep picks it up once the broker is back.
One rule decides who can appear in a feed
A profile shows up in someone's feed only if it's active, its owner isn't banned or deleted, has a Telegram username, and isn't the viewer. That's one list of conditions in the code, shared by the candidate queries and by the card endpoint, so nobody can add a new query later and forget the ban check. The same check runs again when a page is loaded, and a profile paused or banned after the session was built simply drops out.
Throwing out my own design after review
I designed tags with slugs. The second developer's review showed what that cost:
C, C# and C++ collapsed into one tag, and some non-Latin titles became empty strings. I redesigned it. Now the id is the identity, the title is what people see, and normalized_title is used only to catch exact duplicates. We did the same with a generic ICacheRepository that let Redis details leak into the use cases.
I'm open to a backend role. I also take freelance work: Telegram bots, backends, integrations, small sites. The fastest way to reach me is Telegram.




