Skip to content

Seththaro/vehicles-inventory-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-inventory-system

A modern, full-featured vehicle inventory management system built with PHP and MySQL. This application provides both public-facing vehicle listings and a comprehensive admin panel for managing your used car dealership's inventory.

Features

Public Interface

  • Vehicle Listings: Browse all available vehicles in an organized table format
  • Advanced Filtering: Filter vehicles by make, type, and class
  • Flexible Sorting: Sort by price (high to low, low to high) or year (newest to oldest, oldest to newest)
  • Responsive Design: Mobile-friendly interface using Tailwind CSS

Admin Panel

  • Vehicle Management: Add and delete vehicles with ease
  • Category Management: Manage makes, types, and classes
  • Bulk Operations: Quick delete functionality with confirmation prompts
  • Intuitive Navigation: Easy-to-use admin interface with centralized footer navigation

Technology Stack

  • Backend: PHP 7.4+
  • Database: MySQL with PDO
  • Frontend: HTML5, Tailwind CSS
  • JavaScript: Vanilla JS for dynamic interactions

Installation

Prerequisites

  • PHP 7.4 or higher
  • MySQL 5.7 or higher
  • Web server (Apache/Nginx)
  • Node.js and npm (for Tailwind CSS development)

Setup Instructions

  1. Clone the repository

    git clone https://github.com/yourusername/zippy-used-autos.git
    cd zippy-used-autos
  2. Create the database

    CREATE DATABASE zippyusedautos;
  3. Import the database schema

    CREATE TABLE makes (
        id INT AUTO_INCREMENT PRIMARY KEY,
        name VARCHAR(100) NOT NULL
    );
    
    CREATE TABLE types (
        id INT AUTO_INCREMENT PRIMARY KEY,
        name VARCHAR(100) NOT NULL
    );
    
    CREATE TABLE classes (
        id INT AUTO_INCREMENT PRIMARY KEY,
        name VARCHAR(100) NOT NULL
    );
    
    CREATE TABLE vehicles (
        id INT AUTO_INCREMENT PRIMARY KEY,
        make_id INT NOT NULL,
        type_id INT NOT NULL,
        class_id INT NOT NULL,
        model VARCHAR(100) NOT NULL,
        year INT NOT NULL,
        price DECIMAL(10, 2) NOT NULL,
        FOREIGN KEY (make_id) REFERENCES makes(id),
        FOREIGN KEY (type_id) REFERENCES types(id),
        FOREIGN KEY (class_id) REFERENCES classes(id)
    );
  4. Configure database connection

    Edit config.php with your database credentials:

    $dsn = 'mysql:host=localhost;dbname=zippyusedautos';
    $username = 'your_username';
    $password = 'your_password';
  5. Install dependencies (optional, for Tailwind development)

    npm install
  6. Start your web server

    Point your web server's document root to the project directory, or use PHP's built-in server:

    php -S localhost:8000
  7. Access the application

    • Public site: http://localhost:8000
    • Admin panel: http://localhost:8000/admin

Usage

Public Interface

  1. Visit the main page to view all vehicles
  2. Use the dropdown filters to narrow your search by make, type, or class
  3. Sort vehicles by price or year using the sort dropdown

Admin Panel

  1. Navigate to /admin to access the admin dashboard
  2. Add Vehicles: Click "Add Vehicle" in the footer navigation
  3. Manage Categories: Use the footer links to manage makes, types, and classes
  4. Delete Items: Click the delete button on any item (confirmation required)

Database Schema

  • vehicles: Main vehicle inventory table
  • makes: Vehicle manufacturers (e.g., Toyota, Ford, Honda)
  • types: Vehicle types (e.g., Sedan, SUV, Truck)
  • classes: Vehicle classes (e.g., Economy, Luxury, Sport)

Security Features

  • Prepared statements (PDO) to prevent SQL injection
  • Input sanitization using htmlspecialchars()
  • Parameter binding for all database queries
  • Confirmation prompts for destructive actions

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License.

Support

For issues or questions, please open an issue on GitHub.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors