Skip to content

ShaikhMazin/Garage-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 Garage Management System

A Python-based web application to manage garage operations — add customers, track services, generate printable bills, and view service history.


📅 Project Info

Field Details
Project Name Garage Management System
Created On April 3, 2025
Version 1.0.0
Tech Stack Python (Flask), MySQL, HTML/CSS/JS, Bootstrap 5
Status Active

📌 Overview

The Garage Management System is a Flask web application designed for garage/auto-repair shops. It allows the garage owner to:

  • Log in securely
  • Manage customer and vehicle records
  • Add multiple services per customer with auto-calculated totals
  • View full service history per customer
  • Generate and print professional bills with garage branding

✨ Features

🔐 Login System

  • Owner-only access via a username & password login page
  • Protects all routes from unauthorized access

👤 Customer Management

  • Add Customer — Register customer name, phone number, vehicle number, and vehicle model
  • Edit Customer — Update any existing customer details
  • Delete Customer — Remove a customer record
  • Search — Search customers by vehicle number from the main dashboard

🔧 Service / Job Tracking

  • Add multiple service entries per customer in one form
  • Each service entry includes:
    • Date of service
    • Work Done (description)
    • Cost (in ₹)
  • JavaScript auto-calculates the total cost live as you type
  • Supports adding unlimited service rows with "+ Add More Work"

📋 Service History

  • View full service history for any customer
  • Displays all past services in a table: Date, Work Done, Cost
  • Shows cumulative Total Amount at the bottom

🧾 Bill Generation

  • Generates a clean, printable bill page per customer
  • Bill includes:
    • Garage branding — Logo, Name, Owner, Phone, Address
    • Customer details — Name, Phone, Vehicle Number
    • Services table — Date, Work Done, Cost for all services
    • Grand Total
  • One-click Print button (window.print())

🛠️ Tech Stack

Layer Technology
Backend Python (Flask)
Frontend HTML5, CSS3, JavaScript
UI Library Bootstrap 5.3
Database MySQL
Templating Jinja2 (Flask templates)

🗂️ Project Structure

garage-management-system/
│
├── templates/                  # Jinja2 HTML Templates
│   ├── base.html               # Base layout (navbar, flash messages)
│   ├── login.html              # Login page
│   ├── index.html              # Customer dashboard with search
│   ├── add_customer.html       # Add new customer form
│   ├── edit_customer.html      # Edit existing customer form
│   ├── add_service.html        # Add service(s) for a customer
│   ├── history.html            # Service history per customer
│   └── bill.html               # Printable bill page
│
├── static/
│   └── <garage_logo>           # Garage logo image (used in bill)
│
├── app.py                      # Main Flask application & routes
├── config.py                   # DB config, garage info, login creds
├── requirements.txt            # Python dependencies
└── README.md

🗃️ Database Schema

-- Customers Table
CREATE TABLE customers (
    id          INT AUTO_INCREMENT PRIMARY KEY,
    name        VARCHAR(100) NOT NULL,
    phone       VARCHAR(15)  NOT NULL,
    vehicle_no  VARCHAR(50)  NOT NULL,
    model       VARCHAR(100)
);

-- Services Table
CREATE TABLE services (
    id           INT AUTO_INCREMENT PRIMARY KEY,
    customer_id  INT NOT NULL,
    service_date DATE NOT NULL,
    description  TEXT NOT NULL,
    cost         DECIMAL(10, 2) NOT NULL,
    FOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE CASCADE
);

🔗 Application Routes

Route Method Description
/login GET, POST Login page
/logout GET Logout and redirect to login
/ GET Customer dashboard (with search)
/add GET, POST Add new customer
/edit/<id> GET, POST Edit existing customer
/delete/<id> GET Delete customer
/add_service/<id> GET, POST Add service entries for a customer
/history/<id> GET View service history of a customer
/bill/<id> GET View & print bill for a customer

⚙️ Installation & Setup

Prerequisites

  • Python 3.8+
  • MySQL 8.0+
  • pip

1. Clone the Repository

git clone https://github.com/your-username/garage-management-system.git
cd garage-management-system

2. Install Dependencies

pip install -r requirements.txt

3. Set Up the Database

CREATE DATABASE garage_db;
USE garage_db;

CREATE TABLE customers (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    phone VARCHAR(15) NOT NULL,
    vehicle_no VARCHAR(50) NOT NULL,
    model VARCHAR(100)
);

CREATE TABLE services (
    id INT AUTO_INCREMENT PRIMARY KEY,
    customer_id INT NOT NULL,
    service_date DATE NOT NULL,
    description TEXT NOT NULL,
    cost DECIMAL(10,2) NOT NULL,
    FOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE CASCADE
);

4. Configure the App

Update config.py with your details:

# Database
DB_HOST     = "localhost"
DB_USER     = "root"
DB_PASSWORD = "your_password"
DB_NAME     = "garage_db"

# Login credentials
ADMIN_USERNAME = "admin"
ADMIN_PASSWORD = "your_password"

# Garage Info (used in bill)
GARAGE = {
    "name"    : "Your Garage Name",
    "owner"   : "Owner Name",
    "phone"   : "9876543210",
    "address" : "Your Address",
    "logo"    : "logo.png"      # Place logo in /static/
}

5. Run the App

python app.py

Visit: http://localhost:5000


📸 Pages & UI

Page Description
login.html Simple login form with username & password
index.html Dashboard table of all customers with action buttons
add_customer Form to register a new customer + vehicle
edit_customer Pre-filled form to update customer details
add_service Dynamic form — add multiple services, live total in ₹
history Table of all past services with total for a customer
bill Print-ready bill with garage logo, details & services

💡 Key Code Highlights

Dynamic Service Form (JavaScript)

The add_service.html uses vanilla JS to dynamically add new service rows and calculate the running total in real time:

function addRow() {
    // Creates a new row with description + cost inputs
}

function calculateTotal() {
    // Sums all .cost inputs and updates #total live
}

Printable Bill

The bill.html is a standalone page (no base.html) with print-optimized CSS. The print button triggers:

window.print()

Flash Messages

base.html displays Flask flash messages as Bootstrap alerts across all pages automatically.


🔮 Future Improvements

  • Password hashing for secure login (bcrypt)
  • SMS/WhatsApp bill sharing for customers
  • Dashboard with monthly revenue analytics
  • Multiple garage/branch support
  • Export bill as PDF directly

👨‍💻 Author

Your Name Shaikh Mazin | Aspiring Data Engineer 📧 your-skmazin9@gmail.com 🔗 https://github.com/ShaikhMazin


About

A Flask web app to manage garage operations — customers, vehicle records, service tracking, billing & printable invoices. Built with Python, MySQL & Bootstrap.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors