Skip to content

pshadoyan/openautocenter

Repository files navigation

πŸš— Open Auto Center Platform

A comprehensive marketplace connecting vehicle owners with service providers for repairs, towing, and customization services. Built with modern technologies including FastAPI, Next.js, PostgreSQL, and Celery.

License Python Next.js Docker

πŸ“‹ Table of Contents

✨ Features

For Vehicle Owners

  • πŸš— Submit repair, towing, or customization jobs
  • πŸ“Έ AI-powered photo analysis for damage assessment
  • πŸ’° Compare competitive bids side-by-side
  • πŸ—ΊοΈ Interactive maps for towing services with cost overlays
  • πŸ“„ Secure invoice management with LaTeX generation
  • πŸ’¬ Real-time notifications and chat support
  • ⭐ Rate and review completed services

For Service Providers

  • 🏒 Business profile management with coverage areas
  • πŸ’Ό Competitive bidding on jobs in your area
  • πŸ“Š Dashboard for active bids and won jobs
  • 🧾 LLM-powered invoice creation with chat interface
  • πŸ’΅ Per-mile and per-hour pricing for towing
  • πŸ“ˆ Performance metrics and review tracking
  • πŸ”” Real-time job notifications

For Administrators

  • πŸ‘₯ User and provider verification
  • πŸ“Š Analytics and reporting dashboard
  • πŸ›‘οΈ Content moderation tools
  • πŸ’³ Commission management
  • 🎨 Platform branding customization
  • πŸ“ Configurable LaTeX invoice templates

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Next.js UI    │────▢│  FastAPI Backend │────▢│  PostgreSQL DB  β”‚
β”‚   (Frontend)    β”‚     β”‚     (API)       β”‚     β”‚   with PostGIS  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚     Celery      β”‚
                        β”‚  (Task Queue)   β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β–Ό                      β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚    Redis    β”‚       β”‚   Flower    β”‚
             β”‚   (Broker)  β”‚       β”‚ (Monitoring)β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Backend

  • FastAPI (v0.115.0) - High-performance Python web framework
  • SQLAlchemy (v2.0) - SQL toolkit and ORM
  • Celery (v5.4.0) - Distributed task queue
  • Redis - Message broker and cache
  • PostgreSQL with PostGIS - Primary database
  • JWT - Authentication and authorization
  • Flower - Celery monitoring

Frontend

  • Next.js (v14.2.0) - React framework with SSR/SSG
  • TypeScript - Type safety
  • Tailwind CSS (v3.4.0) - Utility-first CSS
  • shadcn/ui - Modern UI components
  • React Hook Form - Form handling
  • Mapbox GL JS - Interactive maps
  • Zustand - State management

Infrastructure

  • Docker - Containerization with multi-stage builds
  • Docker Compose - Service orchestration
  • Nginx - Reverse proxy (production)
  • Prometheus & Grafana - Monitoring (optional)

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose
  • Make (for using Makefile commands)
  • Git

Installation

  1. Clone the repository
git clone https://github.com/yourusername/openautocenter.git
cd openautocenter
  1. Set up environment variables
cp .env.template .env
# Edit .env with your configuration
  1. Start the development environment
make dev
  1. Access the application

πŸ’» Development

Available Make Commands

# Development
make dev              # Start development environment
make stop            # Stop all services
make restart         # Restart all services
make clean           # Remove containers and volumes
make logs            # View service logs

# Database
make db-migrate      # Run database migrations
make db-reset        # Reset database
make db-seed         # Seed sample data
make db-backup       # Create database backup

# Testing
make test            # Run all tests
make test-backend    # Run backend tests
make test-frontend   # Run frontend tests
make lint            # Run linters
make format          # Format code

# Monitoring
make flower          # Open Celery monitoring
make monitoring      # Start Prometheus + Grafana
make health          # Check service health

Project Structure

openautocenter/
β”œβ”€β”€ backend/                 # FastAPI application
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ routers/        # API endpoints
β”‚   β”‚   β”œβ”€β”€ services/       # Business logic
β”‚   β”‚   β”œβ”€β”€ models/         # Database models
β”‚   β”‚   β”œβ”€β”€ schemas/        # Pydantic schemas
β”‚   β”‚   └── tasks/          # Celery tasks
β”‚   └── tests/              # Backend tests
β”œβ”€β”€ frontend/               # Next.js application
β”‚   β”œβ”€β”€ app/               # Pages and layouts
β”‚   β”œβ”€β”€ components/        # React components
β”‚   └── lib/              # Utilities
β”œβ”€β”€ docker/                # Docker configurations
β”œβ”€β”€ database/             # Database schemas
└── docs/                # Documentation

πŸ“š API Documentation

Interactive Documentation

Key Endpoints

Authentication

  • POST /api/v1/auth/register - Register new user
  • POST /api/v1/auth/login - Login user
  • POST /api/v1/auth/refresh - Refresh token

Jobs

  • POST /api/v1/jobs - Create new job
  • GET /api/v1/jobs - List jobs
  • GET /api/v1/jobs/{id} - Get job details
  • POST /api/v1/jobs/{id}/select-bid/{bid_id} - Select winning bid

Bids

  • POST /api/v1/bids - Submit bid
  • GET /api/v1/bids?job_id={id} - List bids for job
  • PUT /api/v1/bids/{id} - Update bid

Invoices

  • POST /api/v1/invoices - Create invoice
  • GET /api/v1/invoices/{id} - Get invoice
  • POST /api/v1/invoices/{id}/chat - LLM chat for invoice editing
  • GET /api/v1/invoices/{id}/pdf - Download PDF

Maps

  • GET /api/v1/maps/providers - Get providers for map
  • POST /api/v1/maps/trip-details - Submit trip details
  • GET /api/v1/maps/costs - Get route costs

πŸ§ͺ Testing

Running Tests

# All tests
make test

# Backend tests with coverage
make test-backend

# Frontend tests
make test-frontend

# Integration tests
make test-integration

Test Coverage

  • Backend: Unit tests for services, integration tests for API
  • Frontend: Component tests, E2E tests with Cypress
  • Load testing: Using Locust for performance validation

πŸ“¦ Deployment

Production Deployment

  1. Configure environment
cp .env.template .env.production
# Set production values
  1. Build and deploy
make deploy

Docker Images

  • Multi-stage builds for optimized image sizes
  • Separate images for backend, frontend, and Celery workers
  • Health checks configured for all services

Scaling

# Scale specific service
make scale service=celery-worker-high replicas=3

πŸ“Š Monitoring

Flower (Celery Monitoring)

Access at http://localhost:5555

  • Real-time task monitoring
  • Worker status and performance
  • Task history and results

Prometheus + Grafana (Optional)

make monitoring

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

πŸ“„ License

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

πŸ™ Acknowledgments

πŸ“ž Support

For support, please open an issue in the GitHub repository or contact the development team.


Built with ❀️ for the automotive service industry

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published