# tableflowhq/csv-import architecture

> Architecture diagram of the GitHub repository tableflowhq/csv-import, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tableflowhq/csv-import
- Repository: https://github.com/tableflowhq/csv-import

## Overview

##### Main System Components

a) Core Component Layer
- CSVImporter (Main entry component)
- Feature Modules (Uploader, Map Columns, Row Selection, Complete)

b) Integration Layer
- React SDK Interface
- JavaScript SDK Interface
- Event Handlers & Callbacks

c) Supporting Systems
- Internationalization (i18n)
- Theming System
- State Management

##### Component Relationships

**[Application Integration Layer]**
- ↑↓
**[CSVImporter Component]**
- ↓
- [Core Features]
- Uploader
- Map Columns
- Row Selection
- Complete
- ↓
**[Shared Components Layer]**
- UI Components
- Table
- Input
- Others
- Infrastructure
- Portal
- Providers
- Hooks

**[Cross-Cutting Concerns]**
- Theme System
- i18n
- Utilities

##### Implementation Details

Technical aspects:
- Modal/non-modal rendering paths
- Template configuration flow
- Data transformation pipeline
- Internationalization integration points
- Theme application points

##### Key Interactions

Flows:
- File upload → Processing → Column Mapping → Row Selection → Data Output
- Theme Provider → Component Styling
- i18n Provider → Text Content
- Template Configuration → Validation Rules

##### Notes Section

Technical notes about:
- Build system integration (Rollup)
- Style system (CSS Modules + SCSS)
- Framework compatibility (React/JavaScript)
- Extension points

This architecture reflects a modern React component library with strong emphasis on customization, internationalization, and framework flexibility, which are key features of this project.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Application Integration"
        ReactSDK["React SDK"]:::sdk
        JavaScriptSDK["JavaScript SDK"]:::sdk
    end

    subgraph "Core Component"
        CSVImporter["CSVImporter Component"]:::core
    end

    subgraph "Feature Modules"
        Uploader["Uploader"]:::feature
        MapColumns["Map Columns"]:::feature
        RowSelection["Row Selection"]:::feature
        Complete["Complete"]:::feature
    end

    subgraph "Shared Components"
        Box["Box"]:::component
        Table["Table"]:::component
        Input["Input"]:::component
        Portal["Portal"]:::component
        Stepper["Stepper"]:::component
    end

    subgraph "Infrastructure"
        Hooks["Hooks"]:::infra
        Providers["Providers"]:::infra
        Utils["Utilities"]:::infra
    end

    subgraph "Cross-Cutting Concerns"
        ThemeSystem["Theme System"]:::theme
        I18N["Internationalization"]:::i18n
        ThemeStore["Theme Store"]:::theme
    end

    ReactSDK --> CSVImporter
    JavaScriptSDK --> CSVImporter

    CSVImporter --> Uploader
    CSVImporter --> MapColumns
    CSVImporter --> RowSelection
    CSVImporter --> Complete

    Uploader --> Box
    MapColumns --> Table
    MapColumns --> Input
    RowSelection --> Table
    Complete --> Box

    CSVImporter --> Portal
    CSVImporter --> Stepper

    ThemeSystem --> CSVImporter
    I18N --> CSVImporter
    Providers --> CSVImporter
    Hooks --> CSVImporter
    Utils --> CSVImporter
    ThemeStore --> ThemeSystem

    %% Click events for component mapping
    click CSVImporter "https://github.com/tableflowhq/csv-import/blob/main/src/components/CSVImporter/index.tsx"
    click Uploader "https://github.com/tableflowhq/csv-import/blob/main/src/importer/features/uploader/index.tsx"
    click MapColumns "https://github.com/tableflowhq/csv-import/blob/main/src/importer/features/map-columns/index.tsx"
    click RowSelection "https://github.com/tableflowhq/csv-import/blob/main/src/importer/features/row-selection/index.tsx"
    click Complete "https://github.com/tableflowhq/csv-import/blob/main/src/importer/features/complete/index.tsx"
    click Box "https://github.com/tableflowhq/csv-import/blob/main/src/importer/components/Box/index.tsx"
    click Table "https://github.com/tableflowhq/csv-import/blob/main/src/importer/components/Table/index.tsx"
    click Input "https://github.com/tableflowhq/csv-import/blob/main/src/importer/components/Input/index.tsx"
    click Portal "https://github.com/tableflowhq/csv-import/blob/main/src/importer/components/Portal/index.tsx"
    click Stepper "https://github.com/tableflowhq/csv-import/blob/main/src/importer/components/Stepper/index.tsx"
    click I18N "https://github.com/tableflowhq/csv-import/blob/main/src/i18n/i18n.ts"
    click ThemeSystem "https://github.com/tableflowhq/csv-import/blob/main/src/importer/providers/Theme.tsx"
    click ThemeStore "https://github.com/tableflowhq/csv-import/blob/main/src/importer/stores/theme.ts"
    click ReactSDK "https://github.com/tableflowhq/csv-import/blob/main/src/index.ts"
    click JavaScriptSDK "https://github.com/tableflowhq/csv-import/blob/main/src/js.tsx"
    click Providers "https://github.com/tableflowhq/csv-import/blob/main/src/importer/providers/index.tsx"
    click Hooks "https://github.com/tableflowhq/csv-import/tree/main/src/importer/hooks"
    click Utils "https://github.com/tableflowhq/csv-import/blob/main/src/importer/utils/utils.ts"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef feature fill:#4CAF50,stroke:#2E7D32,color:white
    classDef component fill:#FFC107,stroke:#FFA000,color:black
    classDef infra fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef theme fill:#FF5722,stroke:#D84315,color:white
    classDef i18n fill:#795548,stroke:#4E342E,color:white
    classDef sdk fill:#607D8B,stroke:#37474F,color:white
```
