https://github.com/qwertyfusion/database-management-using-flask
This project implements a User Authentication System using MySQL Database connectivity and Flask.
https://github.com/qwertyfusion/database-management-using-flask
bootstrap css flask html mysql mysql-workbench
Last synced: over 1 year ago
JSON representation
This project implements a User Authentication System using MySQL Database connectivity and Flask.
- Host: GitHub
- URL: https://github.com/qwertyfusion/database-management-using-flask
- Owner: QwertyFusion
- License: mit
- Created: 2025-03-20T06:47:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-23T20:41:28.000Z (over 1 year ago)
- Last Synced: 2025-03-23T21:26:30.349Z (over 1 year ago)
- Topics: bootstrap, css, flask, html, mysql, mysql-workbench
- Language: HTML
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask Auth using MySQL Database
This project implements a User Authentication System using MySQL Database connectivity and Flask.
---
## 🚀 Features
- Implemented user authentication/registration form using Flask and the database.
- **New Users**: Register using the signup button.
- **Existing Users**: Login with their credentials.
- Inside, users can update their personal details and reset their passwords.
- Users can view their grades but cannot edit them personally.
- Built a **responsive frontend** for user interactions using Bootstrap.
- Implemented backend flask connectivity with MySQL database.
---
## 🖼️ Preview

---
## 📜 License
Flask Auth is open-source and released under the **MIT License**.
See the [LICENSE](./LICENSE) file for more details.
---
## 🛠️ Get Started
### 1️⃣ Clone the Repository
```sh
git clone "https://github.com/QwertyFusion/Database-Management-Using-Flask"
cd Database-Management-Using-Flask
```
### 2️⃣ Backend Setup (Flask)
#### Create and Activate Virtual Environment (venv)
```sh
python -m venv venv # Create virtual environment
source venv/bin/activate # MacOS/Linux
venv\Scripts\activate # Windows
```
#### Install Dependencies
```sh
pip install -r requirements.txt
```
### 3️⃣ Database Setup (MySQL and MySQL Workbench)
#### Install MySQL Server and MySQL Workbench from official websites
```yaml
MySQL Server Download Link: https://dev.mysql.com/downloads/installer/
MySQL Workbench Download Link: https://dev.mysql.com/downloads/workbench/
```
#### In MySQL Workbench, create `user_management` database and use it
```sql
CREATE DATABASE user_management;
USE user_management;
```
#### In MySQL Workbench, create `user` table and `grades` table and use it
```sql
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE grades (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
subject VARCHAR(100) NOT NULL,
grade DECIMAL(5, 2) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
```
#### In MySQL Workbench, insert into `grades` table after creating account using frontend. Do this before logging in.
```sql
INSERT INTO grades (user_id, subject, grade) VALUES (1, '', );
```
### 4️⃣ Environment Variables
#### Create `.env` similar to `.env.example` for Flask Backend connectivity with your MySQL Database server:
```env
SECRET_KEY=mysecretkey # Keep this same, no need to change or delete
MYSQL_HOST=YOUR_MYSQL_SERVER_HOST
MYSQL_USER=root
MYSQL_PASSWORD=YOUR_MYSQL_SERVER_PASSWORD
MYSQL_DB=user_management # Your Database name
```
### 5️⃣ Run the Project
#### Start the Flask Backend
```bash
python app.py # Ensure the virtual environment is activated
```
Now, open your browser and go to **http://127.0.0.1:5000** to start using Flask Auth! 🚀
---
## 🛠 Tools Used
- Visual Studio Code
- HTML
- CSS
- Bootstrap
- Flask
- MySQL
- MySQL Workbench
- Git & GitHub (Version Control)
---
## 🔗 Link to Tools
---
## 👨💻 Developer