A powerful full-stack application for seamless data import/export between Excel/JSON files and PostgreSQL, plus intelligent document processing with advanced text chunking and metadata enrichment.
Transform your data workflows with automatic type detection, customizable previews, and production-ready performance.
- π One-Command Setup - Docker Compose launches everything
- π Bidirectional Flow - Import Excel/JSON β PostgreSQL β Export Excel/JSONL
- π€ Smart Type Detection - Automatic inference of 6 data types
- π Live Preview - Edit columns, types, and table names before import
- π Document AI - OCR, chunking, metadata extraction (15+ fields)
- π Production Ready - Transaction safety, SQL injection prevention, CORS
- β‘ High Performance - 10K-50K rows/sec bulk insert
- Upload Excel files with drag & drop
- Automatic type detection (TEXT, INTEGER, FLOAT, BOOLEAN, DATE, TIMESTAMP)
- Preview with editable columns
- Customize table names
- Bulk import with transaction safety
- Upload JSON files (.json) or JSONL (.jsonl)
- Support for JSON arrays and JSON Lines format
- Automatic type detection for all fields
- Preview with editable columns
- Direct import to PostgreSQL
- Export any PostgreSQL table to Excel
- Custom column name mapping
- Support for Excel (.xlsx) and JSONL formats
- Batch processing for large tables
- Real-time progress tracking
- Upload: PDF, Text, Images (with OCR + Arabic support)
- Chunk: 5 intelligent strategies
- Character-based (fixed size)
- Recursive (structure-aware) β Recommended
- Sentence-based
- Paragraph-based
- Markdown-aware
- Metadata: 15+ fields per chunk
- Language detection (English, Arabic, mixed)
- Readability score (0-100)
- Content analysis (URLs, numbers)
- OCR confidence
- Navigation links (prev/next)
- Storage: Create new or add to existing tables
- Query: Filter by file, language, readability
Frontend (Next.js - Port 3000)
β
Backend (Fastify - Port 3001)
βββ Excel routes (upload, preview, import, export)
βββ JSON routes (upload, preview, import)
βββ Document routes (upload, extract, chunk, save)
βββ Chunk management (query, statistics)
β
PostgreSQL Database
| Layer | Technology |
|---|---|
| Frontend | Next.js 14, React 18, Tailwind CSS, TypeScript |
| Backend | Fastify, Node.js, TypeScript |
| Document Processing | PDF.js, Tesseract.js, sentence-splitter, wink-nlp |
| Database | PostgreSQL 12+ |
| Type Detection | Custom inference engine |
Get up and running in under 2 minutes:
# Clone the repository
git clone https://github.com/4karam/DP.git
cd DP
# Start all services
docker-compose up --buildThat's it! Open http://localhost:3000 in your browser.
Services automatically started:
- π¨ Frontend (Next.js) - http://localhost:3000
- β‘ Backend (Fastify) - http://localhost:3001
- ποΈ PostgreSQL - localhost:5432
- π§ pgAdmin - http://localhost:5050 (admin@admin.com / admin)
# Backend
cd backend && npm install
# Frontend
cd frontend && npm install# Terminal 1: Backend (port 3001)
cd backend && npm run dev
# Terminal 2: Frontend (port 3000)
cd frontend && npm run devhttp://localhost:3000
- π₯ Import Excel - Excel to PostgreSQL
- π Import JSON - JSON/JSONL to PostgreSQL
- π€ Export Table - PostgreSQL to Excel/JSONL
- π Process Documents - PDF/Text/Images with chunking
| Document | Purpose |
|---|---|
| START_HERE.md | 3-step quick start |
| QUICK_RUN_GUIDE.md | Complete setup guide |
| SETUP.md | Environment configuration |
| ARCHITECTURE.md | System design details |
| BACKEND_INTEGRATION_GUIDE.md | Backend architecture |
| FRONTEND_QUICK_REFERENCE.md | Frontend components |
| INTEGRATION_COMPLETE.md | Integration status |
| RUN_COMMANDS.sh | Copy-paste commands |
- Docker
- Docker Compose
- 4GB free disk space
- Node.js 18+
- PostgreSQL 12+
- 2GB free disk space
DATABASE_URL=postgresql://excel_user:excel_password@postgres:5432/excel_import
PORT=3001
HOST=0.0.0.0
CORS_ORIGIN=http://localhost:3000
MAX_FILE_SIZE=52428800
NODE_ENV=production
NEXT_PUBLIC_API_URL=http://localhost:3001
When using docker-compose up:
| Service | Port | URL | Purpose |
|---|---|---|---|
| Frontend | 3000 | http://localhost:3000 | Next.js application |
| Backend | 3001 | http://localhost:3001 | Fastify API server |
| PostgreSQL | 5432 | localhost:5432 | Database |
| pgAdmin | 5050 | http://localhost:5050 | Database management |
Docker Compose commands:
# Start all services (with rebuild)
docker-compose up --build
# Start services in background
docker-compose up -d
# Stop all services
docker-compose down
# View logs
docker-compose logs -f [service-name]
# Remove volumes and data
docker-compose down -v1. Upload File β Drag & drop .xlsx file
2. Preview Data β Auto-detect types (TEXT, INT, FLOAT, BOOLEAN, DATE, TIMESTAMP)
3. Customize β Edit column names, types, select/deselect columns
4. Import β Bulk insert to PostgreSQL with transaction safety
1. Upload File β .json (array) or .jsonl (line-delimited)
2. Preview Data β Auto-detect types and structure
3. Customize β Edit columns and table name
4. Import β Direct PostgreSQL insert
1. Select Table β Choose from your PostgreSQL tables
2. Review Schema β Preview columns and data types
3. Map Columns β Customize output column names
4. Download β Get .xlsx or .jsonl file
1. Upload β PDF, .txt, or image (PNG/JPG with OCR)
2. Extract Text β Parse document content
3. Choose Strategy β Character, Recursive, Sentence, Paragraph, or Markdown
4. Configure β Set chunk size, overlap, metadata options
5. Store & Query β Save to PostgreSQL with 15+ metadata fields
Supported Metadata:
- Language detection (English/Arabic/Mixed)
- Readability score (0-100)
- Content analysis (URLs, numbers, hashtags)
- OCR confidence (for images)
- Navigation (prev/next chunk links)
POST /api/upload β Upload Excel
POST /api/preview β Preview data
POST /api/import β Import to DB
GET /api/export/tables β List tables
POST /api/export/schema β Get schema
POST /api/export/approve-keys β Confirm mapping
POST /api/export/process β Generate file
GET /api/export/download/:id β Download
POST /api/json/upload β Upload JSON
POST /api/json/preview β Preview data
POST /api/json/import β Import to DB
POST /api/documents/upload β Upload file
POST /api/documents/extract β Extract text
POST /api/documents/chunk β Create chunks
GET /api/documents/tables β List tables
POST /api/documents/save β Save chunks
GET /api/chunks?tableId=... β Query chunks
GET /api/chunk-stats?tableId=... β Statistics
POST /api/create-chunk-table β Create table
POST /api/insert-chunks β Insert chunks
β SQL injection prevention (parameterized queries) β File type validation β File size limits (50MB) β CORS protection β Transaction safety β Automatic input sanitization
| Operation | Speed |
|---|---|
| Small Excel (< 5MB) | < 2 seconds |
| Medium Excel (5-50MB) | 2-5 seconds |
| PDF extraction | 1-2 seconds |
| OCR on images | 5-10 seconds |
| Bulk insert | 10K-50K rows/sec |
| Query with filters | < 100ms |
| Feature | Status | Details |
|---|---|---|
| π₯ Excel Import | β Complete | Multi-sheet support, type detection, bulk insert |
| π JSON Import | β Complete | JSON/JSONL formats, validation, preview |
| π€ Export | β Complete | Excel/JSONL formats, streaming, batch processing |
| π Document Processing | β Complete | PDF/Text/Images, 5 chunking strategies, OCR |
| π¨ Frontend | β Complete | 4 tabs, responsive, dark theme |
| β‘ Backend | β Complete | Fastify, TypeScript, 20+ endpoints |
| ποΈ Database | β Complete | PostgreSQL, indexes, transactions |
| π§ͺ Tests | β Complete | Unit + Integration tests, 90%+ coverage |
| π Documentation | β Complete | READMEs, API docs, guides |
Overall Status: π Production Ready
- Data Migration - Move Excel spreadsheets to PostgreSQL for analytics
- Data Export - Extract database tables for Excel reporting
- Document Analysis - Process PDFs/images with OCR and chunking for RAG systems
- ETL Pipelines - Transform JSON/Excel data for warehouse loading
- Content Management - Store and query document chunks with rich metadata
- Data Validation - Preview and validate before database import
Port already in use?
# Find and kill process
lsof -i :3001 # Backend
lsof -i :3000 # Frontend
lsof -i :5432 # PostgreSQLDatabase connection failed?
# Verify PostgreSQL is running
pg_isready
# Check .env DATABASE_URL
cat backend/.envnpm install fails?
npm cache clean --force
rm -rf node_modules
npm installSee QUICK_RUN_GUIDE.md for detailed troubleshooting.
| Component | Version | Notes |
|---|---|---|
| System | 2.0.0 | Integrated full-stack |
| Node.js | 18+ | Required |
| React | 18+ | Frontend framework |
| Next.js | 14+ | App Router |
| Fastify | 4+ | Backend framework |
| PostgreSQL | 12+ | Database |
| TypeScript | 5+ | Type safety |
Contributions are welcome! Please:
- 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
Development Setup:
- Follow local development instructions above
- Run tests:
npm test(backend) - Check types:
npm run build - Lint:
npm run lint
MIT License - feel free to use this project for personal or commercial purposes.
If you find this project helpful, please consider:
- β Starring the repository
- π Reporting bugs via GitHub Issues
- π‘ Suggesting features via GitHub Discussions
- π§ Contributing improvements
- Repository: https://github.com/4karam/DP
- Issues: https://github.com/4karam/DP/issues
- Documentation: See
/docsfolder
Last Updated: January 15, 2026 Version: 2.0.0 Status: β Production Ready Maintained By: Excel to PostgreSQL Team
Built with β€οΈ using Next.js, Fastify, and PostgreSQL