DataXpert is a modern business analytics platform that leverages AI to provide actionable insights from your business data. Built with Python Flask backend and vanilla JavaScript frontend, it offers real-time analytics, AI-powered chat interface, and comprehensive data visualization.
- 🔐 Dual Authentication - Email/password OR Google OAuth for seamless access
- 📊 Live Dashboard - Real-time metrics with interactive Chart.js visualizations
- 🤖 AI Chat Analysis - Natural language queries for immediate insights
- 📈 Anomaly Detection - Automated Z-score based outlier identification
- 📁 Excel Import - Bulk upload and process business data from spreadsheets
- 👤 Smart Profiles - Google profile integration with completion prompts
- ⚡ Optimized Performance - Streamlined codebase for faster response times
- Python 3.8 or higher
- pip (Python package manager)
- Supabase account (for database)
- Google OAuth credentials (optional, for Google login)
-
Clone the repository
git clone https://github.com/yourusername/DataXpert.git cd DataXpert -
Setup Backend
cd backend pip install -r requirements.txt -
Configure Environment Variables
cp .env.example .env
Edit
.envfile with your credentials:SECRET_KEY=your-secret-key JWT_SECRET_KEY=your-jwt-secret SUPABASE_URL=your-supabase-url SUPABASE_KEY=your-supabase-key GOOGLE_CLIENT_ID=your-google-client-id -
Setup Database
Run the simplified SQL setup script in your Supabase SQL Editor:
# Copy contents of database.sql and run in SupabaseOr manually create tables (see
database.sqlfor complete schema):users- User accounts with Google OAuth supportbusiness_data- Business metrics and recordschats- AI chat conversation historyanalysis_results- AI-generated insightsteams- Team management
-
Run Backend
python app.py
Server will start at
http://localhost:5000 -
Setup Frontend
cd ../frontendEdit
js/config.jsand update:const GOOGLE_CLIENT_ID = 'your-google-client-id';
-
Run Frontend
Option 1: Use Python HTTP Server
python -m http.server 5500
Option 2: Use VS Code Live Server extension
Option 3: Open
index.htmldirectly in browser -
Access Application
- Frontend:
http://localhost:5500orhttp://127.0.0.1:5500 - Backend API:
http://localhost:5000 - Documentation: Open
documentation/index.html
- Frontend:
DataXpert/
├── assets/ # Static assets (logo, images)
├── backend/ # Flask backend application
│ ├── ai/ # AI analysis modules
│ │ ├── analysis_engine.py # Business data analysis
│ │ ├── anomaly_detector.py # Anomaly detection
│ │ ├── data_processor.py # Data processing
│ │ └── nlp_processor.py # NLP for chat
│ ├── auth/ # Authentication service
│ │ └── auth_service.py # Auth logic
│ ├── database/ # Database operations
│ │ └── supabase_client.py # DB client
│ ├── app.py # Main Flask application
│ ├── requirements.txt # Python dependencies
│ ├── .env # Environment variables (create from .env.example)
│ └── .env.example # Environment template
├── frontend/ # Frontend application
│ ├── css/ # Stylesheets
│ │ ├── style.css
│ │ ├── dashboard.css
│ │ └── analysis.css
│ ├── js/ # JavaScript modules
│ │ ├── auth.js # Authentication
│ │ ├── config.js # Configuration
│ │ ├── dashboard.js # Dashboard logic
│ │ ├── analysis.js # AI analysis
│ │ ├── theme.js # Theme switcher
│ │ ├── header-profile.js # Profile component
│ │ ├── data-import-export.js # Data operations
│ │ └── comparison-analysis.js # Comparisons
│ ├── docs/ # Documentation
│ │ ├── api/ # API documentation
│ │ │ └── swagger.yaml
│ │ ├── css/ # Docs styles
│ │ ├── js/ # Docs scripts
│ │ ├── index.html # Docs home
│ │ ├── setup.html # Setup guide
│ │ ├── workflow.html # Workflow diagram
│ │ ├── er-diagram.html # DB schema
│ │ └── folder-structure.html # Structure
│ ├── index.html # Login/signup page
│ ├── dashboard.html # Main dashboard
│ ├── analysis.html # AI analysis
│ ├── history.html # Activity history
│ └── profile.html # User profile
├── database.sql # Complete database setup
└── README.md # This file
This version includes the following optimizations:
- ✅ Removed duplicate code - Fixed duplicate
complete_profilefunction - ✅ Streamlined environment - Consolidated multiple .env files into one
- ✅ Unified requirements - Merged development and production dependencies
- ✅ Removed cache files - Cleaned all
__pycache__directories
- ✅ Consolidated config - Removed redundant config.development.js and config.production.js
- ✅ Merged documentation - Combined docs folder into frontend/docs
- ✅ Organized structure - Better file organization and naming
- ✅ Single SQL file - Combined database_setup.sql and migration files into database.sql
- ✅ Simplified schema - Removed unnecessary tables for core functionality
- ✅ Removed unnecessary files - Cleaned up CHANGELOG, TESTING_GUIDE, OPTIMIZATION_REPORT, etc.
- ✅ Kept only README - Single source of truth for project documentation
- ✅ Integrated docs - All documentation now in frontend/docs folder
- Frontend: HTML5, CSS3, JavaScript (ES6+), Chart.js
- Backend: Python, Flask, Flask-CORS
- Database: Supabase (PostgreSQL)
- Data Analysis: Pandas, NumPy, SciPy
- Authentication: JWT, Google OAuth 2.0
- AI/ML: Rule-based NLP, Anomaly Detection
- Email/password registration and login
- Google OAuth integration
- JWT token-based authentication
- Password hashing with SHA-256
- Real-time business statistics
- Interactive charts (sales, profit, expenses)
- Recent activity feed
- Team management
- Natural language chat interface
- Intent recognition and entity extraction
- Automated insights generation
- Anomaly detection
- Trend analysis
- Sales, profit, and expense analysis
- Create and manage teams
- Add team members
- Share business insights
Create a .env file in the backend directory:
# Flask Configuration
SECRET_KEY=your-super-secret-key-change-this
JWT_SECRET_KEY=your-jwt-secret-key
FLASK_ENV=development
FLASK_DEBUG=True
# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-supabase-anon-key
# Google OAuth Configuration
GOOGLE_CLIENT_ID=your-google-oauth-client-id
GOOGLE_CLIENT_SECRET=your-google-oauth-client-secret- Go to Google Cloud Console
- Create a new project
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized JavaScript origins:
http://localhost:5500http://127.0.0.1:5500
- Add authorized redirect URIs:
http://localhost:5500
- Copy Client ID to
.envandfrontend/js/config.js
- Create account at Supabase
- Create new project
- Copy project URL and anon key to
.env - Run the SQL commands from step 4 of installation
- Enable Row Level Security (RLS) policies as needed
Complete documentation is available in the frontend/docs folder:
- Overview: System architecture and features
- Setup Guide: Detailed installation instructions
- Workflow: Application workflow and data flow
- ER Diagram: Database schema and relationships
- Folder Structure: Project organization
- API Documentation: Swagger YAML in docs/api/
Access documentation by opening frontend/docs/index.html in a browser.
- Login to your account
- Navigate to Dashboard
- Click "Add Data" button
- Fill in:
- Date
- Category (Retail, Services, etc.)
- Sales amount
- Expenses amount
- Profit (auto-calculated)
- Submit to save
- Navigate to "AI Analysis" page
- Type your question or click a suggestion:
- "What are my total sales?"
- "Show me profit analysis"
- "Analyze my expenses"
- "What are the trends?"
- "Detect any anomalies"
- AI will analyze your data and provide insights
- View charts and recommendations
- Ask follow-up questions
- Go to Dashboard
- Scroll to "Your Teams" section
- Click "Create Team"
- Enter team name
- Invite members (email functionality to be added)
- Passwords are hashed using SHA-256 with salt
- JWT tokens for session management
- CORS configured for security
- Environment variables for sensitive data
- SQL injection protection via Supabase
- Input validation on all forms
- CSV/Excel data import (Already implemented!)
- Email notifications
- PDF report generation
- Advanced forecasting models
- Mobile responsive improvements
- Real-time collaboration
- More chart types
- Multi-language support
- Data export functionality
- Advanced team permissions
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
24CS067 - ManavPatel 24CS072 - Prince Patel 24CS076 - Srujal Patel
Have a question, an idea, or just want to say hi?
I’m always open to connecting!
- 📧 Email: 24CS067@charusat.edu.in & 24CS072@charusat.edu.in & 24CS076@charusat.edu.in
- 🐙 GitHub: DataXpert
Feel free to reach out — I’d love to hear from you! 😊
-- Made with ❤️ by DataXpert
Last Updated: March 4, 2026 (Optimized & Streamlined)
