Skip to content

Latest commit

Β 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— LaraCars - Modern Car Listing Platform

Laravel PHP Alpine.js TailwindCSS License

LaraCars is a modern, full-featured car listing platform built with Laravel and Alpine.js. It provides a seamless experience for users to discover, list, and manage cars for sale with a beautiful, responsive interface.

✨ Features

  • πŸ” User Authentication - Secure registration and login system
  • πŸ“ Car Listings - Create, read, update, and delete car listings
  • πŸ–ΌοΈ Image Upload - Upload and manage car images with automatic storage
  • πŸ” Advanced Search - Search and filter listings by tags, title, and description
  • 🏷️ Tag System - Organize listings with custom tags
  • πŸ’° Price Management - Display and manage car prices
  • πŸ“± Responsive Design - Beautiful UI that works on all devices
  • 🎨 Modern UI - Built with TailwindCSS for a premium look
  • ⚑ Fast & Lightweight - Optimized performance with Alpine.js
  • πŸ›‘οΈ Form Validation - Comprehensive validation for all user inputs
  • πŸ‘€ User Dashboard - Manage your listings from a personal dashboard

πŸ› οΈ Technology Stack

Backend

  • Laravel 9.x - PHP framework for web artisans
  • PHP 8.0+ - Modern PHP with type safety
  • MySQL - Relational database management

Frontend

  • Alpine.js - Lightweight JavaScript framework
  • TailwindCSS 3.x - Utility-first CSS framework
  • Blade Templates - Laravel's powerful templating engine
  • Laravel Mix - Asset compilation and bundling

Additional Tools

  • Composer - PHP dependency management
  • NPM - JavaScript package management
  • Vite - Next-generation frontend tooling

πŸ“‹ Requirements

  • PHP >= 8.0.2
  • Composer
  • Node.js & NPM
  • MySQL 5.7+ or MariaDB 10.3+
  • PHP Extensions:
    • BCMath
    • Ctype
    • Fileinfo
    • JSON
    • Mbstring
    • OpenSSL
    • PDO
    • Tokenizer
    • XML
    • cURL

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/kisio/LaraCars.git
cd LaraCars

2. Install Dependencies

# Install PHP dependencies
composer install --ignore-platform-reqs

# Install JavaScript dependencies
npm install

3. Environment Configuration

# Copy the example environment file
cp .env.example .env

# Generate application key (if PHP XML extension is available)
php artisan key:generate

# If the above fails, manually set APP_KEY in .env
# Generate a key at: https://generate-random.org/laravel-key-generator

4. Configure Database

Edit .env and set your database credentials:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laracars
DB_USERNAME=your_username
DB_PASSWORD=your_password

Create the database:

mysql -u your_username -p
CREATE DATABASE laracars;
exit;

5. Run Migrations

php artisan migrate

6. Create Storage Link

php artisan storage:link

7. Compile Assets

# For development
npm run dev

# For production
npm run production

8. Start the Development Server

php artisan serve

The application will be available at: http://localhost:8000

πŸ§ͺ Testing

Run Tests

# Run all tests
./vendor/bin/phpunit

# Run specific test suite
./vendor/bin/phpunit --testsuite Feature
./vendor/bin/phpunit --testsuite Unit

# Run with coverage
./vendor/bin/phpunit --coverage-html coverage

Test the Application

  1. Homepage: http://localhost:8000 - Browse all car listings
  2. Register: http://localhost:8000/register - Create a new account
  3. Login: http://localhost:8000/login - Sign in to your account
  4. Create Listing: http://localhost:8000/listings/create - Add a new car (requires authentication)
  5. Manage Listings: http://localhost:8000/listings/manage - View and edit your listings

πŸ“– Usage Guide

For Buyers

  1. Browse Listings - Visit the homepage to see all available cars
  2. Search - Use the search bar to find specific cars by keywords
  3. Filter by Tags - Click on tags to filter listings by category
  4. View Details - Click on any listing to see full details and contact information

For Sellers

  1. Register/Login - Create an account or sign in
  2. Create Listing:
    • Navigate to "List a Car" from your dashboard
    • Fill in car details (title, company, location, price, etc.)
    • Add tags for better discoverability
    • Upload a high-quality image
    • Submit the listing
  3. Manage Listings:
    • View all your listings from the dashboard
    • Edit listing details anytime
    • Delete listings when sold
  4. Contact Management - Buyers can reach you via the email provided in your listing

πŸ—οΈ Project Structure

LaraCars/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ Http/
β”‚   β”‚   β”œβ”€β”€ Controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ ListingController.php    # Car listing CRUD operations
β”‚   β”‚   β”‚   └── UserController.php       # Authentication & user management
β”‚   β”‚   └── Requests/
β”‚   β”‚       β”œβ”€β”€ StoreListingRequest.php  # Listing creation validation
β”‚   β”‚       β”œβ”€β”€ UpdateListingRequest.php # Listing update validation
β”‚   β”‚       └── StoreUserRequest.php     # User registration validation
β”‚   └── Models/
β”‚       β”œβ”€β”€ Listing.php                  # Listing model with search scope
β”‚       └── User.php                     # User model
β”œβ”€β”€ database/
β”‚   └── migrations/                      # Database schema migrations
β”œβ”€β”€ resources/
β”‚   └── views/                           # Blade templates
β”œβ”€β”€ routes/
β”‚   └── web.php                          # Application routes
β”œβ”€β”€ public/                              # Public assets
β”œβ”€β”€ storage/                             # File storage
└── tests/                               # Test suites

πŸ”§ Configuration

File Upload Settings

Maximum image size: 2MB
Allowed formats: JPEG, PNG, JPG, GIF, SVG

To change these settings, edit app/Http/Requests/StoreListingRequest.php:

'image' => 'nullable|image|max:2048', // Change max size (in KB)

Pagination

Default listings per page: 4

To change, edit app/Http/Controllers/ListingController.php:

'listings' => Listing::latest()->filter(request(['tag', 'search']))->paginate(4)

🌐 Deployment

Production Checklist

  • Set APP_ENV=production in .env
  • Set APP_DEBUG=false in .env
  • Configure production database credentials
  • Set up proper mail configuration
  • Run composer install --optimize-autoloader --no-dev
  • Run npm run production
  • Run php artisan config:cache
  • Run php artisan route:cache
  • Run php artisan view:cache
  • Set up SSL certificate (HTTPS)
  • Configure proper file permissions
  • Set up automated backups

Deployment Platforms

This application can be deployed to:

  • Laravel Forge - Recommended for Laravel apps
  • DigitalOcean - App Platform or Droplet
  • AWS - EC2, Elastic Beanstalk, or Lightsail
  • Heroku - With ClearDB MySQL addon
  • Shared Hosting - Any host supporting PHP 8.0+

🀝 Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the Repository - Create your own fork of the project
  2. Create a Feature Branch - git checkout -b feature/AmazingFeature
  3. Follow PSR-12 - Adhere to PHP coding standards
  4. Write Tests - Add tests for new features
  5. Commit Changes - git commit -m 'Add some AmazingFeature'
  6. Push to Branch - git push origin feature/AmazingFeature
  7. Open Pull Request - Submit a PR with a clear description

Code Style

This project follows PSR-12 coding standards. Run the following before committing:

# Format code (if you have PHP CS Fixer installed)
./vendor/bin/php-cs-fixer fix

πŸ› Bug Reports

If you discover a bug, please create an issue on GitHub with:

  • Clear bug description
  • Steps to reproduce
  • Expected vs actual behavior
  • Screenshots (if applicable)
  • Environment details (PHP version, OS, etc.)

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Kisio

πŸ™ Acknowledgments

πŸ“ž Support

For support and questions:

πŸ—ΊοΈ Roadmap

Future enhancements planned:

  • Advanced filtering (price range, location, etc.)
  • User ratings and reviews
  • Favorite/wishlist functionality
  • Email notifications for new listings
  • Admin dashboard
  • API endpoints for mobile apps
  • Multi-language support
  • Social media integration
  • Car comparison feature
  • Payment integration for premium listings

Made with ❀️ using Laravel and Alpine.js

Live Demo: Coming soon!
Documentation: Wiki
Issues: GitHub Issues

About

Laravel Car Listing

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages