Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š SQL Query Visualizer Web App

A React.js web application that allows users to run SQL queries, view mock query results, and toggle between predefined queries and their corresponding data tables. It also supports viewing large SQL table data from CSV files.


πŸš€ Features

βœ… Execute SQL queries and display results in a table format.
βœ… Toggle between predefined SQL queries and their corresponding table data.
βœ… View mock data from CSV files with lazy Loading.
βœ… Interactive dropdowns for table selection.
βœ… Smooth and stylish UI with CSS styling and dark mode compatibility.
βœ… Store history so that can be used any time if needed again.
βœ… AI feature to convert Natural language to sql Query any time you need.
βœ… Help Section
βœ… Multiple Tab to run multiple Query as and when needed.
βœ… Different Layout options as per the user requirement.


πŸ› οΈ Tech Stack

  • Frontend: React.js, HTML, CSS
  • State Management: Context API
  • CSV Data Handling: papaparse (for parsing CSV files)
  • Dropdown Component: react-dropdown
  • Styling: CSS Variables for light/dark mode support

Measuring Page Load Time

Tools Used for Measurement:

We measured the page load time using:

  1. Google Lighthouse (Chrome DevTools)
    • Open DevTools (F12 in Chrome).
    • Navigate to the Lighthouse tab.
    • Run an audit to get metrics like FCP, LCP, CLS, TBT, and INP.
  2. Network Tab in Chrome DevTools
    • Open DevTools β†’ Network tab.
    • Reload the page and check DOMContentLoaded and Load Time.

Page Load Metrics:

  • Largest Contentful Paint (LCP): ~0.36s
  • Cumulative Layout Shift (CLS): 0.09
  • Load time: ~646ms

Optimizations for Performance Improvement

To enhance performance and reduce load time, we implemented the following optimizations:

A. JavaScript & Code Optimization

βœ… Lazy loading components (React.lazy + Suspense) for faster initial load.
βœ… Removed unused JavaScript with Tree Shaking.

B. Image & Asset Optimization

βœ… Converted images to WebP format for better compression.
βœ… Used lazy loading for images (loading="lazy" attribute).

βš™οΈ Installation Instructions

βœ… 1. Clone the Repository

git clone https://github.com/Suryanra/sqlmagic.git
cd sqlmagic

βœ… 2. Install Dependencies

npm install

βœ… 3. Start the Development Server

npm start

πŸ“š Folder Structure

β”œβ”€β”€ public                 
β”‚   β”œβ”€β”€ data                # CSV files
β”‚   β”‚   β”œβ”€β”€ employee.csv
β”‚   β”‚   β”œβ”€β”€ products.csv
β”‚   β”‚   β”œβ”€β”€ orders.csv
β”‚   β”‚   └── courses.csv
|   |   └──customers.csv
β”‚   β”œβ”€β”€ index.html
β”‚   └── favicon.ico
β”‚
β”œβ”€β”€ src                    
β”‚   β”œβ”€β”€ components   
β”‚   β”‚   └── style      
β”‚   β”œβ”€β”€ context            
β”‚   β”‚   └── AppContext.js
β”‚   β”‚   └── AppPrvider.js
β”‚   β”œβ”€β”€ App.js             
β”‚   β”œβ”€β”€ index.js           
β”‚
β”œβ”€β”€ .gitignore             
β”œβ”€β”€ package.json           
β”œβ”€β”€ README.md              
└── yarn.lock / package-lock.json

🌟 Usage Guide

🎯 1. Select a Table

  • Use the dropdown to choose between:
    • Employee Data
    • Teacher Data
    • Orders Data
    • Courses Data
  • You can also View the table Schema
  • History of all the Query you have run

🎯 2. Run SQL Queries

  • Use the query terminal to enter SQL queries.
  • Click "Run" to display mock data results.
  • You can Open and close multiple tab as per your requirement.

🎯 3. Toggle Dark Mode

  • Click the dark mode toggle button to switch between light and dark themes.

🎯 3. Different layout

  • You can change the different layout as per the requirement.

🎯 3. AI to generate the Query

  • Have AI chat bot that give support to convert the natural language to sql query.
  • It also provide the explanation of the query generated

🎯 3. Help Secction

-Add the Help section for the users.


πŸ–ΌοΈ Performance Metrics

image image


πŸ–ΌοΈ Architecture Diagram

alt text


πŸ–ΌοΈ Screenshots

βœ… Home Page
alt text

βœ… Query Execution:
alt text

βœ… Table Selection with Dropdown alt text

βœ… Dark Mode Enabled:
alt text

βœ… NLP to sql Query
alt text

βœ… SQL query history
alt text

πŸ›€ Dependencies

"dependencies": {
  "react": "^18.0.0",
  "react-dropdown": "^1.11.0",
  "papaparse": "^5.3.0",
  "react-scripts": "5.0.1"
}


πŸ“ž Contact

πŸ“§ Email: suryapratapnra@gmail.com
🌐 Portfolio: https://surya-portfolio-three.vercel.app/


Thankyou

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages