admin portal
1.0.0
Admin dashboard for managing data for AI-chatbot
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.
Before running the application, ensure the following prerequisites are met:
pip install -r requirements.txt
.FLASK_SECRET_KEY
and any other required variables should be set.The project consists of the following files:
main.py
: The man program script. Starting point.app.py
: The main Flask application file containing the server logic.admin_users.json
: A JSON file containing a list of admin users' credentials.client_secret.json
: A JSON file containing Google Drive API keys and credentials. (Get it from here [https://console.cloud.google.com/]).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
)utils.py
: Utilites / helper functions for app.py
manage_vectordb.py
: Module for managing the data on Pinecone vector database. Also a standalone script for testing the database.git clone https://github.com/madhav-mknc/admin-portal
cd https://github.com/madhav-mknc/admin-portal
pip install -r requirements.txt
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.admin_users.json
file contains valid admin user credentials.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
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.
The Flask application exposes the following routes:
/
: The homepage of the Admin Portal./login
: The login page for administrators to authenticate themselves./dashboard
: The main dashboard page where administrators can see the uploaded files and manage them./uploads/
: A route to serve uploaded files directly from the server./upload
: A route to upload files to the server./upload_google_drive
: A route for uploading files from Google Drive./handle_url
: A route for fetching data using a URL./delete/
: A route to delete uploaded files from the server./logout
: A route to log out and clear the authenticated session./chatbot
: Redirect to chatbot.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.This project is licensed under the MIT License. Feel free to use and modify it according to your needs.