Skip to content

amirdhs/FlaskCRUDapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask CRUD Employee Management Application

This is a simple Flask-based web application for managing employee records. It implements CRUD (Create, Read, Update, Delete) operations to allow users to add, view, edit, and delete employee information.


Features

  • Create: Add new employees with their name, email, and phone number.
  • Read: View a list of all employees in a table format.
  • Update: Edit existing employee details.
  • Delete: Remove employees from the database.
  • Flash Messages: Success messages are displayed after adding, updating, or deleting an employee.
  • Bootstrap Styling: The application uses Bootstrap for a clean and responsive user interface.

Technologies Used

  • Python: The programming language used for the backend.
  • Flask: A lightweight web framework for Python.
  • SQLite: A lightweight database for storing employee records.
  • SQLAlchemy: An ORM (Object-Relational Mapping) tool for database operations.
  • Bootstrap: A front-end framework for styling the application.
  • JQuery: A JavaScript library for client-side scripting.

Prerequisites

Before running the application, ensure you have the following installed:

  • Python 3.x
  • Pip (Python package installer)

Installation and Setup

  1. Clone the Repository:

    git clone https://github.com/your-username/flask-crud-employee-management.git
    cd flask-crud-employee-management
  2. Create a Virtual Environment (Optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install Dependencies:

    pip install -r requirements.txt

    If you don't have a requirements.txt file, install the required packages manually:

    pip install Flask Flask-SQLAlchemy
  4. Run the Application:

    python app.py
  5. Access the Application: Open your browser and go to http://localhost:5000.


Project Structure

flask-crud-employee-management/
├── app.py                  # Main Flask application file
├── templates/              # HTML templates
│   ├── base.html           # Base template
│   ├── index.html          # Homepage with employee list
│   ├── add_employee.html   # Form for adding new employees
│   ├── edit_employee.html  # Form for editing employees
│   ├── delete_employee.html# Confirmation page for deletion
│   └── header.html         # Header section
├── static/                 # Static files (CSS, JS)
│   ├── css/
│   │   └── bootstrap.min.css
│   └── js/
│       ├── bootstrap.min.js
│       └── jquery-3.5.1.min.js
└── README.md               # Project documentation

Usage

  1. Homepage:

    • Displays a list of all employees.
    • Click the "Add New Employee" button to add a new employee.
  2. Add Employee:

    • Fill out the form with the employee's name, email, and phone number.
    • Click "Add Employee" to save the record.
  3. Edit Employee:

    • Click the "Edit" button next to an employee in the list.
    • Update the employee's details in the form and click "Update Employee".
  4. Delete Employee:

    • Click the "Delete" button next to an employee in the list.
    • Confirm the deletion when prompted.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors