DataPorter¶
A mountable Rails engine for data import workflows.
Upload, Map, Preview, Import — supports CSV, XLSX, JSON, and API sources with a declarative DSL for defining import targets. Business-agnostic by design: all domain logic lives in your host app.

Features¶
-
4 Source Types
CSV, XLSX, JSON, and API with a unified parsing pipeline
-
Interactive Column Mapping
Drag-free UI to match file headers to target fields, with saved templates
-
Real-time Progress
JSON polling with animated progress bar, no ActionCable required
-
Dry Run Mode
Validate against the database without persisting a single record
-
Import Params
Declare extra form fields (select, text, number, hidden) per target
-
Security Built-in
File size limit, MIME type check, strong parameters, IDOR protection via scope
-
Multi-tenant Isolation
config.scopeensures each user only sees their own imports -
Declarative Target DSL
One class per import type, zero boilerplate
Quick Example¶
class ProductTarget < DataPorter::Target
label "Products"
model_name "Product"
sources :csv, :xlsx
columns do
column :name, type: :string, required: true
column :price, type: :decimal
column :sku, type: :string
end
def persist(record, context:)
Product.create!(record.attributes)
end
end
Visit /imports and start importing.
Requirements¶
| Dependency | Version |
|---|---|
| Ruby | >= 3.2 |
| Rails | >= 7.0 |
| ActiveStorage | Required for file uploads |
-
Getting Started
Install DataPorter and create your first import target in minutes.
-
Configuration
Authentication, scoping, context builder, and all available options.
-
Targets
The complete DSL reference: columns, hooks, params, and examples.
-
Sources
CSV, XLSX, JSON, and API source setup and examples.
-
Full Reference
Mapping, views, routes, advanced features, and more.