Project structure
Where things live in the Sellora codebase - for developers customising the script.
Sellora is a standard Laravel 13 application (PHP 8.3+) with Blade views, Alpine.js in the admin, vanilla JavaScript in the storefront and Tailwind CSS 4 for styling. You do not need any of this to run a store; this chapter is for developers who customise it.
Customisations and updates
Files you edit inside the application are overwritten when you install an update (see Updating Sellora). Keep a list or a Git repository of your changes. For small CSS/JS tweaks use Admin > Appearance > Custom code, which lives in the database.
Folder map#
| Path | Contents |
|---|---|
app/Models |
Eloquent models (products, orders, settings, etc.). |
app/Enums |
Order, payment, ticket, coupon, attribute and option enums, each with labels and colours. |
app/Services |
Business logic: Cart, Checkout, Orders, Catalog, Coupons, Tax, Stock, Settings, Seo, Reports, Import/Export, Install, Media, Currency, Sms, Appearance and more. |
app/Payments |
The payment manager and one class per gateway. |
app/Shipping |
The shipping manager and calculation methods. |
app/Ai |
AI manager, providers (Providers/) and tools (Tools/). |
app/Themes |
Section classes (Sections/), the section registry and preset helpers (Presets/). |
app/Http/Controllers |
Admin/*, Front/*, Account/*, Auth/*, Api/V1/*, Install/*, Payment/*. |
config/ |
sellora.php (identity, requirements, limits, fonts), payments.php, shipping.php, ai.php, themes.php, admin-menu.php. |
routes/ |
web.php, api.php, admin.php plus admin/*.php, front/*.php, install.php, payment.php, console.php (the scheduler). |
resources/views |
layouts/, front/, admin/, account/, auth/, install/, emails/, pdf/, components/. |
lang/ |
Translation files: en.json, and en/*.php groups. |
database/ |
Migrations, seeders (Demo/ presets), factories, and data/ with demo content and tax presets. |
public/assets |
CSS, JavaScript (js/sellora/ storefront scripts and presets/), fonts, images. |
public/uploads |
Uploaded media (when storage symlinks are unavailable) or the public storage link target. |
public/assets/build |
Generated by npm run build: minified CSS/JS, per-preset storefront stylesheets, manifest.json, .br/.gz siblings. See Front-end assets build. |
scripts/ |
The asset build: build.mjs (runs every step), build-css.mjs, build-js.mjs, build-images.mjs, build-rtl.mjs, build-manifest.mjs, precompress.mjs. |
Key concepts#
- Settings are stored in the database and read with
setting('group.key'); secrets are encrypted. The admin settings pages are generated fromApp\Services\Settings\SettingsSchema. - Translatable content uses
spatie/laravel-translatable; fallbacks use the default language. - Permissions use
spatie/laravel-permission. Admin routes checkadmin:permission middleware; the admin menu lives inconfig/admin-menu.php. - Theming is driven by
config/themes.phppresets plus per-store overrides in settings - see Theme presets and CSS. - Money: amounts are stored in the base currency (decimal strings); use
Order::formatMoney()and themoney()helper for display. - Caching: cache raw arrays, not Eloquent models, because of Laravel's
cache.serializable_classesdefault. - Scheduler:
routes/console.phpdefines the scheduled jobs (currency rates, sitemap, abandoned-cart reminders, release of unpaid orders, heartbeat).
Useful commands#
php artisan route:list --path=admin # list routes
php artisan sellora:clear # clear caches (add --thumbs to rebuild thumbnails)
php artisan sellora:install-demo tech3 --fresh # or any other preset key
php artisan sellora:update-currency-rates
php artisan migrate # apply database changes
Service worker#
The storefront layout registers public/sw.js when pwa.enabled is on and the page is in a secure context. If you change sw.js, change its VERSION constant so visitors receive the update, and test thoroughly: a service worker caches pages and can make a stale site appear after updates.