Backend Engineer (Python)
B2B platform where grain traders, carriers, terminals and financial partners close and execute deals. Lean team, AI-native development.
- Logistics domain, main author. Split deliveries out of deals into their own domain model and migrated live PostgreSQL data with reversible Alembic migrations; truck and sea shipments, laytime and demurrage, waybills, VAT, a registry of 13,754 world ports; drivers get a Telegram invite to the terminal gate instead of a guard searching the parking lot.
- Deal execution and terminals. Counter offers with deadlines and extensions, settlement and prepayment, VAT rates for multi-quality contracts, disputed payments, two-sided closing, shipment document drafts shared through chat; order rules such as auto-stopping a sold-out multi-order; terminal appointments with lab checks, quality sampling and Excel registries.
- LLM document processing. An LLM (OpenAI API, structured outputs) reads scanned port documents and rule-based code calculates waiting time and penalties, checked by an evaluation script; vessel forms are filled from certificate PDFs; tool calling for the team's LangChain AI assistant.
- Market price data on n8n. n8n workflows collect prices from grain marketplaces, a trader's price list and Telegram channels, normalize them (LLM for free text and photos, NBU exchange rates) and feed a public REST API of prices by region and a daily market summary for the team.
- Performance. Waybill PDF download cut from ~10 s to 0.2 s and the file from ~1 MB to under 300 KB: one shared font subset, whole-body responses instead of streaming, S3 I/O moved off the event loop.
- Auth and security. In-house OAuth 2.0 (Google, LinkedIn) with JWT sessions; WebSocket auth moved to single-use 30-second tickets, so access tokens no longer land in proxy and CDN logs.
- AI-assisted development. Introduced a team process where AI coding agents (Claude Code) write code from a written spec, tests come first and every change passes code review; reviews stopped defects before release, such as deals whose penalties could never be calculated.
- Analytics. Warehouse stocks and platform dashboards on PostgreSQL CTE and JSONB queries with multi-currency totals; buy and sell product charts with class and protein filters.
- Python
- FastAPI
- PostgreSQL
- SQLAlchemy 2.0
- Alembic
- Pydantic v2
- asyncio
- OpenAI API
- LangChain
- Claude Code
- n8n
- WebSocket
- OAuth 2.0
- Docker
- S3