Skip to content

A modern, privacy-focused web application that transforms CSV files into interactive dashboards with automatic data analysis, visualizations, and insights. Built with React, TypeScript, and Vite for fast, client-side processing.

License

Notifications You must be signed in to change notification settings

slightlyprivate/csv-dashgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CSV β†’ Dashboard Generator

A modern, privacy-focused web application that transforms CSV files into interactive dashboards with automatic data analysis, visualizations, and insights. Built with React, TypeScript, and Vite for fast, client-side processing.

Upload any CSV and get instant charts + summary stats. Great for quick insights without spreadsheets.

Dashboard Preview

✨ Features

Core Functionality

  • Drag-and-drop CSV upload with instant parsing and validation
  • Automatic field type detection (numeric, categorical, date/time)
  • Interactive visualizations: Line charts, bar charts, pie charts, scatter plots
  • Smart KPI cards: Sum, mean, median, min/max, standard deviation
  • Column statistics with data quality insights
  • Responsive design that works on desktop and mobile

Advanced Features

  • Privacy controls with configurable data retention and usage tracking
  • Configurable limits for file size, row count, and processing time
  • Dark/Light theme with system preference detection
  • Data persistence using localStorage for datasets and user preferences
  • Sample datasets for quick demos and testing
  • Export capabilities for charts and processed data
  • Real-time validation with helpful error messages

Developer Experience

  • Full TypeScript with strict type checking
  • Comprehensive testing with Vitest and React Testing Library
  • Modern tooling with Vite, ESLint, and Prettier
  • Accessibility compliant (WCAG 2.1 AA)
  • Modular architecture with custom hooks and contexts
  • Optional backend integration (FastAPI/Python or Hono/Node)

🧰 Tech Stack

Frontend

  • React 18 with functional components and hooks
  • TypeScript for type safety and better DX
  • Vite for fast development and optimized builds
  • Tailwind CSS v4 for utility-first styling
  • Chart.js with react-chartjs-2 for data visualization
  • Papaparse for robust CSV parsing
  • React Router for navigation (if needed)

Backend (Optional)

  • FastAPI (Python) for data processing API
  • Hono (Node.js) for lightweight API
  • Pandas for advanced data manipulation

Development & Testing

  • Vitest for unit and integration testing
  • React Testing Library for component testing
  • ESLint v9 with flat configuration
  • Prettier for code formatting
  • TypeScript strict mode enabled

πŸš€ Quick Start

Frontend Only (Recommended)

# Clone the repository
git clone https://github.com/YOURUSER/csv-dashgen
cd csv-dashgen/web

# Install dependencies
npm install

# Start development server
npm run dev

# Open http://localhost:5173 in your browser

Full-Stack Mode (Python API)

# Frontend
cd csv-dashgen/web && npm install && npm run build

# Backend
cd ../api-py
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn app:app --reload

Full-Stack Mode (Node API)

# Frontend
cd csv-dashgen/web
npm install && npm run build

# Backend (if implemented)
cd ../api-node
npm install
npm run dev

πŸ“ Project Structure

csv-dashgen/
β”œβ”€β”€ web/                          # Frontend React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/           # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ Charts.tsx        # Chart rendering component
β”‚   β”‚   β”‚   β”œβ”€β”€ FieldPicker.tsx   # Column selection interface
β”‚   β”‚   β”‚   β”œβ”€β”€ Stats.tsx         # KPI and statistics display
β”‚   β”‚   β”‚   β”œβ”€β”€ Uploader.tsx      # File upload component
β”‚   β”‚   β”‚   β”œβ”€β”€ Settings.tsx      # Configuration panel
β”‚   β”‚   β”‚   β”œβ”€β”€ PrivacyNotice.tsx # Privacy consent modal
β”‚   β”‚   β”‚   └── SampleLoader.tsx  # Sample data loader
β”‚   β”‚   β”œβ”€β”€ contexts/             # React contexts for state management
β”‚   β”‚   β”‚   β”œβ”€β”€ ConfigContext.tsx # App configuration and limits
β”‚   β”‚   β”‚   └── ThemeContext.tsx  # Theme management
β”‚   β”‚   β”œβ”€β”€ hooks/                # Custom React hooks
β”‚   β”‚   β”‚   β”œβ”€β”€ useCSVParser.ts   # CSV parsing logic
β”‚   β”‚   β”‚   β”œβ”€β”€ useLimits.ts      # Configuration limits
β”‚   β”‚   β”‚   β”œβ”€β”€ useLocalStorage.ts # Persistence utilities
β”‚   β”‚   β”‚   └── useChartGenerator.ts # Chart creation logic
β”‚   β”‚   β”œβ”€β”€ utils/                # Utility functions
β”‚   β”‚   β”‚   β”œβ”€β”€ csvParser.ts      # CSV processing utilities
β”‚   β”‚   β”‚   β”œβ”€β”€ statistics.ts     # Statistical calculations
β”‚   β”‚   β”‚   β”œβ”€β”€ typeInference.ts  # Data type detection
β”‚   β”‚   β”‚   └── chartUtils.ts     # Chart configuration helpers
β”‚   β”‚   β”œβ”€β”€ App.tsx               # Main application component
β”‚   β”‚   └── main.tsx              # Application entry point
β”‚   β”œβ”€β”€ public/                   # Static assets
β”‚   β”œβ”€β”€ vite.config.ts            # Vite configuration
β”‚   β”œβ”€β”€ package.json              # Dependencies and scripts
β”‚   β”œβ”€β”€ tsconfig.json             # TypeScript configuration
β”‚   └── eslint.config.js          # ESLint flat configuration
β”œβ”€β”€ api-py/                       # Python FastAPI backend
β”‚   β”œβ”€β”€ app.py                    # FastAPI application
β”‚   └── requirements.txt          # Python dependencies
β”œβ”€β”€ samples/                      # Sample CSV files
β”‚   β”œβ”€β”€ sales.csv                 # Sales data sample
β”‚   β”œβ”€β”€ expenses.csv              # Expense tracking sample
β”‚   └── fitness.csv               # Fitness metrics sample
β”œβ”€β”€ docs/                         # Documentation and screenshots
β”‚   β”œβ”€β”€ dashboard.png             # Main dashboard screenshot
β”‚   β”œβ”€β”€ upload.png                # Upload interface screenshot
β”‚   └── architecture.md           # Architecture documentation
β”œβ”€β”€ CHECKLIST.md                  # Development checklist
β”œβ”€β”€ PRD.md                        # Product requirements document
β”œβ”€β”€ README.md                     # This file
└── package.json                  # Root package configuration

πŸ§ͺ Testing

The project includes comprehensive testing with high coverage:

# Run all tests
npm test

# Run tests with coverage report
npm run test:coverage

# Run tests in watch mode
npm run test:watch

# Run linting
npm run lint

# Run linting with auto-fix
npm run lint:fix

Test Coverage

  • Unit tests for utilities and hooks
  • Component tests for React components
  • Integration tests for user workflows
  • Accessibility tests for WCAG compliance
  • Coverage threshold: 80%+ across all files

βš™οΈ Configuration

Environment Variables

Create a .env file in the web/ directory:

# API Configuration (optional)
VITE_API_URL=http://localhost:8000
VITE_API_ENABLED=false

# Application Limits
VITE_MAX_FILE_SIZE_MB=10
VITE_MAX_ROWS=10000
VITE_PROCESSING_TIMEOUT_MS=30000

# Privacy Settings
VITE_ENABLE_ANALYTICS=false
VITE_DATA_RETENTION_DAYS=30
VITE_REQUIRE_CONSENT=true

Runtime Configuration

The app includes a settings panel accessible from the main interface where users can configure:

  • File size limits (1MB - 50MB)
  • Row count limits (1K - 100K rows)
  • Processing timeout (5s - 60s)
  • Privacy preferences (analytics, data retention)
  • Theme preferences (light/dark/auto)
  • Chart defaults (colors, animations)

🎨 Themes & Accessibility

Theme Support

  • Light theme for bright environments
  • Dark theme for low-light conditions
  • Auto theme that follows system preferences
  • High contrast mode for accessibility

Accessibility Features

  • WCAG 2.1 AA compliant with proper ARIA labels
  • Keyboard navigation support for all interactive elements
  • Screen reader compatibility with semantic HTML
  • Focus management with visible focus indicators
  • Color contrast ratios meeting accessibility standards
  • Responsive design that works on all screen sizes

πŸ“Š Sample Data

Try these sample datasets to explore the app's capabilities:

  • samples/sales.csv - Monthly sales data with revenue, costs, and categories
  • samples/expenses.csv - Personal expense tracking with categories and amounts
  • samples/fitness.csv - Fitness metrics including workouts, duration, and calories

Demo Flow

  1. Upload a CSV - Drag and drop or click to select samples/sales.csv
  2. Explore data - View automatic field detection and statistics
  3. Create visualizations - Select columns for x/y axes and choose chart types
  4. Customize settings - Adjust limits, themes, and privacy preferences
  5. Export results - Download charts or processed data

πŸ”§ Development

Prerequisites

  • Node.js 18+ and npm
  • Git for version control
  • Python 3.8+ (for backend development)

Development Scripts

# Development server with hot reload
npm run dev

# Production build
npm run build

# Preview production build
npm run preview

# Type checking
npm run type-check

# Code formatting
npm run format

Code Quality

  • ESLint v9 with flat configuration for modern linting
  • Prettier for consistent code formatting
  • TypeScript strict mode for type safety
  • Pre-commit hooks for quality gates

πŸš€ Deployment

Frontend Only (Recommended)

Deploy to any static hosting service:

npm run build
# Deploy the 'dist' folder to Netlify, Vercel, or Cloudflare Pages

Full-Stack Deployment

  • Frontend: Deploy static build to CDN
  • Backend: Deploy API to Heroku, Railway, or AWS
  • Database: Optional for saved dashboards

πŸ“ˆ Roadmap

Planned Features

  • Smart chart suggestions based on data patterns
  • LLM-powered insights with natural language summaries
  • Dashboard saving with cloud storage integration
  • Advanced filtering and data transformation
  • Collaborative features for team dashboards
  • Mobile app companion

Technical Improvements

  • WebAssembly for faster data processing
  • Service workers for offline functionality
  • Progressive Web App (PWA) capabilities
  • Advanced chart types (heatmaps, treemaps)
  • Real-time collaboration features

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes with tests
  4. Run the test suite: npm test
  5. Submit a pull request

Development Guidelines

  • Follow the existing code style and conventions
  • Add tests for new features
  • Update documentation for API changes
  • Ensure accessibility compliance
  • Test on multiple browsers and devices

πŸ“ License

MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • Built with modern web technologies
  • Inspired by the need for simple data exploration tools
  • Thanks to the open-source community for amazing libraries

About

A modern, privacy-focused web application that transforms CSV files into interactive dashboards with automatic data analysis, visualizations, and insights. Built with React, TypeScript, and Vite for fast, client-side processing.

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages