A powerful Next.js application that intelligently transforms Excel files into database tables with automatic data type detection, schema generation, and multi-database support.
- π Excel File Upload - Drag & drop or browse to upload multiple Excel files (.xlsx, .xls)
- ποΈ Live Preview - Preview Excel data with headers and sample rows before import
- π Multi-Database Support - PostgreSQL, MySQL, MSSQL, SQLite
- π Connection Management - Save and reuse database connections securely
- π Sheet Selection - Choose which sheets to import from Excel files
- π€ Intelligent Type Detection - Automatic detection of data types (integers, decimals, dates, booleans, emails, URLs, JSON)
- βοΈ Smart Table Configuration - Auto-generate table schemas with intelligent column suggestions
- π Data Insights - Real-time analysis of data quality, null percentages, and primary key suggestions
- β Data Validation - Preview and validate data before insertion
- π¨ Dark Mode - Full dark mode support with system preference detection
- Auto-Type Optimization - Database-specific type adaptation (e.g.,
VARCHARβNVARCHARfor MSSQL) - Primary Key Detection - Automatically suggests optimal primary keys based on uniqueness
- Null Handling - Smart null value detection and conversion
- Data Quality Insights - Identifies potential issues before table creation
- Column Statistics - Shows unique values, null counts, and max lengths
- Type Suggestions - Recommends optimal data types for each column
| Database | Status | Features |
|---|---|---|
| PostgreSQL | β Full Support | SERIAL, TIMESTAMP, JSONB, UUID support |
| MySQL | β Full Support | TINYINT, ENUM, JSON support |
| MSSQL | β Full Support | NVARCHAR, BIT, DATETIME2 support |
| SQLite | β Full Support | INTEGER PRIMARY KEY, TEXT, REAL support |
- Node.js 18 or higher
- pnpm 10.15.0 or higher (recommended) or npm/yarn
- Database server (PostgreSQL, MySQL, MSSQL, or SQLite)
- Clone the repository
git clone https://github.com/Leptons1618/Ingesta.git
cd Ingesta- Install dependencies
# Using pnpm (recommended)
corepack enable
corepack pnpm install
# Or using npm
npm install- Run the development server
# Using pnpm
corepack pnpm dev
# Or using npm
npm run dev- Open your browser
http://localhost:3000
- Drag and drop Excel files or click to browse
- Supports multiple file uploads
- Preview data before proceeding
- Click "Connect to Database"
- Select database type (PostgreSQL, MySQL, MSSQL, SQLite)
- Enter connection details (host, port, username, password, database name)
- Save connection for future use
- Choose which sheets to import from your Excel files
- Preview sheet data with headers
- Select multiple sheets for batch processing
The intelligent table configuration interface provides:
Automatic Features:
- β Auto-detected data types for each column
- β Primary key suggestions based on data uniqueness
- β Column statistics (unique values, null counts, max length)
- β Data quality insights with emoji indicators
Manual Controls:
- Edit table names
- Modify column names
- Adjust data types (dropdown with database-specific types)
- Toggle nullable constraints
- Add/remove columns
- Set primary keys
Smart Insights Panel:
- π Data Quality: Percentage of non-null values
- π Primary Key Candidates: Columns suitable as primary keys
- π― Type Distribution: Breakdown of detected types
β οΈ Warnings: Potential issues (high null percentage, no primary key)
- Click "Create N Tables" button
- Tables are created with optimized schemas
- Data is inserted with proper type conversion
- Null values handled intelligently
- Progress shown for each table
- View all created tables with row counts
- Preview first 10 rows of each table
- Navigate between tables
- Verify data insertion success
ingesta/
βββ app/ # Next.js App Router
β βββ layout.tsx # Root layout with theme provider
β βββ page.tsx # Main application page (8-step workflow)
β βββ globals.css # Global styles
β βββ api/ # API routes
β βββ database/ # Database operations
β β βββ connections/ # List saved connections
β β βββ create-table/ # Create table endpoint
β β βββ insert-data/ # Insert data endpoint
β β βββ preview-table/ # Preview table data
β β βββ test-connection/ # Test DB connection
β β βββ get-tables/ # List tables in database
β βββ excel/ # Excel operations
β βββ analyze/ # Analyze Excel files
β βββ upload/ # Upload Excel files
βββ components/ # React components
β βββ ui/ # shadcn/ui components
β β βββ button.tsx
β β βββ card.tsx
β β βββ input.tsx
β β βββ select.tsx
β β βββ table.tsx
β β βββ ... # Other UI components
β βββ database-connection-form.tsx
β βββ database-connection-list.tsx
β βββ excel-preview.tsx
β βββ file-upload-zone.tsx
β βββ sheet-selection-interface.tsx
β βββ table-creation-interface.tsx # β Intelligent configuration
β βββ table-preview-interface.tsx
β βββ results-dashboard.tsx
β βββ theme-provider.tsx
βββ lib/ # Core business logic
β βββ database-manager.ts # Database abstraction layer
β βββ excel-parser.ts # Excel file parsing
β βββ data-type-detector.ts # π§ Intelligent type detection
β βββ data-transformer.ts # Data transformation utilities
β βββ data-cleaner.ts # Data cleaning and validation
β βββ connection-storage.ts # Connection persistence
β βββ operation-tracker.ts # Operation history tracking
β βββ utils.ts # Utility functions
βββ public/ # Static assets
βββ styles/ # Additional styles
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript configuration
βββ next.config.mjs # Next.js configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ README.md # This file
Built with:
- shadcn/ui - High-quality React components
- Radix UI - Accessible component primitives
- Tailwind CSS - Utility-first CSS framework
- Lucide Icons - Beautiful icon set
- next-themes - Dark mode support
Connections are stored in localStorage with the following structure:
interface DatabaseConfig {
id: string
name: string
type: 'postgresql' | 'mysql' | 'mssql' | 'sqlite'
host: string
port: number
username: string
password: string // Stored securely in browser
database: string
ssl: boolean
}The system uses intelligent algorithms to detect:
- Integers (INT, BIGINT, TINYINT, SMALLINT)
- Decimals (DECIMAL, FLOAT, REAL)
- Strings (VARCHAR, TEXT, NVARCHAR)
- Booleans (BOOLEAN, BIT)
- Dates (DATE, DATETIME, DATETIME2, TIMESTAMP)
- JSON (JSON, JSONB)
- Special types (EMAIL, URL, UUID)
| Detected Type | PostgreSQL | MySQL | MSSQL | SQLite |
|---|---|---|---|---|
| Integer | INTEGER | INT | INT | INTEGER |
| Big Integer | BIGINT | BIGINT | BIGINT | INTEGER |
| Decimal | DECIMAL(10,2) | DECIMAL(10,2) | DECIMAL(10,2) | REAL |
| String (short) | VARCHAR(50) | VARCHAR(50) | NVARCHAR(50) | TEXT |
| String (long) | TEXT | TEXT | NVARCHAR(MAX) | TEXT |
| Boolean | BOOLEAN | BOOLEAN | BIT | INTEGER |
| Date | DATE | DATE | DATE | TEXT |
| DateTime | TIMESTAMP | DATETIME | DATETIME2 | TEXT |
| JSON | JSONB | JSON | NVARCHAR(MAX) | TEXT |
# Using pnpm
corepack pnpm build
# Or using npm
npm run build# Using pnpm
corepack pnpm start
# Or using npm
npm startCreate a .env.local file for environment-specific configuration:
# Optional: Set custom ports
PORT=3000
# Optional: Database connection strings (if pre-configuring)
DATABASE_URL=postgresql://user:password@localhost:5432/mydb- β Fixed multiple table creation navigation bug
- β Fixed table preview component data structure mismatch
- β Fixed dark mode styling inconsistencies
- β Fixed font consistency across interfaces
- β Fixed null/undefined handling in row counts
- β Fixed button state during table creation
See MULTIPLE_TABLE_CREATION_FIX.md for detailed fix documentation.
POST /api/database/test-connection- Test database connectionPOST /api/database/create-table- Create table with schemaPOST /api/database/insert-data- Insert data into table (supports batch-size tuning + cleaning controls)POST /api/database/preview-table- Preview table data (first 10 rows)POST /api/database/get-tables- List all tables in database
POST /api/excel/analyze- Analyze Excel file structurePOST /api/excel/upload- Upload and parse Excel files
Recent platform upgrades focus on two goals: making the import workflow easier for non-expert users and making large imports safer to run in production-like environments.
- The main workflow now surfaces a readiness score, top blockers, and recommendations.
- Guidance is computed from live workflow state (files analyzed, connection state, selected sheets, created tables, recent operations) to keep users on a high-confidence path.
- This improves onboarding by telling users what to do next instead of relying on implicit UI knowledge.
- Table creation now includes execution settings for:
- batch size,
- null handling strategy,
- empty-row skipping,
- string trimming,
- optional type conversion,
- optional continue-on-batch-error mode.
- These controls allow the same product to serve both quick small imports and more careful enterprise-style runs.
/api/database/insert-datanow processes incoming rows in bounded batches.- Batch metadata is returned (total/processed/failed batches, duration, chunk errors), giving users and integrators observability into import health.
- Chunking reduces peak request-processing pressure and provides failure isolation for large datasets.
For the full API contract and examples, see /home/runner/work/Ingesta/Ingesta/docs/API_ROUTES.md.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Use meaningful variable and function names
- Add comments for complex logic
- Test with multiple database types
- Ensure responsive design works on all screen sizes
- Follow the existing code style and conventions
This project is licensed under the MIT License - see the LICENSE file for details.
Leptons1618
- GitHub: @Leptons1618
- Next.js - The React framework
- shadcn/ui - Beautiful UI components
- Radix UI - Accessible component primitives
- Tailwind CSS - Utility-first CSS framework
- xlsx - Excel file parsing
- Database drivers: pg, mysql2, mssql, sqlite3
- Framework: Next.js 15.2.4 (App Router)
- UI Library: React 19.0.0
- Language: TypeScript 5.0
- Styling: Tailwind CSS 4.1.9
- Components: Radix UI + shadcn/ui
- Icons: Lucide React
- Theme: next-themes
- Runtime: Node.js β₯18
- API: Next.js API Routes
- Databases: PostgreSQL, MySQL, MSSQL, SQLite
- Excel Parsing: xlsx
- Type Safety: TypeScript with strict mode
- Package Manager: pnpm 10.15.0
- Build Tool: Next.js Compiler (Turbopack)
- Linting: ESLint
- Type Checking: TypeScript Compiler
- Batch operations support (update, delete)
- CSV import/export
- Data transformation rules (custom mapping)
- Scheduled imports
- Import history and rollback
- Advanced filtering and search
- Column mapping templates
- Database schema migration tools
- RESTful API for programmatic access
- Cloud database support (AWS RDS, Azure SQL)
- Docker containerization
- Multi-user support with authentication
- Database credentials are stored in browser
localStorage - No server-side credential persistence
- SSL/TLS support for secure database connections
- Sanitized table and column names to prevent SQL injection
- Input validation on all forms
- Use clear, descriptive column headers in the first row
- Avoid merged cells
- Use consistent data formats within columns
- Remove unnecessary formatting
- Keep data types consistent within columns
- Add indexes after bulk imports
- Use appropriate data types for better storage efficiency
- Consider table partitioning for large datasets
- Regular maintenance and optimization
Single Sheet Import:
- Upload Excel file
- Connect to database
- Select sheet
- Review auto-detected schema
- Create table & insert data
- Preview results
Multi-Sheet Batch Import:
- Upload Excel file with multiple sheets
- Connect to database
- Select all relevant sheets
- Configure tables in bulk
- Create all tables at once
- Review all table previews
- Verify database server is running
- Check firewall rules
- Ensure correct port numbers
- Verify credentials
- Check Excel file format (.xlsx supported)
- Ensure data types are consistent
- Review column names (no special characters)
- Check for duplicate column names
- Reduce batch size for large files
- Create indexes after import
- Use appropriate data types
- Consider database server resources
Additional documentation:
- API Routes Documentation
- Endpoints Summary
- Null Handling Fix
- Table Preview Fix
- Multiple Table Creation Fix
Made with β€οΈ by Leptons1618
β Star this repo if you find it useful!