Giter Site home page Giter Site logo

developers81828182 / admin-portal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from madhav-mknc/admin-portal

0.0 1.0 0.0 975 KB

Admin dashboard for managing data for AI-chatbot which can interact with this data using OpenAI's powerful GPT3/3.5/4 LLMs.

License: MIT License

JavaScript 8.43% Python 58.65% CSS 19.29% HTML 13.63%

admin-portal's Introduction

admin-portal

Admin dashboard for managing data for AI-chatbot

Project Development Details

Project Description

This project is an Admin Portal for managing data for an AI chatbot. It allows administrators to log in, upload, and delete files. The application is built using Flask, a popular Python web framework, and it provides a simple web interface to interact with the chatbot's data.

Prerequisites

Before running the application, ensure the following prerequisites are met:

  1. Python 3.x is installed on the system.
  2. Required Python packages are installed. You can install them using pip install -r requirements.txt.
  3. The environment variables FLASK_SECRET_KEY and any other required variables should be set.

Project Structure

The project consists of the following files:

  1. main.py: The man program script. Starting point.
  2. app.py: The main Flask application file containing the server logic.
  3. admin_users.json: A JSON file containing a list of admin users' credentials.
  4. client_secret.json: A JSON file containing Google Drive API keys and credentials. (Get it from here [https://console.cloud.google.com/])
  5. .stored_files.json: A JSON file used for attaining Data transparency, this file is kept in synced with the pinecone vector database. (maintained by the manage_vectordb.py)
  6. utils.py: Utilites / helper functions for app.py
  7. manage_vectordb.py: Module for managing the data on Pinecone vector database. Also a standalone script for testing the database.

Installation and Setup

  1. Clone the repository from GitHub.
git clone https://github.com/madhav-mknc/admin-portal
cd https://github.com/madhav-mknc/admin-portal
  1. Install the required dependencies using:
pip install -r requirements.txt
  1. Set the environment variable FLASK_SECRET_KEY to a strong random key for session management and security. Note: In a production environment, ensure this key is kept secret and not hard-coded.
  2. Ensure the admin_users.json file contains valid admin user credentials.
  3. Set all the required env variables mentioned in ".env" file.

How to Run

  • To start the Flask server, run the start_server() function in the app.py file. The server will run on http://0.0.0.0:80/ and listen to incoming requests.
python app.py

or

python main.py
  • For testing QnA: Open another command line in the same directory and follow the following commands:
python manage_vectordb.py
* ".stats" is a command short for index.describe_index_stats()
* ".reset_index" is for resetting the index by deleting and creating a new one.

Routes

The Flask application exposes the following routes:

  1. /: The homepage of the Admin Portal.
  2. /login: The login page for administrators to authenticate themselves.
  3. /dashboard: The main dashboard page where administrators can see the uploaded files and manage them.
  4. /uploads/<filename>: A route to serve uploaded files directly from the server.
  5. /upload: A route to upload files to the server.
  6. /upload_google_drive: A route for uploading files from Google Drive.
  7. /handle_url: A route for fetching data using a URL.
  8. /delete/<filename>: A route to delete uploaded files from the server.
  9. /logout: A route to log out and clear the authenticated session.
  10. /chatbot: Redirect to chatbot.

Important Notes

  1. The project uses Flask's built-in session management to store the authenticated status, which is not suitable for production environments. In a real-world application, consider using a more robust session management solution.
  2. The allowed_file() function allows only specific file types (txt, pdf, doc, docx, csv) to be uploaded. Modify the ALLOWED_EXTENSIONS set to include additional file types if required.
  3. In a production environment, it's crucial to ensure secure file uploads to prevent any potential security risks.

License

This project is licensed under the MIT License. Feel free to use and modify it according to your needs.

admin-portal's People

Contributors

madhav-mknc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.