Skip to content

Priyang1310/Chat-With-Database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat Interface with Database

Table of Contents

  1. Introduction
  2. Project Overview
  3. Technologies Used
  4. System Architecture
  5. Features
  6. Installation
  7. Usage
  8. Endpoints
  9. Model Training with Gemini-pro
  10. Performance Evaluation
  11. Future Enhancements

Introduction

Welcome to the "Chat with Database" project. This repository contains the source code for a chat interface that allows users to interact with SQL and NoSQL databases through a user-friendly interface.

Project Overview

The aim of this project is to develop a chat application where users can:

  • Authenticate using Auth0.
  • Chat with a bot to interact with databases.
  • Manage their user profiles.
  • Connect to either MySQL or MongoDB databases.
  • Execute queries and get responses.
  • Train a custom machine learning model using Gemini-pro based on user-selected tables.

Technologies Used

  • Frontend: React, Material-UI, Axios, React Router
  • Backend: Flask, REST APIs
  • Authentication: Auth0
  • Database: MySQL, MongoDB
  • Machine Learning: Gemini-pro

System Architecture

The system architecture comprises:

  • Frontend: Built using React and Material-UI.
  • Backend: A Flask server for handling API requests and responses.
  • Databases: MySQL for SQL support and MongoDB for NoSQL support.
  • Authentication: Managed by Auth0.
  • Machine Learning: Gemini-pro for training models and generating responses.

Features

  • Landing Page: Displays a welcoming message and an option to sign in.
  • Authentication: Uses Auth0 for user login.
  • Chat Interface: Allows users to chat and interact with the application.
  • User Profile Management: Users can view and edit their profile information.
  • Database Connectivity: Supports connections to MySQL and MongoDB databases.
  • Model Training: Trains a custom machine learning model using Gemini-pro.

Installation

  1. Clone the repository:

    git clone https://github.com/Priyang1310/Woodpecker.git
  2. Install dependencies:

    # For the frontend
    cd client
    npm install
    
    # For the backend
    cd ../server
    pip install -r requirements.txt
  3. Set up environment variables:

    • Create a .env file in the backend directory and add your environment variables for Auth0, database connections, etc.
  4. Run the application:

    # Start the frontend
    cd client
    npm run dev
    
    # Start the backend
    cd ../server
    python app.py

Usage

  1. Landing Page: Navigate to the landing page and click on "Sign In".
  2. Authentication: Log in using Auth0.
  3. Chat Interface: Interact with the chat interface to send queries to the database.
  4. Profile Management: Click on the profile button to view and edit profile information.
  5. Database Connection: Choose between MySQL and MongoDB for database operations.
  6. Query Execution: Execute queries and receive responses.
  7. Model Training: Train the machine learning model with Gemini-pro.

Endpoints

Profile Management

Mongodb Connection

  • /connect: Establish the connection with mongodb database and the response will return the collections of that database.

MySQL Connection

  • /mysql/connect: Establish the connection with mySQL database and the response will return the tables of that database.

Training Agent

  • /collections: For training the agent on a specific collection for the mongodb database.
  • /mysql/tables: For training the agent on a specific collection for the MySQL database.

NoSQL Queries

  • /ask: Executes NoSQL queries against the MongoDB database.

SQL Queries

  • /aski: Executes SQL queries against the MySQL database.

Model Training with Gemini-pro

  • Data Preparation: Extracts data from user-selected tables.
  • Model Training: Trains the Gemini-pro model with the prepared data.
  • Model Integration: Integrates the trained model into the Flask server for processing queries.

Performance Evaluation

  • Response Time: Measures the time taken to process and respond to user queries.
  • Accuracy: Assesses the precision of responses generated by the trained model.
  • Scalability: Evaluates the system's ability to handle multiple users and large datasets simultaneously.

Future Enhancements

  • Additional Database Support: Integrate support for other databases like PostgreSQL or Cassandra.
  • Advanced Analytics: Add features for advanced data analytics and reporting.
  • Improved UI/UX: Enhance the user interface with more customization options and interactive elements.
  • Real-time Collaboration: Enable real-time collaboration features for multiple users.

Screenshots

Landing Page

Landing Page

Authentication

Authentication

Chat Interface

Chat Interface

Profile Management

Profile Management

Query Execution

SQL Query Execution

Query Execution in Light Theme

SQL Query Execution

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors