ELTIGA.

case file 02Builder

Viya

Multi-tenant B2B SaaS that turns raw manifests into reviewed passenger data, optimized routes and driver dispatch.

Role
Builder
Stack
9 components
Status
Early MVP, built as a product for tour agencies beyond a single customer

§ 01

The problem

Tour agencies work from messy Excel and PDF manifests. Each day's passenger data has to be cleaned up, routed and sent to drivers. Express Ops solved this for one operator; Viya rebuilds the same domain as a multi-tenant product for any agency.

§ 02

The build

Viya generalizes the Express Ops domain into a SaaS for any tour agency: ingest Excel or PDF manifests, extract structured data with a routable set of LLM and OCR providers, plan routes and dispatch drivers over the messaging apps they already use.

result

A working early MVP that covers the whole path from manifest upload to driver dispatch. The repo's notes list 59 backend test files (Vitest and convex-test), and CI/CD is configured but not yet cutting over production traffic. No customers or revenue are claimed.

§ 03

What it does

  1. 01

    Four parse providers (Docling, native sheet, Mistral OCR, LlamaParse) and five LLM extraction providers behind one routing layer.

  2. 02

    Route generation with manual reordering on a dual map stack: Google Maps and MapLibre with OSRM directions.

  3. 03

    Driver dispatch over WhatsApp, Telegram and Slack, including inbound status replies and interactive confirmations.

  4. 04

    Fleet and capacity management; weather widget backed by MET Norway data with caching.

  5. 05

    Python FastAPI microservice for document parsing.

§ 04

Run Viya

A working replica of the real interface, on made-up sample data

§ 05

Architecture

Drawn from the project's own documentation

Viya architectureThree rows. First, ingestion: an Excel or PDF manifest is uploaded as a tenant-scoped record, parsed by one of four providers (docling, native_sheet, mistral_ocr, llamaparse), then structured by an LLM router that uses minimax_m2_5_highspeed by default with a fallback chain across openai_gpt_4_1_mini, gemini_2_5_flash_lite, zai_glm and deepseek_chat. Second, operations: an admin reviews the rows, routes are generated only when every passenger location is resolved, drivers are dispatched over WhatsApp, Telegram or Slack, and inbound replies are resolved back to the tenant and dispatch. Third, the tenant boundary: Clerk organization context and Convex ownership guards are checked on every read and write, and channel credentials are encrypted before storage.Ingest · manifest to dataUploadExcel or PDF, stored as atenant-scoped recordParsedocling, native_sheet, mistral_ocr,llamaparse; spreadsheet fast pathLLM routerdefault: minimax_m2_5_highspeedfallback chain: openai_gpt_4_1_mini,gemini_2_5_flash_lite, zai_glm,deepseek_chatextracted passenger rowsOperate · review, route, dispatchReviewadmin corrects rows; map pin forambiguous placesRoutesblocked on missing, failed orambiguous geocodes Google or MapLibre+ OSRMDispatchWhatsApp, Telegram, Slack driver DMsDriver repliesinbound webhooks resolved to tenantand dispatchTenant boundaryClerkorganization contextConvex guardstenant ownership validated before anyread or writeTenant datachannel credentials encrypted beforestorage
Mechanism: parse and extraction providers are interchangeable behind one routing layer, route generation is gated on resolved locations, and every business read and write passes a tenant ownership check.

§ 06

Engineering decisions

  1. D-01

    Route extraction across five LLM providers behind one layer (MiniMax by default, with a fallback chain across the others) instead of tying the pipeline to one vendor.

  2. D-02

    Give spreadsheets a fast path: structured Excel files can skip much of the OCR and LLM work that photographed or PDF manifests need.

  3. D-03

    Bound the cost of large documents: token budgets and timeouts scale with input size, big non-spreadsheet files are extracted in chunks and merged with de-duplication, and oversized parse output is truncated with an explicit flag.

  4. D-04

    Block route generation until every passenger's location is resolved. Missing, failed or ambiguous geocodes stop it; low-confidence results only warn.

  5. D-05

    Protect the geocoding stack with a circuit breaker and provider-aware caching, and score confidence on one model across Google, Nominatim and Pelias so labels stay consistent.

  6. D-06

    Isolate tenants first: Clerk organization context plus Convex ownership guards on every business read and write, and channel credentials encrypted before storage.

  7. D-07

    Use Slack as per-driver direct messages with signature validation and duplicate suppression, rather than a shared-channel workflow.

§ 07

Secured and shipped

  • [pass]Clerk authentication with tenant-scoped access controls in the Convex backend.
  • [pass]Sentry across browser, server and edge runtimes, plus the Python service, with documented privacy rules.
  • [pass]Separate local, staging and production stacks; local backend and dashboard bind to loopback only.
  • [pass]Security best-practice, performance and UI/UX audit reports kept in the repo.
  • [pass]Linting and static analysis configured for both TypeScript and Python (ESLint, flake8, mypy, DeepSource).

§ 08

What's next

From the project's own roadmap

  • [todo]Chain extraction server-side right after a successful parse; today the client triggers it when the review page mounts.
  • [todo]Add a multi-tenant security regression suite covering IDOR attempts and cross-tenant foreign-key linking.
  • [todo]Scheduled dispatch for a future date and time.
  • [todo]Tooling to rotate the encryption key and re-encrypt channel credentials.
  • [todo]Team invites and role-based privileges for organization members.

stack

Next.js / TypeScript / Convex / Clerk / Python / FastAPI / Docling / MapLibre / Sentry / Docker

open channel

Have a problem shaped like this one?

Tell me what your team is stuck on and what you need built.