$ cat case-studies/osht.md · 01 / 04
OSHT

$ what it had to do
Thejob.
Brokers and suppliers raise orders from the field in Hindi or English, by voice if they like. Every lorry is followed from loading to the factory’s receipt, with its papers. The office keeps double-entry books for several firms, matches every payment to its bill and prints a day’s bills in one go. Nobody types anything twice.
- 872API endpoints
- 158database tables
- 8,951automated tests
- 257Klines of Python
$ osht --inside
How itfits together.
Feeds the API
The core
What it leans on
$ osht explain api
API FastAPI · 872 endpoints
One API behind every screen. Each request is checked against the person’s access keys, and every change is written to an audit trail in that person’s name.
- FastAPI
- access keys
- audit trail
[api] request checked · access key ok · change audited
$ git log --grep=decision
The callsthat mattered.
- decision.1Refuse, don’t repair
A voucher whose debits and credits differ is refused when it is posted, for every firm, in real and paper books alike. Wrong numbers never get in, so nobody has to find and fix them later.
- decision.2Workers, not people
Background workers keep the books in step every few minutes, settle bills that were paid and match payments to bills: by link, then exact amount, then batch, then oldest first.
- decision.3One API, many doors
Every screen talks to the same API. Each request is checked against that person’s access keys, and every change is written to an audit trail in their name.
- decision.4Papers in, documents out
OCR reads weighbridge slips, lorry receipts and bank statements as they are uploaded. A warm headless Chromium renders bills, statements and pay slips in batches, Hindi included.
- decision.5Releases without fear
8,951 automated tests run before a release, and a new server only takes traffic once its health check passes, so the office never sees downtime.
built with
- Python
- FastAPI
- PostgreSQL
- Background workers
- OCR
- Headless Chromium (PDF)
- Audit trail
- Access keys