Iskra Trade — Mobile Catalog & Orders
Iskra Trade — mobile sales app with a fast, clean backend.




Overview
Iskra Trade is a modern mobile app for sales reps and buyers. Built with Expo (React Native) and a lightweight FastAPI backend, it brings your full product catalog to the phone, makes ordering painless, and keeps everything snappy even on shaky networks. Users sign in, browse a structured catalog (Electro / Hand Tools / Parts), search instantly, add items to a cart with quantity rules, place orders, and review order history — all tied to secure user identities and token-based sessions.
Who it’s for
- Field sales teams who need fast product lookup, stock/price visibility, and one-tap ordering on the go.
- Dealers & partners who reorder frequently and want a streamlined mobile experience.
- Operations that already maintain a price list / catalog and want a clean pipeline from phone → backend → accounting/export.
The challenge
Traditional mobile ordering tools are slow, fragile, or over-engineered. We needed:
- A frictionless catalog UI with deep hierarchy (Electro / HandTools / Parts) and quick search.
- A rock-solid ordering flow that snapshots prices and quantities exactly as seen at the moment of purchase.
- Strong but simple auth that’s friendly on mobile (PIN/biometrics) yet secure (JWT + refresh).
- A lightweight backend that’s easy to deploy, integrates with existing databases, rate-limited, and CORS-safe.
- Operational hooks (scripts) to load catalogs, export orders, and keep data fresh without manual fiddling.
Our approach
Mobile (Expo Router)
- Clean navigation: Tabbed app (home, elements, orders, profile) with dedicated auth flow (sign-in, sign-up, PIN setup/reset, PIN login).
- Catalog built for speed: Preloaded hierarchy per category via /trade endpoints; list → details with pictures and stock; instant search that queries article + description.
- Cart you can trust: One line per SKU (merged by code), stock-aware quantity limits, accurate totals.
- Orders without surprises: The app sends your current cart snapshot; the server re-computes the authoritative total server-side and persists a per-line snapshot (unit_final_price, line_total) so history is auditable.
- Offline-aware polish: Network status banner, resilient state, and UX that doesn’t break when a connection blips.
- Secure sessions that feel native: Tokens stored in SecureStore when available, fallback to AsyncStorage as needed, biometric-gated access (via expo-local-authentication) with a “skip once” escape hatch for edge cases.
Backend (FastAPI)
Tight, purposeful API:
- /auth — login, refresh token rotation (hashed refresh tokens in DB), token invalidation.
- /trade — hierarchical catalog endpoints for Items/Tools/Parts, combined parts, full-text search.
- /orders — create/list/get with price snapshotting and authoritative totals.
- /categories — category codes (code/title/description).
- /pictures/file — serves product and manager images with fallbacks.
Built-in correctness & safety:
- SlowAPI rate limiting on hot routes (e.g., 30/min)
- Strict CORS, structured validation errors
- SQLAlchemy models for items, tools, parts, orders, users, refresh_tokens
Ops ready scripts:
- Loaders for items/tools/parts/users from your sources
- Order export to JSON for accounting/BI (scripts/loaders/export_orders.py) with idempotency (skips if the export already exists)
Results
- Fast adoption by field teams: simple sign-in, PIN/biometric unlock, quick browse/search.
- Reduced ordering errors: server-side authoritative totals with per-line snapshots keep history consistent and auditable.
- Operational visibility: JSON exports of orders slot neatly into existing accounting and analytics flows.
- Low-friction maintenance: clear models, small FastAPI surface, and Expo tooling keep updates reliable.