-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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.
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]
| 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.
- Load two local
.csvfiles with size and header validation fromsrc/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.rsandfrontend/src/features/mapping/autoPair.ts. - Match rows exactly or with flexible
**key matching insrc/comparison/engine.rsandsrc/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.rsandsrc/backend/comparison_snapshot.rs. - Export backend CSV results from
src/data/export.rsand frontend HTML reports fromfrontend/src/features/results/htmlExport.ts.
| 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. |
- Start with getting started to build and run the app.
- Read backend workflow to understand the session lifecycle.
- Read comparison engine before changing row matching or difference logic.
Generated by Factory