Software Requirements Specification (SRS)

Comprehensive specification document for DataXpert - AI-Assisted Business Data Analytics & Management System (Version 4.0)

Document Information

Project Name: DataXpert - AI-Assisted Business Data Analytics & Management System
Version: 4.0
Date: March 5, 2026
Status: Production - Fourth Release

1. Introduction

What's New in Version 4.0

  • Production Deployment: Live on Render (backend) and Vercel (frontend)
  • Google OAuth Integration: One-click sign-in with Google accounts
  • Enhanced Security: SHA-256 password hashing, JWT with 7-day expiry, CORS protection
  • UI/UX Improvements: Dark/light theme toggle, responsive design, improved error handling
  • Keep-Alive System: GitHub Actions workflow to prevent server sleep
  • Comprehensive Documentation: Complete SRS, API docs, deployment guides
  • Performance Optimization: Gunicorn production server, database indexing, caching
  • Smart Data Upload: Enhanced CSV/Excel validation with automatic format detection

1.1 Purpose

This Software Requirements Specification (SRS) document version 4.0 provides a complete description of all functionalities, constraints, and requirements for the DataXpert system. This is the fourth major release, representing a production-ready system with enhanced features, security, and performance optimizations. It is intended for developers, stakeholders, and end-users to understand the system's capabilities and limitations.

1.2 Scope

DataXpert version 4.0 is a production-grade, cloud-based business analytics platform that enables organizations to:

  • Upload and manage business data (sales, profits, expenses) with smart validation
  • Analyze data using AI-powered natural language processing with intent recognition
  • Visualize trends through interactive dashboards with Chart.js integration
  • Detect anomalies automatically using Z-score machine learning algorithms
  • Generate forecasts and comparative analysis with statistical models
  • Export data in multiple formats (CSV, Excel, JSON)
  • [V4.0] Dual authentication with Google OAuth 2.0 integration
  • [V4.0] Production deployment on Render (backend) and Vercel (frontend)
  • [V4.0] Enhanced security with CORS, JWT token management, and password hashing
  • [V4.0] Responsive dark/light theme support
  • [V4.0] Comprehensive API documentation with Swagger/OpenAPI

1.3 Definitions, Acronyms, and Abbreviations

Term Definition
SRS Software Requirements Specification
AI Artificial Intelligence
NLP Natural Language Processing
REST API Representational State Transfer Application Programming Interface
JWT JSON Web Token
CORS Cross-Origin Resource Sharing

1.4 References

2. Overall Description

2.1 Product Perspective

DataXpert version 4.0 is a production-ready, cloud-deployed web application consisting of:

  • Frontend: HTML5, CSS3, Vanilla JavaScript (Deployed on Vercel)
  • Backend: Flask 3.1.3 (Python) REST API (Deployed on Render)
  • Database: Supabase (PostgreSQL) - Cloud-hosted
  • AI/ML: Scikit-learn 1.8.0, Pandas 2.3.3, NumPy 1.26.4, SciPy 1.17.1
  • Authentication: JWT (7-day expiry) + Google OAuth 2.0
  • Server: Gunicorn 21.2.0 with production configuration

2.2 Product Functions

User Authentication

Email/password and Google OAuth login, profile management

Data Management

CSV/Excel upload, validation, storage, and retrieval

Data Visualization

Interactive charts, graphs, and dashboard widgets

AI Chat Analysis

Natural language queries for business insights

Anomaly Detection

Automatic detection of unusual data patterns

Data Export

Export data in CSV, Excel, and JSON formats

2.3 User Classes and Characteristics

User Type Characteristics Functions
Business Owner Non-technical, needs simple insights View dashboard, ask AI questions, generate reports
Data Analyst Technical, needs detailed analysis Upload data, perform complex queries, export results
Manager Mid-technical, needs monitoring Track trends, monitor anomalies, comparative analysis

2.4 Operating Environment

  • Client Side: Modern web browsers (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)
  • Frontend Hosting: Vercel (https://dataxpert.dev, https://dataxpert-orcin.vercel.app)
  • Backend Hosting: Render Free Tier (https://dataxpert-5twp.onrender.com)
  • Database: Supabase cloud PostgreSQL (hosted)
  • Minimum Internet Speed: 2 Mbps (recommended 5+ Mbps)
  • Screen Resolutions: 320px (mobile) to 2560px+ (desktop)
  • [V4.0] CDN: Cloudflare for static assets
  • [V4.0] SSL/TLS: HTTPS enforced on all domains
320px+, tablet 768px+, desktop 1024px+)
  • Must comply with GDPR and data privacy regulations
  • API response time should be under 3 seconds (target: 1.5s average)
  • File upload size limited to 10MB per file
  • Browser compatibility: Last 2 major versions of modern browsers
  • [V4.0] Render Free Tier: 15-minute sleep after inactivity (keep-alive implemented)
  • [V4.0] CORS: Restricted to approved domains only
  • [V4.0] Google OAuth: Requires approved JavaScript origins
  • [V4.0] Production environment variables must be secured
  • Must comply with GDPR and data privacy regulations
  • API response time should be under 3 seconds
  • File upload size limited to 10MB
  • Browser compatibility: Last 2 versions of major browsers
  • 3. System Features

    3.1 User Authentication and Authorization

    3.1.1 Description and Priority

    Priority: High

    Secure user registration, login, and profile management with multiple authentication methods.

    3.1.2 Functional Requirements

    • FR-1.1: System shall allow users to register using email and password
    • FR-1.2: System shall validate email format and password strength (minimum 6 characters)
    • FR-1.3: System shall support Google OAuth 2.0 authentication
    • FR-1.4: System shall generate JWT tokens with 7-day expiry
    • FR-1.5: System shall allow users to update profile information
    • FR-1.6: System shall provide password change functionality
    • FR-1.7: System shall display default avatar using UI Avatars API

    3.2 Business Data Management

    3.2.1 Description and Priority

    Priority: High

    Upload, store, validate, and manage business data including sales, expenses, and profit records.

    3.2.2 Functional Requirements

    • FR-2.1: System shall accept CSV and Excel (.xlsx) file formats
    • FR-2.2: System shall validate data format and required fields
    • FR-2.3: System shall support fields: date, product, sales, expenses, profit, category
    • FR-2.4: System shall store data with user association
    • FR-2.5: System shall allow users to clear all their data
    • FR-2.6: System shall provide data pagination for large datasets
    • FR-2.7: System shall enforce maximum file size of 10MB

    3.3 Dashboard and Visualization

    3.3.1 Description and Priority

    Priority: High

    Interactive dashboard with charts, graphs, and key performance indicators.

    3.3.2 Functional Requirements

    • FR-3.1: System shall display total sales, profit, and expenses metrics
    • FR-3.2: System shall generate line charts for trends over time
    • FR-3.3: System shall generate bar charts for product comparison
    • FR-3.4: System shall generate pie charts for category distribution
    • FR-3.5: System shall update charts in real-time on data changes
    • FR-3.6: System shall support chart export as images
    • FR-3.7: System shall display recent data entries

    3.4 AI-Powered Chat Analysis

    3.4.1 Description and Priority

    Priority: High

    Natural language interface for querying business data and generating insights.

    3.4.2 Functional Requirements

    • FR-4.1: System shall accept natural language queries
    • FR-4.2: System shall extract intent (sales analysis, profit analysis, trend, forecast)
    • FR-4.3: System shall extract entities (dates, amounts, products)
    • FR-4.4: System shall perform sales trend analysis
    • FR-4.5: System shall perform profit analysis
    • FR-4.6: System shall generate sales forecasts using linear regression
    • FR-4.7: System shall provide comparative analysis between products/time periods
    • FR-4.8: System shall store chat history
    • FR-4.9: System shall respond within 3 seconds

    3.5 Anomaly Detection

    3.5.1 Description and Priority

    Priority: Medium

    Automatic detection of unusual patterns in business data.

    3.5.2 Functional Requirements

    • FR-5.1: System shall use Z-score method for anomaly detection
    • FR-5.2: System shall flag data points with Z-score > 2.5
    • FR-5.3: System shall analyze sales, profit, and expense anomalies
    • FR-5.4: System shall display anomalies in dashboard
    • FR-5.5: System shall provide anomaly explanations

    3.6 Data Export

    3.6.1 Description and Priority

    Priority: Medium

    Export business data and analysis results in multiple formats.

    3.6.2 Functional Requirements

    • FR-6.1: System shall export data in CSV format
    • FR-6.2: System shall export data in Excel (.xlsx) format
    • FR-6.3: System shall export data in JSON format
    • FR-6.4: System shall include filters in export
    • FR-6.5: System shall preserve data formatting in exports

    4. External Interface Requirements

    4.1 User Interfaces

    • UI-1: Landing page with feature overview and authentication
    • UI-2: Login/Signup modals with email and Google options
    • UI-3: Dashboard with charts and KPI cards
    • UI-4: Analysis page with chat interface
    • UI-5: Profile page with user settings
    • UI-6: Dark/Light theme toggle
    • UI-7: Responsive design for mobile, tablet, desktop

    4.2 Hardware Interfaces

    No direct hardware interfaces. System operates entirely in web browsers.

    4.3 Software Interfaces

    Component Version Purpose
    Flask 3.1.3 Backend web framework
    Supabase Python Client 2.6.0 Database operations
    Chart.js Latest Data visualization
    Google OAuth 2.0 2.48.0 Social authentication
    Scikit-learn 1.8.0 Machine learning algorithms

    4.4 Communications Interfaces

    • Protocol: HTTPS/HTTP
    • API Format: RESTful JSON
    • Authentication: JWT Bearer tokens
    • CORS: Configured for allowed origins

    5. Non-Functional Requirements

    5.1 Performance Requirements

    • NFR-1.1: API response time shall be under 3 seconds (V4.0 Target: 1.5s average)
    • NFR-1.2: Page load time shall be under 2 seconds (V4.0: <1.5s with CDN)
    • NFR-1.3: System shall support 100 concurrent users (V4.0: tested up to 150)
    • NFR-1.4: Database queries shall execute within 1 second (V4.0: optimized with indexes)
    • NFR-1.5: Chart rendering shall complete within 1 second (V4.0: <800ms)
    • [V4.0] NFR-1.6: Cold start time (Render wake-up) shall be under 60 seconds
    • [V4.0] NFR-1.7: File upload processing shall handle 10MB files within 5 seconds

    5.2 Safety Requirements

    • NFR-2.1: System shall backup data daily
    • NFR-2.2: System shall implement error logging
    • NFR-2.3: System shall gracefully handle failures

    5.3 Security Requirements

    unique salt per user
  • NFR-3.2: JWT tokens shall expire after 7 days with HS256 algorithm
  • NFR-3.3: All API endpoints shall use HTTPS in production
  • NFR-3.4: SQL injection protection through parameterized queries (Supabase ORM)
  • NFR-3.5: XSS protection through input sanitization and Content Security Policy
  • NFR-3.6: CORS shall restrict to authorized domains only (whitelist approach)
  • [V4.0] NFR-3.7: Google OAuth tokens shall be verified server-side
  • [V4.0] NFR-3.8: Environment variables shall never be exposed in client code
  • [V4.0] NFR-3.9: API rate limiting implemented (100 requests per minute per user)
  • [V4.0] NFR-3.10: Session tokens stored in httpOnly cookies where applicable queries
  • NFR-3.5: XSS protection through input sanitization
  • NFR-3.6: CORS shall restrict to authorized domains only
  • 5.4 Software Quality Attributes

    Scalability

    Horizontal scaling through cloud infrastructure, supports growing user base

    Reliability

    99.5% uptime, automatic error recovery, data integrity checks

    Maintainability

    Modular code structure, comprehensive documentation, logging

    Usability

    Intuitive interface, minimal learning curve, responsive design

    6. System Models

    6.1 Use Case Diagram

    
                        ┌──────────────┐
                        │              │
                        │     User     │
                        │              │
                        └──────┬───────┘
                               │
            ┌──────────────────┼──────────────────┐
            │                  │                  │
            ▼                  ▼                  ▼
      [Register/Login]   [Upload Data]    [View Dashboard]
            │                  │                  │
            │                  ▼                  ▼
            │          [Analyze Data]      [Export Data]
            │                  │
            │                  ▼
            └─────────▶  [Chat with AI]
                        

    6.2 Data Flow Diagram (Level 0)

    
    ┌─────────┐          ┌───────────────┐          ┌──────────┐
    │         │          │               │          │          │
    │  User   │◀────────▶│   DataXpert   │◀────────▶│ Database │
    │         │          │   System      │          │          │
    └─────────┘          └───────┬───────┘          └──────────┘
                                 │
                                 │
                                 ▼
                         ┌───────────────┐
                         │   AI Engine   │
                         │   (Analysis)  │
                         └───────────────┘
                        

    6.3 State Diagram (User Session)

    
    [Logged Out] ──Login──▶ [Authenticated] ──Logout──▶ [Logged Out]
                                  │
                                  ├──Upload Data──▶ [Data Uploaded]
                                  │
                                  ├──View Dashboard──▶ [Dashboard Active]
                                  │
                                  └──Chat Analysis──▶ [Analysis Active]
                        

    7. Appendices

    7.1 API Endpoints

    Method Endpoint Description
    POST /api/auth/signup User registration
    POST /api/auth/login User authentication
    POST /api/auth/google Google OAuth
    GET /api/auth/verify Token verification
    POST /api/business/data Upload business data
    GET /api/business/data Retrieve business data
    GET /api/dashboard/stats Get dashboard metrics
    POST /api/ai/chat AI chat analysis
    GET /api/ai/chats Get chat history
    GET /api/health Health check

    7.2 Database Schema

    See ER Diagram page for complete database schema.

    7.3 Assumptions and Dependencies

    • Users have stable internet connection
    • Supabase service is available and operational
    • Google OAuth service is accessible
    • Users have modern web browsers with JavaScript enabled
    • Render hosting service maintains 99.5% uptime

    Version History

    Version Date Author Description
    1.0 January 2026 DataXpert Team Initial SRS document release with core features
    2.0 February 2026 DataXpert Team Added AI chat analysis and anomaly detection features
    3.0 February 28, 2026 DataXpert Team Enhanced data visualization and export capabilities
    4.0 March 5, 2026 DataXpert Team Production release with Google OAuth, improved UI/UX, and complete deployment documentation