Lepton Software · SDE-2 · FrontendJune 2024 – Present
SmartMarket Platform
Frontend lead on the next-gen rewrite of SmartMarket.ai — new Datasets, Connections, and an agentic AI Assistant module.
Module walkthroughs
Datasets — AI-generated metadata
New-dataset wizard generates dataset names, descriptions, and column-level documentation across 7 sources in parallel.
Connections wizard
Schema-driven PostgreSQL credential form with live Test connection feedback.
Context
SmartMarket is Lepton's flagship SaaS for geospatial and market intelligence. I led the frontend rewrite of v1 (SmartMarket.ai) onto a new Rio.js extension monorepo and shipped the three frontend modules that define the upgraded platform: Datasets, Connections, and an agentic AI Assistant.
My scope on this project is the frontend — UI, client-side data flow, build/deploy hardening, and end-to-end testing. Backend services and data infrastructure are owned by separate teams. The platform now lives at smartmarket.rio.software.
What I built
- LLM-powered agentic geospatial assistant on the client — tool-calling for map rendering and dataset selection, prompt + schema scaffolding around per-dataset `_info.json` (RAG-style grounding), strict error/retry behaviour, and in-browser Pyodide for sandboxed data analysis on user uploads.
- Datasets and Connections UI surface across Postgres, BigQuery, S3, Kafka, and HTTP — connector wizards, schema-driven credential forms (with field order preserved through jsonb), pre-flight connection-staleness gating, and import-wizard recovery paths.
- Frontend production hardening: build-id-driven version-update banner, skew-protection volume + Nitro middleware so retained client bundles serve `text/javascript`, and an internal headless print pipeline that renders dataset reports to PDF.
- Real-API Playwright trust suite running against staging, gated in CI and fails-loud. It caught a connection-rename durability defect at the API boundary and produced the diagnostic that the backend team used for their fix.
- Visual regression coverage, project workspaces, RBAC surface, and 20+ smaller frontend features that round out the upgrade from v1.
Impact
- v1 baseline maintained: scalable RBAC surface (+40% faster user/project management on v1), −35% crashes, −30% page load, 2× faster releases via Docker + Ansible automation.
- Introduced the real-API trust-suite pattern that now catches FE↔BE contract regressions before staging promotes.
Deep dive
Why a Rio.js extension monorepo
Lepton ships multiple frontends that share auth, navigation, and connector primitives through a single Rio.js OS. SmartMarket plugs in as an extension of that OS, so the app inherits sign-in, secrets, env, and rendering and only ships the new Datasets / Connections / Assistant surface area. This kept the rewrite scoped and let v1 features migrate incrementally.
How the assistant grounds SQL on the client
The assistant doesn't free-form SQL. Every dataset exposes a `_info.json` describing its columns, types, role hints, and geometry shape. The frontend feeds that schema into the LLM before its first query, and on every error re-reads the schema and retries the same scope — never silently switching cities, categories, or datasets to make the error go away. The SQL itself executes against the platform's existing query service.
Pyodide upload router
User uploads go through a size-aware 3-lane router on the client: small CSV/TSV/XLS → Pyodide (server scratch-cache → VFS `/input/` → existing Python tool); small GeoJSON → in-memory MapBlock; anything larger → full dataset ingest. Small files get assistant responses in seconds without paying ingestion latency.