Skip to content

Repository files navigation

Doc Sharing Platform - Tkinter + MySQL Project

A simple Tkinter-based document sharing platform connected to a MySQL database. This project demonstrates backend development using Python and MySQL.

Users can register, log in, view available documents, request documents, and download them locally. Administrators have additional permissions to add and delete documents.


Features

User Features

  • Register/Login: Users can create an account and log in.
  • View Documents: View the list of available documents after logging in.
  • Request Documents: Request and download documents locally.

Admin Features

  • Admin Login: Admin can log in using admin credentials.
  • Add Documents: Add new documents to the platform.
  • Delete Documents: Delete documents using their document ID.

To Run Locally

Prerequisites

Before you begin, make sure you have the following installed:

  • Python — Check with python --version
  • MySQL — Required to host the databases
  • Git — Required to clone the repository

Step 1: Clone the Repository

Open a terminal or command prompt and run:

git clone https://github.com/vignesh-krish-dev/doc-sharing-platform.git
cd doc-sharing-platform

Step 2: Install Required Libraries

Install the required PyMySQL library:

pip install pymysql

Step 3: Set Up MySQL Database

Open MySQL and create the following databases:

admin
userdb

Create the required tables in each database.

Admin Database

CREATE TABLE docs (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    description TEXT
);

User Database

CREATE TABLE user (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(255) UNIQUE NOT NULL,
    password VARCHAR(255) NOT NULL,
    email VARCHAR(255)
);

Step 4: Configure Database Connection

Open the following Python files in the project:

index.py
adminlogin.py
admin dash.py
userdash.py
ud2.py
ud3.py

Update the MySQL connection details in each file with your own credentials.

Example:

connection = pymysql.connect(
    host="localhost",
    user="your_mysql_username",
    password="your_mysql_password",
    database="userdb"  # Use "admin" for the admin database
)

Step 5: Run the Application

Start the user interface with:

python index.py

To access the admin dashboard:

python adminlogin.py

Other application modules can be run using:

python userdash.py
python "admin dash.py"
python ud2.py
python ud3.py

Step 6: Use the Application

For Users

  1. Register a new account.
  2. Log in using your credentials.
  3. View available documents.
  4. Request or download documents.

For Admin

  1. Log in with admin credentials.
  2. Add new documents.
  3. Delete existing documents using the document ID.

Troubleshooting

If you encounter issues:

  • Make sure MySQL is running.
  • Verify that the admin and userdb databases exist.
  • Ensure the required tables have been created.
  • Double-check MySQL credentials in all Python files.
  • Make sure the required Python libraries are installed.
  • Ensure you are running the commands from the project directory.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages