car-hub.xyz

A Modern, Production-Ready Car Marketplace Platform

Project Overview This documentation outlines the architecture, features, and setup of car-hub.xyz. A showcase of modern full-stack development using Laravel 11, React, and Enterprise-grade practices.

Introduction

Welcome to car-hub.xyz. This is a sophisticated, production-ready car marketplace platform built with modern web technologies. We demonstrate full-stack development excellence by integrating robust features, real-time capabilities, and exceptional performance optimization.

Key Highlights

πŸš€
High Performance

Optimized with Laravel Horizon queues, Redis caching, and Lighthouse CI for 95+ performance scores.

πŸ”
Real-time Search

Powered by Meilisearch for lightning-fast car searches with advanced filters and aggregations.

πŸ“±
PWA Ready

Progressive Web App with offline support and mobile-optimized experience.

πŸ’³
Payment Integration

Secure Stripe payments with webhook handling and transaction tracking.

🌍
Real-time Features

WebSocket-powered live notifications with Laravel Reverb.

πŸ“Š
Advanced Analytics

Integrated Sentry error tracking and Laravel Pulse monitoring.

Tech Stack

Laravel 11 GraphQL API React + Inertia TailwindCSS PostgreSQL Redis Meilisearch Docker GitHub Actions Stripe API

Features

Car Management

  • Full CRUD operations for car listings
  • Multi-image upload with optimization
  • Advanced search with Meilisearch integration
  • Dynamic filtering by make, model, year, price, location, etc.
  • Real-time inventory updates

User & Authentication

  • Secure session-based authentication with Laravel Fortify
  • OAuth 2.0 integration (Google, Facebook)
  • Email verification & password reset
  • Role-based access control (RBAC)
  • Admin panel via Filament

Wishlist & Favorites

  • Add/remove cars from personal watchlist
  • Real-time watchlist sync
  • Persistent favorites across devices

Architecture

Database Structure

Enterprise-grade database design with proper relationships and indexing:

  • users : User accounts with roles and permissions
  • cars : Car listings with detailed specifications
  • car_features : Dynamic car features (ABS, GPS, etc.)
  • car_images : Optimized image storage with CDN integration
  • favorite_cars : User watchlists
  • makers : Car manufacturers
  • models : Car models with relationships

API Architecture

  • REST API : Full RESTful API with Sanctum authentication
  • GraphQL : Modern GraphQL API with auto-generated documentation (Scramble)
  • Real-time : WebSocket support via Laravel Reverb

Installation & Setup

Prerequisites

  • PHP 8.2+
  • Composer
  • Node.js 18+
  • PostgreSQL/MySQL
  • Redis (optional, for queues)

Quick Start

# Clone the repository
git clone https://github.com/yourusername/car-hub.git
cd car-hub

# Install dependencies
composer install
npm install

# Setup environment
cp .env.example .env
php artisan key:generate

# Database setup
php artisan migrate --seed

# Build frontend assets
npm run build

# Start development server
php artisan serve

API & GraphQL

REST API

Full Restful API with Sanctum token authentication:

  • Comprehensive API endpoints for all resources
  • Request validation and error handling
  • Rate limiting and throttling
  • Auto-generated OpenAPI documentation

GraphQL

Modern GraphQL API for flexible data queries:

  • Type-safe queries and mutations
  • Automatic documentation generation
  • Interactive GraphQL Playground
  • Pagination and filtering support

β†’ Try the GraphQL Playground

Deployment

CI/CD Pipeline

Automated deployment with GitHub Actions:

  • Trigger: Automatic on new release creation
  • Build stage: Dependencies, assets, migrations
  • Test stage: PHPUnit & Playwright tests
  • Deploy stage: SSH deployment to production server

Production Stack

  • Docker containerization for consistency
  • Nginx reverse proxy
  • PHP-FPM application server
  • PostgreSQL production database
  • Redis for caching and queues
  • SSL/TLS with Let's Encrypt

Quality Assurance

Code Quality

  • PHPStan for static analysis (level 8)
  • PHP-CS-Fixer for code style consistency
  • ESLint for JavaScript linting
  • TypeScript for type safety

Performance Monitoring

  • Lighthouse CI: Automated performance testing (95+ scores)
  • Laravel Pulse: Real-time application monitoring
  • Sentry: Comprehensive error tracking and alerting

Testing

Comprehensive test suite covering all critical functionality:

  • Feature Tests: Car CRUD, authentication, watchlist, payments
  • End-to-End Tests: Playwright tests for critical user flows
  • Performance Tests: Load testing and optimization
  • API Tests: GraphQL and REST endpoint testing
# Run all tests
php artisan test

# Run E2E tests
npm run test:e2e

# Run with coverage
php artisan test --coverage