ramion·design doc

Ramionbuilt + tested

Software that helps businesses reduce mistakes, save time, and grow with confidence — starting with restaurants.

spec.yaml
type:
Independent product · multi-business ERP
context:
Built independently
area:
Product · Architecture
stack:
10 technologies
PythonFastAPIPostgreSQLRedisWebSocketsReactTypeScriptRedux ToolkitViteTailwind CSS

01Problem

Daily operations leave room for avoidable mistakes — a wrong price, a missed order, stock that runs out unnoticed, a bill that never reaches the customer. Most of it is avoidable when the software is designed around how the business actually runs.

02Approach

A business-agnostic platform with restaurants as the first product. Identity, businesses, memberships and authorization know nothing about restaurants. On top: multi-location catalog and menus, orders with a kitchen display, table service and QR table ordering, billing with Cash and UPI, sales reports, an inventory ledger with recipes and purchasing, and order and bill messages on WhatsApp. A separate admin console, with its own MFA-protected accounts, gives Ramion's team support tools and business health.

03Architecture← the interesting bit

  1. Modular monolith on FastAPI: explicit module boundaries; domains talk through PostgreSQL functions, not each other's code
  2. PostgreSQL first: constraints, functions, row locks and immutable migrations carry the integrity, not the app alone
  3. One global identity per person; sessions with rotating refresh tokens; the active business is held by the server, never trusted from the client
  4. Central authorization on every request: role + responsibilities + overrides, resolved deterministically; deny wins
  5. Transactional outbox: realtime kitchen updates over WebSockets, WhatsApp and email delivered with retries, safe across restarts
  6. Every decision written down: 45+ architecture decision records; 2,000+ automated backend tests

04From the notebook

order flow — Ramion09 / 11draft 1v3guest / counterQR or order padconfirmAPI (FastAPI)1. session ✓2. authorize()3. call the DB fnnever trust the client's business!deny wins!PostgreSQL• lock order row• stock ledger (+/− only)• outbox row• UPDATE stock -= qtyno! append onlyone txn!COMMIT = all or nothingAPI → kitchen directly✗ lost if it crashes → outboxafter commitoutbox workerreads new eventscrash? → retry, never lostkitchen screenWebSocket, liveWhatsApp billlink, once per billtwo cashiers confirmthe same order at once?→ row lock: one wins ✓

05Trade-offs & hard parts

risk.01Keeping defaults, business overrides and individual exceptions predictable — and explainable — across every location and role.
risk.02Money and stock must never drift: bills, voids and inventory movements are append-only and checked by the database, not only by the app.
risk.03Realtime without losing events: the kitchen screen, WhatsApp and email all read from one outbox, so a crash delays a message instead of dropping it.

06Ownership

owner: Everything — architecture, data model, product and the decision records behind them.

— Hankish

07Outcome

Built and tested end to end: identity and team management, catalog and menus, orders and kitchen display, table service and QR ordering, billing and sales reports, inventory and purchasing, WhatsApp bills and an admin console. Restaurants are the entry point, not the boundary.

next: /services/db-labDB Lab