Skip to content

pavanironanki/DataAnalyticsPlatform

Repository files navigation

AI Analytics Platform

A full-stack AI-powered data analytics dashboard that lets you ask questions in natural language and automatically:

  • Generates SQL queries for SQL Server
  • Executes them on your database
  • Visualizes results as charts
  • Produces AI-generated business insights

##Tech Stack

Backend

C#, .NET 10 (ASP.NET Core)

Entity Framework Core

SQL Server / SQL Express

OpenAI Chat Completions API (GPT-4o-mini)

Dependency Injection, HttpClient, Options pattern

Frontend

HTML5

Tailwind CSS

Font Awesome icons

Chart.js for charts

Vanilla JavaScript + Fetch API

1. Main Dashboard

Dashboard

2. Natural Language Query Processing

Query Processing

3. AI-Generated Insights

AI Insights

4. Visual Analytics Charts

Charts


🎯 What This Project Does

This project simulates a mini “AI + BI” tool:

  1. You type a question in plain English

    e.g., “Show me total sales by month for the last year”

  2. The backend uses OpenAI GPT-4o-mini to:

    • Understand your intent
    • Generate a T-SQL query against your schema
  3. The app runs this SQL against a Sales database via Entity Framework Core.

  4. The result is:

    • Returned to the frontend as JSON
    • Visualized with Chart.js (line/bar charts for trends, etc.)
    • Sent back to OpenAI again to generate business-level insights (trends, peaks, anomalies, recommendations)
  5. The UI displays:

    • The exact SQL query used
    • Execution stats (rows returned, time, confidence)
    • AI-generated insights in natural language
    • Interactive charts that show how metrics change over time or by category

High-Level Architecture

[User Browser] │ ▼ [HTML + Tailwind + JS + Chart.js] ← (index.html served from wwwroot) │ ▼ [ASP.NET Core Controllers] │ ├─ /api/test/query → Natural language → SQL → execute → insights + chart data └─ /api/test/test-db → Database connectivity check │ ▼ [Services: AiQueryService] │ ├─ Calls OpenAI (chat completions) to create SQL └─ Calls OpenAI again to summarize result rows as insights │ ▼ [EF Core + SQL Server] ├─ Tables: Sales, Customers, Products, ProductCategories └─ Seeded demo data for analytics

About

Natural-language-to-SQL query engine with real-time database insights, AI-generated analytics, interactive charts, and a modern Tailwind UI. Built using ASP.NET Core, SQL Server, and OpenAI GPT-4o Mini.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors