Skip to content

Architecture Overview

Bagisto is a Laravel application whose features live in 42 packages under packages/Webkul/, inside a thin application shell that registers them, holds the configuration and serves the built assets. This page maps the project so you know where to look. Backend Architecture and Frontend Architecture go one level deeper.

Technology Stack

Bagisto 2.5
PHP8.4
FrameworkLaravel 13
Modules and modelskonekt/concord 1.18
Data accessprettus/l5-repository 4, through Webkul\Core\Eloquent\Repository
Front endVue.js 3.5, Tailwind CSS 4, Vite 6
TestsPest 5 and Playwright
DatabasesMySQL 8.0, MariaDB 10.11, PostgreSQL 16

Bagisto 2.4 runs on PHP 8.3 or 8.4 with Laravel 12, Tailwind CSS 3 and Pest 3, and supports MySQL and MariaDB only. Database Compatibility explains the db_grammar() helper that keeps package code portable across the three databases.

Both the admin (the Admin package) and the storefront (the Shop package, skinned by themes) are Blade pages with Vue components mounted inside them. There is no separate single-page application to build.

Project Structure

text
my-bagisto-store/
├── app/                    # Thin shell: AppServiceProvider and the EncryptCookies middleware
├── bootstrap/
│   ├── app.php             # Global middleware, CSRF exclusions, trusted proxies, the /up health route
│   └── providers.php       # Every service provider, including one for each Bagisto package
├── config/
│   ├── concord.php         # Concord modules: the packages that register models
│   ├── themes.php          # Storefront and admin themes, their view paths and Vite builds
│   ├── bagisto-vite.php    # Vite builds looked up by namespace: admin, shop, installer
│   └── ...                 # Laravel's config files, plus elasticsearch, images, imagecache, purify, responsecache
├── database/               # Laravel's own tables; DatabaseSeeder calls the Installer package's seeder
├── lang/                   # Laravel's translations (auth, pagination, passwords, validation) in 22 locales
├── packages/Webkul/        # The 42 Bagisto packages
├── public/
│   ├── index.php
│   └── themes/             # Built Vite bundles for admin, shop and installer
├── resources/
│   ├── themes/             # Views of storefront themes you publish or create
│   └── ...                 # Laravel skeleton css and js, built only by the root vite.config.js
├── routes/                 # web.php is empty; console.php holds Laravel's inspire command
├── storage/                # Logs, caches, uploads in app/public, and the installed marker
├── tests/                  # Pest.php, shared datasets and cross-package unit tests
├── composer.json           # Maps each Webkul\<Name>\ namespace to packages/Webkul/<Name>/src
├── phpunit.xml             # One test suite for each package that has tests
└── vite.config.js          # Laravel skeleton build; Bagisto's pages don't use it

Routes, migrations, views and translations all come from the packages, which is why routes/, database/ and resources/ in the application root hold so little.

Inside a Package

WhatWhere
Service providerpackages/Webkul/<Name>/src/Providers/<Name>ServiceProvider.php
Concord module providerpackages/Webkul/<Name>/src/Providers/ModuleServiceProvider.php
Contracts, models and proxiessrc/Contracts/, src/Models/
Repositoriessrc/Repositories/
Migrations, seeders and factoriessrc/Database/
Routes, controllers, middleware and form requestssrc/Routes/ (in Paypal and SocialLogin, src/Http/routes.php), src/Http/Controllers/, src/Http/Middleware/, src/Http/Requests/
Event listenerssrc/Listeners/, usually mapped in src/Providers/EventServiceProvider.php
Jobs and Artisan commandssrc/Jobs/, src/Console/Commands/
Admin listingssrc/DataGrids/
Config merged into the applicationsrc/Config/
Blade viewssrc/Resources/views/, loaded under a namespace such as shop:: or admin::
Translationssrc/Resources/lang/<locale>/app.php, in all 22 locales
Front-end sourcessrc/Resources/assets/, in Admin, Shop and Installer
Pest teststests/ at the package root, registered as a suite in phpunit.xml
Playwright end-to-end teststests/e2e-pw/ in Admin, Shop and Installer

Most packages carry only some of these directories; only Providers/ is in every one.

How a Package Is Wired In

A package is loaded because three files name it:

  1. composer.json maps Webkul\<Name>\ to packages/Webkul/<Name>/src under autoload.psr-4.
  2. bootstrap/providers.php lists the package's service provider, which loads its routes, views, translations and migrations and merges its config.
  3. config/concord.php lists its ModuleServiceProvider, which registers the package's models with Concord. A new package needs one only when it has models. In core, 35 packages are listed, 10 of them with an empty model list.

php artisan concord:modules and php artisan concord:models show what Concord has loaded. Package Development walks through creating and registering your own package.

Extension Points at a Glance

You want toRead
Add a feature with its own tables, admin pages and routesPackage Development
Add an admin listingDataGrid
Change how the storefront or admin looksTheme Development
Add a carrier, a gateway or a product typeShipping, payment, product type development
React to something the core doesEvent Listeners
Add markup to a core page without overriding its viewView Render Events
Replace or extend a core modelExtending a Core Model
Change what a core controller, repository, DataGrid or listener doesBind a subclass in the container: Controllers, Repositories, DataGrid, Event Listeners
Change the class behind a core payment method, carrier, product type or importerPoint its class or importer key at your subclass from boot(): Understanding Carrier Configuration, Understanding Payment Configuration, Understanding Product Type Configuration, Understanding Data Transfer
Talk to the store from outsideREST and GraphQL APIs, WebMCP

Each of these works without editing packages/Webkul/ or vendor/. Changes made there are overwritten when you update Bagisto.

Next Step

Package Development builds your first package. For more of the map first, read Backend Architecture (the request flow and all 42 packages) and Frontend Architecture (Blade, Vue.js and Vite).

Released under the MIT License.