Back to Projects

Complete project profile

Mapping Clarity

Enterprise AI SaaS for automated data classification problem, pipeline, stack, architecture, security, and scale. Reflects the latest codebase.

Mapping Clarity

Introduction

Project Overview

Mapping Clarity is an enterprise-grade, AI-powered SaaS platform that tackles one of the most persistent inefficiencies in modern operations: the manual classification and categorization of financial and operational data. Every day, accounting, finance, and operations teams spend huge effort assigning categories to raw transactional data invoice lines to account codes, expenses to cost centers, supplier records to taxonomies. That work is repetitive, error-prone, slow, and does not scale as volumes grow.

Organizations upload raw CSV files accounting records, invoice exports, expense reports, supplier lists, or any structured tabular data and an intelligent pipeline streams each row through a multi-stage engine: fast pattern matching, semantic vector search, historical learning, and Google's Gemini model. Results appear live in the browser, row by row, with confidence scores and plain-language explanations. Reviewers verify, correct, or override; every correction feeds back so future runs get faster, cheaper, and more accurate without manual retraining.

The product is fully multi-tenant and cloud-native: each organization runs in an isolated environment with its own users, pipelines, rules, billing, and data. Four role Super Admin, Tenant Admin, Uploader, and Viewer control access and configuration. A credit-based model with Stripe offers transparent pay-per-use pricing, billing cycles, low-credit alerts, and full transaction history. A documented REST API with API keys supports integrations including Microsoft Excel and SharePoint via client scripts.

Built on Google Cloud with a serverless, event-driven architecture: Cloud Functions, Cloud Run, Workflows, Eventarc, Firestore, BigQuery, Vertex AI (Gemini + embeddings). The frontend is React 19 with TypeScript, Ant Design, and Tailwind, hosted on Firebase with a global CDN scaling automatically, processing large jobs reliably, and delivering a real-time experience regardless of file size.

Mechanism

Project Description

Mapping Clarity is a data classification automation platform. To understand it, it helps to see the problem it solves.

The problem

Picture an accounting firm with thousands of monthly transactions from clients. Every vendor payment, invoice line, and expense must map to the right account, cost center, and reporting category before statements or filings. Traditionally someone works a spreadsheet row by row slow, inconsistent across people, and no learning for the next month. At enterprise scale that bottleneck becomes one of the most expensive parts of the workflow.

What Mapping Clarity does

End-to-end pipeline:

  1. Step 1 — Pipeline setup (one time)A Tenant Admin creates a pipeline: which CSV columns to classify, which targets (account codes, cost centers, custom categories), and hierarchy. Reused on every future upload.
  2. Step 2 — File uploadCSV via web UI or REST API. File stored in Cloud Storage; validation and atomic credit reservation before processing users are not charged for work that did not run.
  3. Step 3 — Pattern matching (NGram engine)High-speed pattern index from prior confirmed rows. Strong matches (~80%+) classify instantly without AI fast, no AI cost, improves as the library grows.
  4. Step 4 — Vector similarity & RAG contextEmbeddings via Vertex AI; BigQuery search for similar historical rows. A RAG context package (hierarchy definitions, examples, patterns) is sent with the row to the model.
  5. Step 5 — AI classification (Gemini)Batches go to Gemini 2.5 Flash Lite on Vertex AI. Structured output: category, confidence (low/medium/high), plain-language reasoning. Firestore updates in real time; the UI refreshes row by row without reload.
  6. Step 6 — Human reviewReview UI: color-coded confidence, inline edits, hierarchical dropdowns, filters, search, bulk edit. Every change logged with user and timestamp for audit.
  7. Step 7 — Self-improvement loopConfirmations feed the NGram index and BigQuery training examples with embeddings. Similar future rows resolve faster and may skip AI entirely.
  8. Step 8 — Results & downloadEmail on completion; downloadable CSV with classification columns and time-limited secure links.

What makes it different

Most tools are either manual (spreadsheets) or rigid (rules that break when formats change). Mapping Clarity is adaptive, self-improving, and explainable: it works on the first upload without prior training data, improves with every job, gives reviewers full visibility, and handles inconsistent real-world text and multi-level hierarchies without requiring technical operators.

The classification engine in more detail

Three target types:

  • Pattern targets — regex rules for predictable formats (e.g. references starting with "INV-").
  • List targets — hierarchical taxonomies from CSV (e.g. Account Type → Sub-Account → Code) that the model navigates.
  • List definition targets — same as list targets plus text definitions per level, passed to the AI for ambiguous categories.

Multiple targets can run in one pipeline one upload can classify against account hierarchy, cost centers, and custom patterns in a single pass.

Primary Industries

  • Financial Services and Accounting
  • Accounts Payable and Accounts Receivable Processing
  • Enterprise Expense Management
  • Bookkeeping and Tax Preparation
  • Operational Data Management
  • Business Intelligence and Financial Reporting

Roles

Who the End Users Are

Multi-tenant SaaS with full isolation per organization; intuitive for business users and integrators.

RoleDescription
Super AdminPlatform operators: all tenants, new tenants, global hierarchies, credit allocation, break-glass access to any tenant with full audit logging.
Tenant AdminPipelines, custom targets, invites, billing and credits, API keys.
UploaderUpload files, monitor jobs in real time, review and correct classifications in the interactive UI.
ViewerRead-only: history, results, downloads — no uploads or edits.

Core Features

AI-Powered Multi-Stage Classification

Four-stage cascade: pattern → vector search → Gemini. Confidence and plain-language reasoning for every row.

Real-Time Processing & Live Review

Results stream to the browser row by row; review high-confidence rows while the rest still processes.

Self-Learning NGram Pattern Engine

Indexes confirmed classifications; strong matches skip AI, saving time and credits over time.

Vector Similarity Search with RAG

Vertex AI embeddings + BigQuery history; RAG context in the Gemini prompt for hard rows.

Multi-Level Pipeline Management

Saved, reusable pipelines: columns, targets, output shape repeatable with one click.

Custom Classification Targets

Pattern, List, and List Definition targets from CSV; combine multiple targets in one pipeline.

Interactive Review Table

Inline edit, hierarchical dropdowns, confidence colors, search, filters, column visibility, bulk edit.

Complete Audit Trail

Every action logged with user identity and timestamp for compliance.

Credit-Based Usage System

Per row per target; pre-reservation; refunds for unused or failed work; usage analytics in-app.

Stripe-Powered Credit Purchasing

In-app checkout, volume tiers, low-credit alerts.

REST API & API Keys

OpenAPI spec; tenant-scoped keys; up to 10k rows per request; webhooks; Excel / SharePoint scripts.

Two-Factor Authentication (2FA)

TOTP with QR setup in settings.

Multi-Tenant Isolation

Firestore rules and auth claimsiso lation at the database layer, not only in app code.

Email Notifications

SendGrid: job complete, invites, resets, low-credit alerts.

Super Admin Portal

Separate app for operators: tenants, global hierarchies, health, credits, emergency access with audit.

Technologies Used

Frontend (user interface)

TechnologyVersionPurpose
React19UI component framework
TypeScript5.9Type-safe development
Vite7.3Build tooling and bundler
Ant Design6Enterprise UI component library
Tailwind CSS4Utility-first CSS
React Router7Client-side navigation
React DnD16Drag-and-drop column reordering
Firebase SDK12Auth and real-time Firestore subscriptions

Backend & cloud infrastructure

Technology / servicePurpose
Google Cloud FunctionsServerless HTTP functions: users, API, lightweight tasks
Google Cloud RunNine container microservices for long-running processing
Cloud WorkflowsMulti-stage pipeline orchestration
EventarcTriggers when files land in Cloud Storage
Cloud TasksAsync inter-service messaging with OIDC auth
Cloud FirestoreReal-time NoSQL application data
Google Cloud StorageCSV uploads, intermediates, results
BigQueryAnalytics, metrics, vector similarity, global training data
Firebase AuthenticationIdentity, sessions, custom role claims
Firebase HostingMain app + super admin, global CDN
Vertex AIGemini hosting and text embeddings
Cloud Secret ManagerSecrets and API keys
Artifact RegistryCloud Run images
TerraformInfrastructure as Code for GCP

AI & machine learning

Technology / servicePurpose
Gemini 2.5 Flash LitePrimary classifier on Vertex AI
Vertex AI Embeddings2048-dim embeddings for vector search
BigQuery Vector SearchSimilar historical classifications
Custom NGram EngineFast, self-learning pattern index on Firestore
RAG pipelineContext building for higher AI accuracy

External integrations

Technology / servicePurpose
StripeCredit purchases, checkout, payment webhooks
SendGridTransactional email
FeaturebaseFeedback and feature requests
Google OAuthSSO

Programming languages

Technology / servicePurpose
TypeScriptFrontend: UI, hooks, services, components
JavaScript (Node.js 22)Cloud Functions and Cloud Run services
YAMLOpenAPI, Workflows, CI/CD
HCL (Terraform)GCP infrastructure
Firestore Security RulesMulti-tenant access control
BashDeployment automation

Architecture Overview

Fully serverless, event-driven microservices on GCP — no servers to manage; scale to zero when idle.

High-level processing flow

User Uploads CSV ──→ Google Cloud Storage
                              │
                        Eventarc Trigger
                              │
                     Cloud Workflow (Orchestrator)
                              │
            ┌─────────────────┼────────────────────┐
            ▼                 ▼                     ▼
     NGram Engine      Vector Search         AI Classification
     (Pattern Match)   (BigQuery RAG)        (Gemini via Vertex AI)
            │                 │                     │
            └─────────────────┴────────────────────┘
                              │
                    Firestore (Real-Time Write)
                              │
                    React Frontend (Live Update)
                              │
                    Human Review & Correction
                              │
                    Learning Loop (NGram + BigQuery)
  • Nine Cloud Run services for distinct pipeline stages; Cloud Tasks with OIDC between services
  • Streaming CSV from Storage rolling batches, not full file in memory
  • Firestore listeners push each row to the UI as it completes
  • Large jobs (5,000+ rows): server-side pagination to avoid browser memory issues
  • Atomic credit reserve, accrue, and reconcile across stages
  • Multi-tenant isolation via Firestore rules and custom claims cross tenant access structurally blocked

Security

  • End-to-end HTTPS for data in transit
  • Firebase Authentication with custom role and tenant claims
  • Firestore Security Rules for database-level multi-tenant isolation
  • Workload Identity Federation no service account key files in code or storage
  • OIDC verification for service-to-service calls via Cloud Tasks
  • Two-factor authentication (TOTP) for user accounts
  • Secret Manager for all sensitive credentials — no hardcoded secrets
  • Signed, time-limited URLs for downloads
  • API key scoping, restrictions, and rotation support
  • Input validation and path traversal prevention on file operations
  • Rate limiting: 100 requests / 15 minutes on public API endpoints
  • Break-glass super admin access with full session audit logging
  • Complete audit trail for data modifications and access events

Deployment & Infrastructure

  • Hosting: Firebase Hosting, global CDN main app and super admin portal
  • CI/CD: GitHub Actions for build, test, and deploy
  • Infrastructure as Code: Terraform for all GCP resources
  • Container registry: Google Artifact Registry for Cloud Run images
  • Testing: Playwright E2E suite plus 176+ unit tests (auth, processing, billing, RBAC)

Platform Scale

  • 22 frontend pages across the full user journey
  • 9 Cloud Run microservices for independent processing stages
  • 30+ Cloud Functions for distinct API operations
  • 4 user roles with fine-grained permissions
  • 3 custom target types for any taxonomy
  • 4-stage AI pipeline with progressive fallback from patterns to AI
  • Full REST API with OpenAPI and API key auth
  • Multi-language SendGrid emails with templated layouts

Live: app.mappingclarity.com · Marketing: mappingclarity.com

This profile is aligned with the latest codebase: deeper overview and "what it is" sections walk through the business problem, the full step-by-step pipeline, the self-learning loop, and differentiation. A non-technical reader gets value and mechanism; a technical reader gets stack, architecture, and engineering depth.