DataVision is a production-ready web application for AI-powered data analysis and visualization. Upload Excel, CSV, PDF, or DOCX files and get instant insights, beautiful visualizations, and exportable reports.β Originally developed during my tenure at Zidio Development (AugβSept 2025). The repository was recreated and improved after an unexpected local data loss.
- π Authentication: Secure signup/login with NextAuth.js and JWT sessions
- π Data Upload: Support for Excel, CSV, PDF, and DOCX files
- π Rich Visualizations: Bar, Line, Pie, Area, and Radar charts
- π€ AI Insights: Automatic summary, trends, anomalies, and recommendations
- π Report Generation: Create and export reports as PDF or DOCX
- πΎ Report History: Save and manage your analysis reports
- π¨ Modern UI: Glassmorphism design with Framer Motion animations
- π± Responsive: Works seamlessly on desktop, tablet, and mobile
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Animations: Framer Motion
- Charts: Recharts
- Database: MongoDB with Mongoose
- Authentication: NextAuth.js
- File Parsing: SheetJS (Excel/CSV), pdf-parse, docx
- Export: html2canvas, jsPDF, docx
- Node.js 18+
- MongoDB (local or cloud instance)
- npm or yarn
git clone <repository-url>
cd datavisionnpm install
# or
yarn installCreate a .env.local file in the root directory:
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key-here-generate-with-openssl-rand-base64-32
MONGODB_URI=mongodb://localhost:27017/datavision
OPENAI_API_KEY=your-openai-api-key-hereGenerate NEXTAUTH_SECRET:
openssl rand -base64 32MongoDB Setup Options:
- Local:
mongodb://localhost:27017/datavision - MongoDB Atlas:
mongodb+srv://username:password@cluster.mongodb.net/datavision
OpenAI API Key (Optional but Recommended):
- Get your API key from OpenAI Platform
- If not provided, the app will use rule-based insights as a fallback
- The AI-powered insights provide more intelligent and contextual analysis
Create a test user and sample data:
npm run seed
# or
yarn seedThis creates:
- Test user:
test@example.com/password123 - Sample report with demo data
npm run dev
# or
yarn devOpen http://localhost:3000 in your browser.
datavision/
βββ app/ # Next.js App Router
β βββ api/ # API routes
β β βββ auth/ # NextAuth routes
β β βββ reports/ # Report API endpoints
β βββ auth/ # Authentication pages
β βββ dashboard/ # Dashboard pages
β βββ about/ # About page
β βββ pricing/ # Pricing page
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ globals.css # Global styles
βββ components/ # React components
β βββ charts/ # Chart components
β βββ Navbar.tsx # Navigation component
β βββ Footer.tsx # Footer component
βββ lib/ # Utility libraries
β βββ models/ # MongoDB models
β βββ utils/ # Utility functions
β βββ auth.ts # NextAuth configuration
β βββ mongodb.ts # MongoDB connection
βββ scripts/ # Scripts
β βββ seed.ts # Database seed script
βββ types/ # TypeScript types
βββ public/ # Static assets
POST /api/auth/signup- User registrationGET/POST /api/auth/[...nextauth]- NextAuth endpoints
GET /api/reports- Get user's reportsPOST /api/reports- Create new reportGET /api/reports/[id]- Get specific reportDELETE /api/reports/[id]- Delete report
- Push your code to GitHub/GitLab/Bitbucket
- Import project in Vercel
- Add environment variables in Vercel dashboard
- Deploy!
npm run build
npm startMake sure to set these in your hosting platform:
NEXTAUTH_URL- Your production URLNEXTAUTH_SECRET- Generated secretMONGODB_URI- MongoDB connection string
- Navigate to
/auth/signupto create an account - Use
/auth/signinto log in
- Go to Dashboard
- Click "Upload File" or drag and drop
- Supported formats:
.xlsx,.xls,.csv,.pdf,.docx
After upload, you'll see:
- Summary: Overview of your data
- Trends: Patterns and changes detected
- Anomalies: Unusual data points
- Recommendations: Suggestions for analysis
- Select chart type (Bar, Line, Pie, Area, Radar)
- Choose X and Y axis columns
- Export as PNG, SVG, or PDF
- Set report title
- Save report to history
- Export as PDF or DOCX
- View saved reports in Dashboard
- Open, export, or delete reports
- Supports multiple sheets (uses first sheet)
- Preserves column headers and data types
- Standard comma-separated values
- Auto-detects delimiters
- Text extraction
- Attempts to parse tabular data
- Text extraction
- Basic table parsing support
- Verify
MONGODB_URIis correct - Check MongoDB service is running (local)
- Verify network access (cloud)
- Check file size (max 10MB)
- Verify file format is supported
- Ensure file isn't corrupted
- Verify
NEXTAUTH_SECRETis set - Check
NEXTAUTH_URLmatches your domain - Clear browser cookies and try again
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - feel free to use this project for learning or commercial purposes.
For issues, questions, or contributions, please open an issue on GitHub.
Built with β€οΈ using Next.js 14