Architecture Overview

Understanding Auto Commerce's modular, plugin-based architecture.

Design Philosophy

Auto Commerce follows a plugin-based design similar to WordPress plugins. The core system is minimal and extensible, with all integrations implemented as self-contained modules.

  • Tenants enable only the modules they need
  • Modules can be installed/uninstalled without affecting core
  • Event-driven communication between core and modules
  • New integrations added without touching core code

Tech Stack

Backend

  • Laravel 11 + PHP 8.3
  • PostgreSQL (database-per-tenant)
  • Redis + Laravel Horizon
  • Laravel Reverb (WebSockets)

Frontend

  • Next.js 14 (App Router)
  • TypeScript
  • Tailwind CSS
  • React Query

Key Packages

  • stancl/tenancy (multi-tenancy)
  • nwidart/laravel-modules
  • spatie/permission (RBAC)
  • Laravel Passport (OAuth)

Infrastructure

  • Docker (Laravel Sail)
  • Scramble (API Docs)
  • Pest (Testing)
  • Laravel Pint (Code Style)

Module Types

Type Available Modules Contract
Store Shopify, WooCommerce, Manual StoreProviderContract
Shipping Delhivery, Shiprocket, BlueDart ShippingProviderContract
Channel WhatsApp, SMS, Email, Voice ChannelProviderContract
Payment Razorpay, Cashfree, PayU PaymentProviderContract
AI OpenAI, Claude, Custom AIProviderContract

Directory Structure

autocom/
├── backend/                    # Laravel API
│   ├── app/
│   │   ├── Models/
│   │   ├── Http/Controllers/
│   │   └── Providers/
│   ├── config/
│   ├── database/migrations/
│   └── routes/
│
├── frontend/                   # Next.js App
│   ├── app/
│   ├── components/
│   └── lib/
│
├── docs/                       # Documentation (this site)
│
└── modules/                    # Plugin Modules
    ├── Core/                   # Shared models & contracts
    │   └── backend/
    ├── Products/
    │   ├── backend/            # Laravel code
    │   └── frontend/           # React code
    ├── Customers/
    ├── Orders/
    ├── StoreShopify/
    ├── ShippingDelhivery/
    └── ChannelWhatsApp/

Data Flow

Orders flow from store integrations → core processing → shipping → customer notifications:

Store ModuleCore OrderShipping ModuleChannel Module

Multi-Tenancy

Auto Commerce uses database-per-tenant isolation for complete data separation:

  • Landlord Database: Stores tenant records, billing, available modules
  • Tenant Databases: Each tenant gets their own PostgreSQL database
  • Identification: Via subdomain (acme.autocom.com) or X-Tenant header