Skip to content
mehedijamanPublic

About

A modern, open-source ecommerce platform built with Laravel, Vue 3, Inertia.js, and Tailwind CSS.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

378 Commits

Folders and files

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

Repository files navigation

ShopNow

A Premium, Modular E-Commerce Platform & CMS

Laravel PHP Vue Inertia.js Tailwind CSS License


🌟 Overview

ShopNow is a premium, full-featured modular e-commerce platform and Content Management System (CMS) designed for modern retail. Built on a robust Laravel 13 backend and a reactive Vue 3 frontend, it features a dual-frontend architecture: a highly interactive Single Page Application (SPA) admin dashboard powered by Inertia.js v3, paired with a lightning-fast, SEO-optimized public storefront powered by server-rendered Blade templates and reactive Vue 3 Islands.


πŸ—οΈ Architectural Blueprint

The application is built around a Modular MVC pattern with a lightweight Service Layer to isolate business operations into testable, reusable units.

Modular Boundaries

Instead of cluttering the default app/ directory, all core domains are encapsulated inside self-contained modules under the modules/ folder. Each module encapsulates its own routes, models, controllers, services, form requests, views, migrations, seeders, and Pest feature tests.

graph TD
    subgraph "Public Front-End (Blade + Vue Islands)"
        Storefront[Blade Templates]
        Islands[Vue 3 Components]
        CartStore[localStorage Cart Store]
        Storefront --> Islands
        Islands --> CartStore
    end

    subgraph "Admin Front-End (Inertia SPA)"
        Inertia[Inertia.js v3]
        VueSPA[Vue 3 SPA]
        Inertia --> VueSPA
    end

    subgraph "Laravel Core Backend"
        Routes[Routes]
        Middleware[Middleware]
        Controllers[Controllers]
        Services[Service Layer]
        Models[Eloquent Models]

        Routes --> Middleware
        Middleware --> Controllers
        Controllers --> Services
        Services --> Models
    end

    Storefront --> Routes
    Inertia --> Routes
Loading

⚑ Key Features

  • Modular Domain Design β€” Feature modules for Acl, Product, Cart, Order, Blog, Settings, Profile, Slider, and more.
  • Dual-Frontend Strategy β€” A fully-interactive admin panel using Inertia + Vue SPA, alongside an SEO-friendly public storefront using Blade and Vue 3 islands.
  • Spatie Integration β€” Advanced media uploads and conversions via Spatie Media Library, granular roles/permissions via Spatie Permission, and automated audit trails via Spatie Activitylog.
  • Granular ACL System β€” Permission-gated routes and UI actions with support for direct user permissions and role-based policies.
  • Meta Conversions API β€” Built-in server-side Facebook Pixel and Conversions API integration to track user signups, leads, pageviews, and purchases with SHA-256 hashed PII data.
  • Robust Geocoding & Addresses β€” Integrated with Bangladesh geocoding (Division, District, Upazila, Union) supporting saved customer addresses and default selectors, with division auto-derivation on district changes.
  • SEO & Caching Ready β€” Dynamic schema generator (JSON-LD), auto-meta tags for posts/products, automated XML sitemaps, and database settings cached for 24 hours.

πŸ› οΈ Technology Stack

Layer Technologies
Runtime PHP 8.4.23+, Node.js 20+
Framework Laravel 13.16.1
Admin Frontend Vue 3.4.21, Inertia.js v3 (client v2.3), Pinia, Flowbite, Remix Icon
Public Storefront Laravel Blade, Vue 3 Islands, Tailwind CSS v4.2.4
Database SQLite (default dev), MySQL / MariaDB (production-ready)
Testing Pest v4.0 (feature & unit suites)
Code Style Laravel Pint (PSR-12), ESLint v9, Prettier v3

πŸ“‚ Repository Directory Layout

shopnow/
β”œβ”€β”€ app/                        # Application bootstrap & shared middleware
β”œβ”€β”€ bootstrap/                  # Route & middleware configuration (app.php)
β”œβ”€β”€ config/                     # Application & package settings
β”œβ”€β”€ database/                   # Seeders & global migrations
β”œβ”€β”€ modules/                    # Self-contained domain modules
β”‚   β”œβ”€β”€ Acl/                    # Roles & permissions management
β”‚   β”œβ”€β”€ AdminAuth/              # Admin login & password reset
β”‚   β”œβ”€β”€ Blog/                   # Blog posts, categories, tags, and authors
β”‚   β”œβ”€β”€ Cart/                   # Client-side shopping cart endpoints
β”‚   β”œβ”€β”€ ContactMessage/         # Contact forms & submissions
β”‚   β”œβ”€β”€ Customer/               # Customer CRUD, addresses, & report generator
β”‚   β”œβ”€β”€ CustomerAuth/           # Customer login, signup, & address management
β”‚   β”œβ”€β”€ Dashboard/              # Admin analytics & KPI charts
β”‚   β”œβ”€β”€ Index/                  # Home, sitemap, robots.txt & static page controllers
β”‚   β”œβ”€β”€ Order/                  # Order processing, status updates & invoicing
β”‚   β”œβ”€β”€ Page/                   # CMS system pages (About, Terms, Privacy)
β”‚   β”œβ”€β”€ Product/                # Products, categories, brands & attribute variants
β”‚   β”œβ”€β”€ Profile/                # Current user profile manager
β”‚   β”œβ”€β”€ Settings/               # Site-wide settings (SMTP, SEO, Pixels, Branding)
β”‚   β”œβ”€β”€ Slider/                 # Homepage hero banners
β”‚   β”œβ”€β”€ Support/                # Base controllers, models, and shared traits
β”‚   └── User/                   # Admin user manager
β”œβ”€β”€ resources/                  # Admin single page application source (Inertia + Vue)
β”œβ”€β”€ resources-site/             # Customer-facing storefront assets & views (Blade + CSS + Vue)
β”œβ”€β”€ routes/                     # Fallback & local console routes
β”œβ”€β”€ tests/                      # Global test bootstrap & TestCase
└── vite.config.js              # Vite compiler configuration

πŸš€ Getting Started

Prerequisites

  • PHP 8.4 or higher
  • Composer
  • Node.js 20+ & npm
  • MySQL / MariaDB or SQLite database

Installation & Setup

  1. Clone the Repository

    git clone https://github.com/your-username/shopnow.git
    cd shopnow
  2. Install Composer & NPM Dependencies

    composer install
    npm ci
  3. Configure Environment

    cp .env.example .env
    php artisan key:generate

    Edit .env and specify your database credentials (DB_DATABASE, DB_USERNAME, etc.).

  4. Run Migrations & Database Seeding

    php artisan migrate --seed
  5. Build Assets & Launch Development Server

    # Compiles and serves assets via Vite + runs artisan dev servers concurrently
    composer run dev

⏰ Cron Job Setup Guide (cPanel / Shared Hosting)

ShopNow utilizes Laravel's task scheduler and queue system to handle asynchronous tasks such as sending customer order confirmation emails, administrative notifications, processing Meta Conversions API events, and periodic background maintenance.

To ensure these tasks run automatically on cPanel or shared hosting, configure a server Cron Job to execute Laravel's schedule:run command every minute.

1. Access Cron Jobs in cPanel

  1. Log in to your cPanel Dashboard.
  2. Navigate to the Advanced section and click on Cron Jobs.

2. Add New Cron Job

  1. Under Common Settings, select Once Per Minute (* * * * *).
  2. In the Command field, enter the following command (adjust paths for your server):
/usr/local/bin/php /home/your_username/public_html/artisan schedule:run >> /dev/null 2>&1

πŸ’‘ Note: Replace /home/your_username/public_html with your actual project root path where the artisan file is located.

3. PHP Binary Path Variations

Depending on your hosting provider and PHP version, use the specific PHP 8.4 binary path:

  • cPanel EasyApache (ea-php):
    /opt/cpanel/ea-php84/root/usr/bin/php /home/your_username/public_html/artisan schedule:run >> /dev/null 2>&1
  • CloudLinux PHP Selector (alt-php):
    /opt/alt/php84/usr/bin/php /home/your_username/public_html/artisan schedule:run >> /dev/null 2>&1
  • Custom/Standard Path: Find your exact PHP path by running which php in the cPanel Terminal.

4. Optional Queue Worker Cron (for Database Queue Driver)

If your .env has QUEUE_CONNECTION=database and you want background jobs (like emails) to process automatically on shared hosting without a persistent daemon, add a second cron job running every minute:

/usr/local/bin/php /home/your_username/public_html/artisan queue:work --stop-when-empty >> /dev/null 2>&1

πŸ§ͺ Testing & Code Quality

ShopNow enforces high coding standards with integrated linting and automated tests:

# Run all Pest feature and unit tests
php artisan test --compact

# Auto-format PHP code according to PSR-12 conventions
vendor/bin/pint

# Run frontend ESLint and Prettier formatting checks
npm run lint

πŸ“„ License

ShopNow is open-source software licensed under the MIT license.

About

A modern, open-source ecommerce platform built with Laravel, Vue 3, Inertia.js, and Tailwind CSS.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages