Skip to content

A simple Flask web application with MySQL for performing basic CRUD (Create, Read, Update, Delete) operations on user data. Includes additional utility features for date display and arithmetic operations.

License

Notifications You must be signed in to change notification settings

lovnishverma/flask-mysql-crud-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Flask MySQL CRUD App

License: MIT Python Version Flask MySQL


📄 Project Overview

This is a simple Flask + MySQL CRUD (Create, Read, Update, Delete) Web Application built for learning purposes only. It demonstrates basic CRUD operations on user records using Flask as the web framework and MySQL as the database.

It also includes additional demonstration pages for:

  • Displaying the current date and time
  • Performing a simple addition of two numbers via a form

🛠️ Tech Stack

Technology Purpose
Python 3.9+ Core Programming Language
Flask 2.3+ Web Framework
MySQL 8.0+ Relational Database
MySQL Connector Python to MySQL Connection
dotenv Secure environment configuration
HTML (Jinja2) Templating for views

🚩 Features

  • ✅ Add new user
  • ✅ View all users
  • ✅ Edit existing user
  • ✅ Delete user
  • ✅ Display current date and time
  • ✅ Simple number addition via form

📂 Project Structure

├── app.py                 # Main Flask Application
├── .env                   # Environment variables for MySQL credentials
├── templates/              # HTML Templates (Jinja2)
│   ├── index.html
│   ├── adduser.html
│   ├── edituser.html
│   ├── date.html
│   ├── sum.html
├── requirements.txt        # Python Dependencies
└── README.md               # Project Documentation

🚀 Getting Started

🔧 Prerequisites

  • Python 3.9+
  • MySQL Server (Running on localhost:3306)

🔨 Installation Steps

1️⃣ Clone the Repository

git clone https://github.com/lovnishverma/flask-mysql-crud-app.git
cd flask-mysql-crud-app

2️⃣ Set up Virtual Environment

python -m venv venv
source venv/bin/activate      # On Linux / macOS
venv\Scripts\activate         # On Windows

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Configure .env for MySQL Credentials

user=your_mysql_username
pass=your_mysql_password

5️⃣ Ensure MySQL is Running

  • Port: 3306
  • Host: localhost
  • User exists with the credentials provided in .env

6️⃣ Run the Application

python app.py

7️⃣ Open in Browser

http://localhost:5000

💡 Usage Instructions

URL Purpose
/ List all users
/adduser Form to add user
/edit/<id> Edit specific user
/delete/<id> Delete specific user
/date Show current date
/sumpage Sum numbers via form

📢 Disclaimer

This project is created strictly for educational purposes only. It is not intended for production usage. Security best practices such as input validation, CSRF protection, authentication, and authorization are not implemented. The database schema is minimal and the project structure is kept simple for easier understanding.


📄 License

This project is licensed under the MIT License.


🧑‍🏫 Acknowledgements


⭐ How to Support

If you found this project useful for learning:

  • ⭐ Star this repository
  • ✅ Fork and experiment further
  • 💬 Share feedback for improvement

About

A simple Flask web application with MySQL for performing basic CRUD (Create, Read, Update, Delete) operations on user data. Includes additional utility features for date display and arithmetic operations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published