Skip to content

Latest commit

Β 

History

121 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DataXpert Logo

DataXpert

AI-Powered Business Analytics Platform

Features β€’ Quick Start β€’ Documentation β€’ Technology


πŸ“‹ Overview

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.

✨ What Makes DataXpert Special

  • πŸ” 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

πŸš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • Supabase account (for database)
  • Google OAuth credentials (optional, for Google login)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/DataXpert.git
    cd DataXpert
  2. Setup Backend

    cd backend
    pip install -r requirements.txt
  3. Configure Environment Variables

    cp .env.example .env

    Edit .env file 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
    
  4. Setup Database

    Run the simplified SQL setup script in your Supabase SQL Editor:

    # Copy contents of database.sql and run in Supabase

    Or manually create tables (see database.sql for complete schema):

    • users - User accounts with Google OAuth support
    • business_data - Business metrics and records
    • chats - AI chat conversation history
    • analysis_results - AI-generated insights
    • teams - Team management
  5. Run Backend

    python app.py

    Server will start at http://localhost:5000

  6. Setup Frontend

    cd ../frontend

    Edit js/config.js and update:

    const GOOGLE_CLIENT_ID = 'your-google-client-id';
  7. 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.html directly in browser

  8. Access Application

    • Frontend: http://localhost:5500 or http://127.0.0.1:5500
    • Backend API: http://localhost:5000
    • Documentation: Open documentation/index.html

πŸ“ Project Structure (Optimized)

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

πŸ”§ Optimization Changes

This version includes the following optimizations:

Backend Optimization

  • βœ… Removed duplicate code - Fixed duplicate complete_profile function
  • βœ… Streamlined environment - Consolidated multiple .env files into one
  • βœ… Unified requirements - Merged development and production dependencies
  • βœ… Removed cache files - Cleaned all __pycache__ directories

Frontend Optimization

  • βœ… 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

Database Optimization

  • βœ… Single SQL file - Combined database_setup.sql and migration files into database.sql
  • βœ… Simplified schema - Removed unnecessary tables for core functionality

Documentation Cleanup

  • βœ… 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

πŸ› οΈ Technology Stack

  • 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

οΏ½ Features

Authentication

  • Email/password registration and login
  • Google OAuth integration
  • JWT token-based authentication
  • Password hashing with SHA-256

Dashboard

  • Real-time business statistics
  • Interactive charts (sales, profit, expenses)
  • Recent activity feed
  • Team management

AI Analysis

  • Natural language chat interface
  • Intent recognition and entity extraction
  • Automated insights generation
  • Anomaly detection
  • Trend analysis
  • Sales, profit, and expense analysis

Team Collaboration

  • Create and manage teams
  • Add team members
  • Share business insights

πŸ”§ Configuration

Environment Variables

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

Google OAuth Setup

  1. Go to Google Cloud Console
  2. Create a new project
  3. Enable Google+ API
  4. Create OAuth 2.0 credentials
  5. Add authorized JavaScript origins:
    • http://localhost:5500
    • http://127.0.0.1:5500
  6. Add authorized redirect URIs:
    • http://localhost:5500
  7. Copy Client ID to .env and frontend/js/config.js

Supabase Setup

  1. Create account at Supabase
  2. Create new project
  3. Copy project URL and anon key to .env
  4. Run the SQL commands from step 4 of installation
  5. Enable Row Level Security (RLS) policies as needed

πŸ“š Documentation

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.

🎯 Usage

Adding Business Data

  1. Login to your account
  2. Navigate to Dashboard
  3. Click "Add Data" button
  4. Fill in:
    • Date
    • Category (Retail, Services, etc.)
    • Sales amount
    • Expenses amount
    • Profit (auto-calculated)
  5. Submit to save

Using AI Analysis

  1. Navigate to "AI Analysis" page
  2. 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"
  3. AI will analyze your data and provide insights
  4. View charts and recommendations
  5. Ask follow-up questions

Creating Teams

  1. Go to Dashboard
  2. Scroll to "Your Teams" section
  3. Click "Create Team"
  4. Enter team name
  5. Invite members (email functionality to be added)

πŸ” Security

  • 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

🚧 Future Enhancements

  • 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

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

οΏ½ About SGP Group

24CS067 - ManavPatel 24CS072 - Prince Patel 24CS076 - Srujal Patel

πŸ“ž Contact Us

Have a question, an idea, or just want to say hi?
I’m always open to connecting!

Feel free to reach out β€” I’d love to hear from you! 😊

-- Made with ❀️ by DataXpert

Last Updated: March 4, 2026 (Optimized & Streamlined)

About

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages