Skip to content
Douwe de Vries edited this page Jul 1, 2026 · 4 revisions

CSV Align overview

CSV Align is a Rust, Tauri, and React application for comparing two local CSV files. It loads File A and File B, lets a user choose row keys and comparison columns, reports matches and differences, and exports the result as CSV or standalone HTML.

What the project does

The main workflow starts in frontend/src/App.tsx, where the user moves through file selection, configuration, and results. The frontend calls frontend/src/services/tauri.ts, which switches between browser HTTP routes and Tauri invoke commands. Both transports call the same Rust workflows in src/backend/workflow.rs.

CSV parsing and column discovery live in src/data/csv_loader.rs and src/data/json_fields.rs. Row matching and value comparison live in src/comparison/engine.rs, src/comparison/rows.rs, and src/comparison/value_compare.rs. Saved setup files and saved result snapshots live in src/backend/pair_order.rs and src/backend/comparison_snapshot.rs.

graph LR
    User[User] --> UI[React workflow]
    UI --> Transport[Transport switch]
    Transport --> HTTP[Axum API]
    Transport --> Tauri[Tauri commands]
    HTTP --> Backend[Shared Rust workflows]
    Tauri --> Backend
    Backend --> Data[CSV data layer]
    Backend --> Compare[Comparison engine]
    Backend --> Export[Persistence and export]
Loading

Runtime modes

Mode Entry point What it does
Local web app src/main.rs Starts an Axum server on 127.0.0.1:3001, serves frontend/dist, and exposes /api/*.
Desktop app src-tauri/src/main.rs Starts a Tauri shell, registers file-dialog commands, and shares the Rust SessionStore.
Frontend app frontend/src/main.tsx Mounts the React UI and delegates workflow state to frontend/src/hooks/useComparisonWorkflow.ts.

For the runtime details, see architecture and applications.

Core capabilities

  • Load two local .csv files with size and header validation from src/backend/workflow.rs.
  • Detect delimiters, duplicate headers, and column types in src/data/csv_loader.rs.
  • Discover JSON virtual columns in src/data/json_fields.rs.
  • Suggest and auto-pair reliable comparison columns through src/comparison/mapping.rs and frontend/src/features/mapping/autoPair.ts.
  • Match rows exactly or with flexible ** key matching in src/comparison/engine.rs and src/comparison/rows.rs.
  • Normalize missing values, text, numbers, decimals, dates, and JSON values in src/comparison/value_compare.rs.
  • Save pair-order setup files and completed comparison snapshots through src/backend/pair_order.rs and src/backend/comparison_snapshot.rs.
  • Export backend CSV results from src/data/export.rs and frontend HTML reports from frontend/src/features/results/htmlExport.ts.

Key source files

File Purpose
src/main.rs Local web server entry point.
src-tauri/src/main.rs Desktop entry point and Tauri command registration.
frontend/src/App.tsx Top-level three-step workflow UI.
frontend/src/services/tauri.ts Browser/Tauri transport switch.
src/backend/workflow.rs Shared backend workflow orchestration.
src/comparison/engine.rs Row matching and comparison result generation.
src/data/csv_loader.rs CSV decoding, delimiter detection, header validation, and column type detection.

Where to go next


Generated by Factory

Clone this wiki locally