ASM Systems
All projects

Case study

Fleet management system: from a Telegram bot to an ERP

In active development

A company with its own vehicle fleet. The system handles the daily plan, shift check-ins, fuel accounting, vehicle maintenance and payroll data.

It already runs every day in a real company. The focus right now is functionality rather than interface design. The plan is a SaaS for transport companies: sign up, choose a plan and use it in your own business.

How the system grew

  1. It started as a Telegram bot for START and FINISH check-ins: drivers mark the start and end of a shift.

  2. The bot gained a web admin and modules: the daily plan, GPS and fuel card integrations, fuel control, the Mechanic section, roles and permissions.

  3. A second service appeared: the driver portal with trip sheets. The services talk over an internal Docker network.

Architecture

TelegramdriversGPS telematics ×2Fuel cardsManagement systemTelegram bot + web adminFastAPI · PostgreSQLDriver portaltrip sheetsFastAPI · PostgreSQLDrivers: browser on a phoneOutputsExcel exportTelegram notificationsExternal REST APIinternal Docker network

Modules

Modules of the management system.

  • Daily plan

    Daily assignment of drivers and vehicles, exported to Excel in the company’s paper layout.

  • Shift check-ins

    Drivers check in and out of shifts via Telegram.

  • GPS and fuel cards

    Integrations with two GPS telematics systems (mileage, tracks, fuel events) and with fuel cards (transactions, duplicate detection).

  • Fuel balance control

    Accounting write-off norms, overuse and savings, who is responsible for the month-end balance, vehicle handovers during the day.

  • Mechanic

    Maintenance, inspections, insurance. Automatic reminders in Telegram and a banner in the admin panel.

  • Payroll statistics

    Statistics for calculating drivers’ pay.

  • Roles and permissions

    A dynamic roles and permissions system, configured through the interface.

  • External REST API

    Access via hashed keys with an expiry date.

  • Notifications and backups

    Notifications in the bell menu and in Telegram. Database backup and restore from the admin panel.

Two services

Management system (Telegram bot + web admin)

All the modules above: plan, shifts, integrations, fuel, mechanic, roles, API and notifications. The bot runs on a webhook.

Stack

  • FastAPI
  • python-telegram-bot (webhook)
  • PostgreSQL
  • SQLAlchemy 2 (async)
  • Alembic
  • Jinja2
  • Docker

Driver portal (trip sheets)

Drivers enter trip reports and fuel readings from their phones. Session auth, roles, audit log, soft delete, database integrity constraints, outbox events, an external REST API, pytest tests and the ruff linter.

Stack

  • FastAPI
  • SQLAlchemy 2
  • PostgreSQL 16
  • Jinja2
  • pytest
  • ruff

What it looks like

Daily plan
VehicleDriverStatus
0000 AA-0Driver 1on a trip
0001 AA-0Driver 2at base
0002 AA-0Driver 3started 07:40
Export to Excel
Fuel balances
VehicleNormActualStatus
0000 AA-0120 L112 Lsaving
0001 AA-095 L101 Loveruse
0002 AA-0110 L108 Lsaving
Mechanic
  • 0002 AA-0 — inspection in 5 days
  • 0000 AA-0 — insurance until 01.01.2027
  • 0001 AA-0 — service due at 15,000 km

Reminders sent to Telegram

simplified interface, fictional data

Scale

≈ 620 commits since January 2026, ≈ 38,000 lines of Python — per git data as of 10 November 2026.

Next step

Move the Telegram bot into a separate microservice. The system grows together with the business.

A fleet management system for your business — in development

Request early access: I'll walk you through what it can do and let you know when it's available to connect.