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