Skip to content

Latest commit

 

History

History
152 lines (127 loc) · 5.44 KB

File metadata and controls

152 lines (127 loc) · 5.44 KB

Gulf Coast HVAC Inventory Management System

Java MySQL IDE-IntelliJ License: MIT

📌 Overview

The Gulf Coast HVAC Inventory Management System is a Java-based application built to streamline inventory management for Referral Only HVAC.

  • Developed in Java using Eclipse IDE then refactored in IntelliJ IDEA
  • Database built on MySQL 8.0 using MySQL Workbench
  • Console-based, menu-driven interface with an optional Swing GUI
  • Uses DAO (Data Access Object) and Singleton design patterns
  • Includes role-based access control, audit logging, stock tracking, and invoice management features
  • Version-controlled with GitHub

🔐 Features

  • Authentication & Roles

    • Register with unique username & strong password (validated with regex) (≥12 chars, uppercase, lowercase, number, special char).
    • Role-based access control (ADMIN, USER, VIEWER).
  • Product Management

    • Add, update, search, and deactivate products (SKU-based).
    • Paginated view of active products.
  • Stock Control

    • Atomic stock adjustments with reason + responsible user.
    • Full stock movement history retained.
  • Reports

    • Low-stock report.
    • Audit log of product changes.
  • Logging

    • Tracks system events, warnings, and errors.

🗂️ Project Structure

gulf-coast-hvac-inventory-management/
│── src/
│   └── com/
│       └── gulfcoasthvac/
│           └── inventory/
│               ├── Main.java          # Console entry point and menu loop
│               ├── Auth.java          # Registration and authentication
│               ├── User.java          # Authenticated user session record
│               ├── Product.java       # Product DAO for CRUD and stock actions
│               ├── Invoice.java       # Invoice DAO and stock adjustment logic
│               ├── Reports.java       # Low-stock and audit log reports
│               ├── DBConnection.java  # Singleton database connection
│               ├── AppLogger.java     # Logging utility
│               └── GUIExample.java    # Optional Swing GUI
│
│── lib/
│   └── mysql-connector-j-x.x.x.jar     # MySQL JDBC driver
│
│── sql/
│   └── schema.sql                      # Clean database schema
│
│── README.md
│── LICENSE
│── .gitignore

⚙️ Installation & Setup

1. Clone Repository

git clone https://github.com/mtyndall88/gulf-coast-hvac-inventory-management.git
cd gulf-coast-hvac-inventory-management

2. Database Setup

CREATE DATABASE gulf_coast_hvac_inventory;

Then import schema:

mysql -u root -p gulf_coast_hvac_inventory < sql/schema.sql

3. Configure DB Connection

Edit DBConnection.java:

private static final String URL = "jdbc:mysql://localhost:3306/gulf_coast_hvac_inventory?useSSL=false&serverTimezone=UTC";
private static final String USER = "root";
private static final String PASSWORD = "yourpassword";

4. Run Program

javac -cp "lib/mysql-connector-j-9.7.0.jar" -d out src/com/gulfcoasthvac/inventory/*.java
java -cp "out;lib/mysql-connector-j-9.7.0.jar" com.gulfcoasthvac.inventory.Main

5. Running in IntelliJ IDEA

  1. Open the project folder in IntelliJ IDEA.
  2. Set the Project SDK to JDK 21.
  3. Add the MySQL Connector/J .jar file as a project library.
  4. Confirm src is marked as the Sources folder.
  5. Run Main.java.

🖥️ Usage

  • On startup, (R)egister, (L)ogin, (Q)uit
  • Menu Loop:
    • g → Get all products (active list).
    • s → Search by name/SKU (parameterized LIKE)
    • a → Add product (SKU, name, desc, price, reorder; INSERT + generated key + audit)
    • u → Update product (price/reorder; live UPDATE + audit)
    • d → Deactivate product (live UPDATE + audit)
    • j → Adjust stock (±qty with reason; transaction writes stock movement + audit)
    • v → Add invoice with customer, product, qty, and total amount (creates invoice, line item, decrements stock, writes stock movement + audit)
    • i → Lists the last 10 invoices
    • r → Low-stock report (DB view)
    • t → Audit log report for last 20 entries
    • q → Quits the program and logs the exit

Role restrictions apply (e.g., VIEWER cannot edit products or stock).


✅ Development Plan

  • Week 1 - Proposal, DB setup, GitHub repo
  • Week 2 - Product CRUD features
  • Week 3 - Logging system
  • Week 4 - Menu navigation & simulated reports
  • Week 5 - Database integration
  • Week 6 - Final testing & delivery

📖 References


🧑‍💻 Author

Mark Tyndall


⚖️ License

This project is licensed under the MIT License.