Introduction

OneMart Admin & Web is the back-office management panel and customer-facing storefront for the DayOneMart single-vendor e-commerce platform. Built on Laravel 12 with a Vue 3 / Inertia.js frontend, it ships as a single deployable application that serves three distinct surfaces:

Technology Stack

LayerTechnologyVersion
Backend FrameworkLaravel^12.0
PHP RuntimePHP^8.2
Frontend FrameworkVue 3 + Inertia.js^3.5 / ^2.1
Build ToolVite^7.0
CSS FrameworkTailwind CSS^4.0
UI ComponentsShadcn Vue / Reka UI^2.2 / ^2.6
AuthenticationJWT (tymon/jwt-auth)^2.2
2FAGoogle TOTP (pragmarx/google2fa)^9.0
Real-timeFirebase Cloud Messaging (Push Notifications)^10.14
PerformanceLaravel Octane (Swoole)^2.12
StorageAWS S3 / Localβ€”
PaymentsStripe + multiple gateways^17.6
ChartsChart.js + ApexChartsβ€”
MapsGoogle Maps JS APIβ€”
Rich TextTiptap v3β€”
i18ni18next + i18next-vueβ€”
FirebaseFirebase JS SDK^10.14

Project Folder Structure

/app
β”œβ”€β”€ Console/
β”œβ”€β”€ Enums/
β”œβ”€β”€ Events/
β”œβ”€β”€ Http/
β”‚   β”œβ”€β”€ Controllers/
β”‚   β”‚   β”œβ”€β”€ Api/              ← REST API v1 controllers
β”‚   β”‚   β”œβ”€β”€ Payment/          ← Stripe, PayPal, Razorpay, etc.
β”‚   β”‚   β”œβ”€β”€ Web/              ← Inertia page controllers
β”‚   β”‚   β”œβ”€β”€ InstallerController.php
β”‚   β”‚   └── UpdaterController.php
β”‚   β”œβ”€β”€ Middleware/
β”‚   β”œβ”€β”€ Requests/
β”‚   └── Resources/
β”œβ”€β”€ Jobs/
β”œβ”€β”€ Mail/
β”œβ”€β”€ Models/
β”œβ”€β”€ Services/
└── Utils/
    β”œβ”€β”€ constants.php
    β”œβ”€β”€ formatter.php
    └── translation.php

/resources/js
β”œβ”€β”€ AdminPanel/               ← Admin Vue application
β”‚   β”œβ”€β”€ Layouts/
β”‚   β”œβ”€β”€ Pages/
β”‚   β”‚   β”œβ”€β”€ Analytics/
β”‚   β”‚   β”œβ”€β”€ Authentication/
β”‚   β”‚   β”œβ”€β”€ Dashboard/
β”‚   β”‚   β”œβ”€β”€ Food/
β”‚   β”‚   β”œβ”€β”€ Orders/
β”‚   β”‚   β”œβ”€β”€ Promotion/
β”‚   β”‚   β”œβ”€β”€ Reports/
β”‚   β”‚   β”œβ”€β”€ Settings/
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ composables/
β”‚   └── locales/
└── StoreFront/               ← Customer web Vue application
    β”œβ”€β”€ Layouts/
    β”œβ”€β”€ Pages/
    β”‚   β”œβ”€β”€ Homepage/
    β”‚   β”œβ”€β”€ Menu/
    β”‚   β”œβ”€β”€ Checkout/
    β”‚   β”œβ”€β”€ Profile/
    β”‚   └── ...
    β”œβ”€β”€ components/
    └── composables/

/routes
β”œβ”€β”€ api/v1/
β”‚   β”œβ”€β”€ admin.php
β”‚   β”œβ”€β”€ customer.php
β”‚   └── deliveryman.php
β”œβ”€β”€ web/
β”‚   β”œβ”€β”€ admin.php
β”‚   β”œβ”€β”€ storefront.php
β”‚   β”œβ”€β”€ installer.php
β”‚   └── updater.php
└── payment.php

/lang          ← en, bn, hi, ar, es translations
/public        ← Document root β€” point domain here

System Features

Dashboard & Analytics

Admin Panel Dashboard β€” business analytics KPI cards, order status overview, sales trend, and order type breakdown 1 2 3 4

Key areas of this screen

  1. Business Analytics KPI cards β€” live totals for sales, orders, average order value, customers, employees, deliverymen, active promotions, and wallet flow.
  2. Order Status Overview β€” a breakdown of orders by stage: Pending, Confirmed, Ready to Handover, Out for Delivery, Delivered, Failed, Cancelled, and Refunded.
  3. Sales Trend β€” revenue over the selected period versus the previous period.
  4. Order Type Breakdown β€” the mix of order types shown as a donut chart.
Admin Panel β†’ Dashboard. The landing screen after login gives an at-a-glance view of business health. Numbered markers highlight the four key areas.

Order Management

Admin Panel Order Management β€” order list with status filters, search, order-status dropdowns, and per-order actions 1 2 3 4

Key areas of this screen

  1. Status filters (left menu) β€” jump to All Orders, Pending, Confirmed, Ready to Handover, On the Way, Delivered, Cancelled, Refunded, and Refund Requests, each with a live count.
  2. Search bar β€” find an order by ID or any related keyword.
  3. Order Status column β€” update each order's stage inline via the dropdown (or the Confirm button on new orders).
  4. Action buttons β€” view the order detail (eye icon) or download the invoice.
Admin Panel β†’ Orders. Central hub for the full order lifecycle β€” filter, search, update status, and open any order. Numbered markers highlight the four key areas.

Product & Menu Management

Admin Panel Item List β€” products with image, name, category, price, stock, status toggle, and row actions 1 2 3 4

Key areas of this screen

  1. Item info β€” the product thumbnail, name, and ID. Use Create New (top right) to add a product with images, pricing, variations, and add-ons.
  2. Category β€” the category and sub-category each item belongs to.
  3. Price β€” the selling price per item.
  4. Stock & Status β€” inventory level and the availability toggle; row actions (view / edit / more) sit on the far right.
Admin Panel β†’ Item List. The catalog manager across Grocery, Pharmacy, and Shop modules. Numbered markers highlight the four key columns.

Marketing & Promotions

Admin Panel Coupon List β€” coupon name and code, coupon info, validity, status toggle, and actions 1 2 3 4

Key areas of this screen

  1. Coupon name & code β€” the display name and the code customers enter at checkout.
  2. Coupon info β€” discount type (Discount on Order, Free Shipping, Free Item, First Order), amount, and the modules it applies to.
  3. Validity β€” how long the coupon is active (Unlimited or a countdown of days left).
  4. Status & actions β€” enable/disable toggle plus view, edit, and delete; use Create New (top right) to add a coupon, and the Flash Sales menu for time-limited campaigns.
Admin Panel β†’ Promotions. Coupons, flash sales, loyalty points, and marketing tools live here. Numbered markers highlight the four key columns.

User Management

Website & Content

Communication

Settings & Integrations

Admin Panel Settings β€” Business Setup Basic Info form with the settings sidebar (System Modules, Delivery, Vat/Tax, 3rd Party Setup)
Admin Panel β†’ Settings β†’ Business Setup. The Settings area is where you configure business details (name, email, phone, address, time zone), plus System Modules, Delivery, Vat/Tax, email templates, and 3rd-party integrations (payment gateways, SMS, Firebase, social login) from the left-hand menu after installation.

System & Security

Installer & Updater

Prerequisites

First: Identify Your Hosting Type (VPS or Shared Hosting)

Commands and file paths in this documentation differ depending on whether your server is a VPS or shared hosting. Take 60 seconds to identify which one you have before installing β€” it determines which instructions and paths apply to you.

QuestionYou have SHARED HOSTING if…You have a VPS if…
How do you log in to manage the server? Through a browser control panel such as cPanel, Plesk, or hPanel, with a visual File Manager. Through an SSH terminal (e.g. ssh root@your-server-ip) where you type commands.
Who installed the web server (Nginx/Apache), PHP, and MySQL? Your hosting company β€” they were already there when you signed up. You (or your developer) installed and configured them yourself.
Typical providers / plans Hostinger, Namecheap, Bluehost, GoDaddy "web hosting" plans β€” usually a few dollars per month. DigitalOcean, Hetzner, Vultr, Linode, AWS EC2 "cloud server / droplet / instance" plans.
Typical file paths you will see /home/username/onemart and /home/username/public_html /var/www/onemart (web root: /var/www/onemart/public)
Root / sudo access? No β€” you cannot run sudo, install system packages, or edit Nginx configs. Yes β€” full control of the operating system.
πŸ€”
Still not sure? Ask your hosting provider one question: "Do I have root SSH access to my own server?" If the answer is yes, you have a VPS β€” follow the Server Configuration and Deployment sections. If the answer is no, you have shared hosting β€” follow the cPanel / Shared Hosting guide instead.

Throughout this documentation, path examples are labeled accordingly: paths beginning with /var/www/… are for a VPS, and paths beginning with /home/username/… are for shared hosting. Substitute your own username, domain, or folder name where they appear.

Server Requirements

RequirementMinimumRecommended
PHP8.28.3+
MySQL / MariaDB8.0 / 10.48.0+ / 10.6+
Web ServerNginx / ApacheNginx + Octane
RAM1 GB2 GB+
Disk Space500 MB2 GB+
Node.js1820+ LTS
Composer2.xLatest

Required PHP Extensions

The installer wizard automatically verifies all of these on the first step:

The installer also checks that Composer, Node.js, file_get_contents(), and symlink() are available.

ℹ️
Octane (Swoole) is optional. The application runs perfectly fine with standard PHP-FPM. Swoole is recommended for high-traffic production environments to significantly improve throughput and response times.

External Services (Recommended)

Quick Start

πŸ“
Path conventions β€” VPS vs shared hosting. File paths differ between the two environments, and every path example in this guide is labeled accordingly:
  • VPS / dedicated server β€” the project lives in a folder you choose, written as /path/to/your-project (commonly /var/www/onemart).
  • Shared hosting (cPanel) β€” the project lives inside your home directory, written as /home/username/your-project, where username is your cPanel username.
Substitute the real path for your environment wherever an example path appears. Not sure which environment you have? See First: Identify Your Hosting Type in the Prerequisites, or the plain-language glossary. Shared-hosting buyers should follow the dedicated cPanel / Shared Hosting walkthrough instead of the VPS steps.

Pre-flight Checklist

5-Step Quick Install

  1. Extract the archive Extract the downloaded ZIP to your server's web directory β€” VPS: e.g. /var/www/onemart (written as /path/to/your-project below); shared hosting: e.g. /home/username/your-project (see the cPanel walkthrough). Point your Nginx/Apache document root to the /public folder.
  2. Set permissions
    # VPS (Ubuntu/Debian) β€” www-data is the web server user:
    chmod -R 775 storage bootstrap/cache
    chown -R www-data:www-data .
    
    # Shared hosting (cPanel) β€” skip chown (files already belong to your
    # cPanel user); only set the permissions:
    chmod -R 775 storage bootstrap/cache
    
  3. Install dependencies & prepare environment The ZIP does not include the vendor/ folder β€” run composer update to generate it before continuing.
    composer update --optimize-autoloader --no-dev
    npm install
    npm run build
    cp .env.example .env
    php artisan key:generate
    php artisan jwt:secret
    
  4. Run the installer wizard Visit https://yourdomain.com/install/requirements in your browser and follow the 5-step on-screen wizard (details below).
  5. Post-install production optimization
    php artisan config:cache
    php artisan route:cache
    php artisan view:cache
    
βœ…
After the installer completes, the INSTALLED=true flag is written to your .env, APP_ENV is set to production, APP_DEBUG is set to false, and the installer route is automatically disabled for security.

Installation Process

Pre-Install: Create a MySQL Database

Create a MySQL database and user before running the installer wizard:

CREATE DATABASE onemart CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'onemart_user'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT ALL PRIVILEGES ON onemart.* TO 'onemart_user'@'localhost';
FLUSH PRIVILEGES;

Pre-Install: Environment & Dependencies

⚠️
The install package does not ship with the vendor/ folder. You must run composer update after extracting the ZIP to generate it, otherwise the application will fail to boot.

Copy the example environment file, generate keys, and install dependencies:

cp .env.example .env
php artisan key:generate
php artisan jwt:secret
composer update --optimize-autoloader --no-dev
npm install && npm run build

Web Installer Wizard

Navigate to https://yourdomain.com/install/requirements in your browser. The wizard guides you through 5 steps:

Step 1 β€” System Requirements Check

The installer verifies your server meets all requirements β€” PHP version, extensions, functions, and tool availability. All checks must show OK before you can proceed.

Installer β€” System Requirements Check

Step 2 β€” Purchase Verification

Enter your purchase code and username. Click Verify & Continue to validate your license. Upon success, the PURCHASE_VERIFIED=true flag is written to .env.

Installer β€” Purchase Verification

Step 3 β€” Database Configuration

Enter your MySQL connection details β€” Host, Port, Database name, Username, and Password. The installer tests the connection live before saving. On success, it writes the credentials to .env and automatically runs all database migrations.

Installer β€” Database Setup

Step 4 β€” Business & Admin Setup

Configure your business and create the super-admin account on this page:

The installer creates the business record, the admin user, and runs essential seeders (currencies, website setup, general settings, push notification setup, email templates, modules).

Installer β€” Business & Admin Setup

Step 5 β€” Finalize Installation

Click Run to finalize the installation to complete the setup. The installer automatically:

Installer β€” Finalize

Installation Complete

Once finalized, the success screen appears with links to visit the Storefront or the Admin Panel. Your application is now live.

Installer β€” Installation Complete
⚠️
Once the installer sets INSTALLED=true, the /install routes are disabled by the notInstalled middleware. The installer cannot be re-run unless you manually set INSTALLED=false in .env.

Post-Install Production Commands

# Cache for production performance
php artisan config:cache
php artisan route:cache
php artisan view:cache

# Start queue worker (use Supervisor in production)
php artisan queue:work --sleep=3 --tries=3 --max-time=3600

# Optional: Start Octane for high performance
php artisan octane:start

Basic Configuration

Core .env Variables

Most of these are configured automatically by the installer wizard. Key values to review after installation:

# Application (set automatically by installer)
APP_NAME=DayOneMart
APP_ENV=production
APP_KEY=base64:YOUR_GENERATED_KEY
APP_DEBUG=false
APP_URL=https://yourdomain.com

# Locale
APP_LOCALE=en
APP_FALLBACK_LOCALE=en

# Database (set by installer wizard β€” Step 3)
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=onemart
DB_USERNAME=onemart_user
DB_PASSWORD=strong_password_here

# Session & Cache
SESSION_DRIVER=file
CACHE_STORE=file
QUEUE_CONNECTION=sync

FILESYSTEM_DISK=local

# Octane (optional β€” remove if not using Swoole)
OCTANE_SERVER=swoole

# JWT (generated via: php artisan jwt:secret)
JWT_SECRET=your_jwt_secret_here

# License (set automatically by installer)
INSTALLED=true
SOFTWARE_ID=20000000
PURCHASE_VERIFIED=true
PURCHASE_CODE=your_purchase_code
PURCHASE_USERNAME=your_username
ℹ️
Mail, payment gateways, Firebase, and other third-party integrations are configured from the Admin Panel β†’ Settings after installation β€” not in the .env file directly.

Mail Configuration

Supported mail drivers and their key variables:

DriverMAIL_MAILER valueNotes
SMTPsmtpAny SMTP server (Gmail, custom)
MailgunmailgunSet MAILGUN_DOMAIN + MAILGUN_SECRET
AWS SESsesSet AWS credentials
SendmailsendmailServer sendmail binary
Log (dev)logWrites emails to storage/logs

Storage Configuration

By default the application uses the local disk (storage/app/public). To switch to AWS S3, set FILESYSTEM_DISK=s3 and fill in the AWS_* variables in .env. No other code changes are needed.

⚠️
When using S3, ensure the S3 bucket has public read access or a CloudFront distribution in front of it, otherwise product images will not render on the storefront.

Server Configuration

⚠️
This section is for VPS / dedicated servers only, where you control the web server. On shared hosting you cannot edit Nginx, Supervisor, or system configs β€” your host manages them. Shared-hosting buyers: skip to the cPanel / Shared Hosting walkthrough.

Nginx (Recommended)

server {
    listen 80;
    listen [::]:80;
    server_name yourdomain.com www.yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name yourdomain.com www.yourdomain.com;

    # VPS path β€” e.g. /var/www/onemart/public
    root /path/to/your-project/public;
    index index.php;

    ssl_certificate     /etc/ssl/certs/yourdomain.crt;
    ssl_certificate_key /etc/ssl/private/yourdomain.key;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}
ℹ️
If you are running Laravel Octane with Swoole, replace the fastcgi_pass block above with a reverse proxy to the Octane server: proxy_pass http://127.0.0.1:8000;

Apache (.htaccess)

The public/.htaccess file ships with the application. Ensure mod_rewrite is enabled:

a2enmod rewrite
systemctl restart apache2

SSL / HTTPS

Use Certbot (Let's Encrypt) for a free SSL certificate:

apt install certbot python3-certbot-nginx
certbot --nginx -d yourdomain.com -d www.yourdomain.com

Queue Worker (Supervisor)

Create a Supervisor config to keep the queue worker running persistently:

# /etc/supervisor/conf.d/onemart-worker.conf
# VPS only β€” Supervisor is not available on shared hosting
# (see the cPanel Limitations table below)

[program:onemart-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/your-project/artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/log/onemart-worker.log
stopwaitsecs=3600
supervisorctl reread
supervisorctl update
supervisorctl start onemart-worker:*

Cron Job

VPS β€” add the Laravel scheduler to your crontab (crontab -e):

# VPS path β€” e.g. /var/www/onemart
* * * * * cd /path/to/your-project && php artisan schedule:run >> /dev/null 2>&1

Shared hosting β€” create the cron job via cPanel β†’ Cron Jobs instead, using your home-directory path (php /home/username/your-project/artisan schedule:run) β€” see Step 9 of the cPanel walkthrough.

CORS Configuration

CORS headers are managed by Laravel's built-in CORS middleware (config/cors.php). If the Flutter apps or external services cannot reach the API, verify:

Deployment

First-Time Deploy

The commands below assume a VPS shell session in the project root (e.g. cd /var/www/onemart). On shared hosting, follow the cPanel / Shared Hosting walkthrough below instead.

# 1. Install PHP dependencies
composer install --optimize-autoloader --no-dev

# 2. Build frontend assets
npm ci
npm run build

# 3. Run migrations and seeders
php artisan migrate --force
php artisan db:seed --force

# 4. Create storage symlink
php artisan storage:link

# 5. Cache everything for production
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan event:cache

# 6. Set permissions
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data .    # VPS only β€” skip chown on shared hosting

Subsequent Deploys

# Pull latest code
git pull origin main

# Refresh dependencies
composer install --optimize-autoloader --no-dev
npm ci && npm run build

# Run new migrations
php artisan migrate --force

# Clear caches then rebuild
php artisan optimize:clear
php artisan optimize

# Restart Octane / queue workers
php artisan octane:reload   # if using Octane
supervisorctl restart onemart-worker:*

Post-Deploy Checklist

cPanel / Shared Hosting

⚠️
Shared hosting has limitations compared to VPS/dedicated servers. Laravel Octane (Swoole) will not be available. Ensure your hosting plan provides PHP 8.2+, SSH access, and all required PHP extensions before proceeding.

Step 1 β€” Create a Database

Step 2 β€” Upload & Extract Files

Step 3 β€” Set the Document Root

Laravel requires the domain to point to the /public folder. On cPanel you have two options:

Option A β€” Subdomain / Addon Domain (Recommended)

Option B β€” Move Public Files (if document root cannot be changed)

// Change these two lines:
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';

// To point to the project folder:
require __DIR__.'/../onemart/vendor/autoload.php';
$app = require_once __DIR__.'/../onemart/bootstrap/app.php';

Step 4 β€” Set Permissions

Via cPanel β†’ Terminal (SSH) or File Manager:

cd /home/username/your-project
chmod -R 775 storage bootstrap/cache
chmod 644 .env

Step 5 β€” Install Dependencies

The install package does not include the vendor/ folder, so you must generate it with composer update. Connect via SSH and run:

cd /home/username/your-project
composer update --optimize-autoloader --no-dev
cp .env.example .env
php artisan key:generate
php artisan jwt:secret
ℹ️
If your shared host does not provide SSH or Composer, run composer update on your local machine and upload the resulting vendor/ folder via File Manager / FTP.

Step 6 β€” Build Frontend Assets

If your hosting provides Node.js via SSH:

npm install
npm run build
ℹ️
If Node.js is not available on your hosting, build assets locally on your computer and upload the public/build/ folder via File Manager or FTP.

Step 7 β€” Run the Installer Wizard

Step 8 β€” Create the Storage Symlink

php artisan storage:link
ℹ️
If symlink() is disabled on your hosting, manually create the link via File Manager or ask your hosting provider to enable it.

Step 9 β€” Set Up the Cron Job

php /home/username/your-project/artisan schedule:run >> /dev/null 2>&1

Step 10 β€” Production Optimization

php artisan config:cache
php artisan route:cache
php artisan view:cache

cPanel Limitations

FeatureVPS / DedicatedShared Hosting
Laravel Octane (Swoole)AvailableNot available
Push Notifications (Firebase)AvailableAvailable
Supervisor (queue workers)AvailableNot available β€” use QUEUE_CONNECTION=sync
Custom Nginx configFull controlNot available β€” uses Apache
Node.js / npmAvailableMay not be available β€” build locally

Update Procedure

Using the Built-in Updater (Recommended)

ℹ️
The updater is admin-only β€” you must be logged in as an admin to access it. It is accessible at /updater.
⚠️
The update package does not include the vendor/ folder. After the updater finishes, you must run composer update via SSH so the new PHP dependencies are installed β€” otherwise the application may fail to boot or behave unpredictably after the update.
  1. Back up your database Go to Admin Panel β†’ Settings β†’ System β†’ Database Backup and download a fresh backup.
  2. Navigate to the updater Visit https://yourdomain.com/updater while logged in as admin.
  3. Upload the update ZIP file Download the latest update package and upload it via the updater. The file is uploaded in chunks for reliability on large updates.
  4. Run the update Click the update button. The updater extracts files, runs migrations, and clears caches automatically. You will be redirected to a success page upon completion.
  5. Regenerate the vendor/ folder Connect via SSH and run composer update in the project root to install the new PHP dependencies that ship with the update:
    # VPS:            cd /path/to/your-project   (e.g. /var/www/onemart)
    # Shared hosting: cd /home/username/your-project
    cd /path/to/your-project
    composer update --optimize-autoloader --no-dev
    php artisan optimize:clear
    php artisan optimize
    
    On shared hosting without SSH/Composer, run composer update locally and upload the regenerated vendor/ folder via File Manager or FTP.

Manual Update via SSH

The update ZIP does not contain the vendor/ folder β€” Step 4 below regenerates it with composer update. Skipping that step will leave the site broken.

# 1. Put application in maintenance mode
php artisan down --message="Updating, back in 5 minutes" --retry=300

# 2. Backup database
#    (VPS shown; on shared hosting use your cPanel DB user, e.g. youruser_onemart)
mysqldump -u root -p onemart > backup_$(date +%Y%m%d).sql

# 3. Extract and overwrite files (keep your .env and storage/)
# Do NOT overwrite .env or storage/

# 4. Regenerate vendor/ and rebuild frontend assets
#    (the update package does not ship with vendor/)
composer update --optimize-autoloader --no-dev
npm ci && npm run build

# 5. Run migrations
php artisan migrate --force

# 6. Rebuild cache
php artisan optimize:clear && php artisan optimize

# 7. Bring application back online
php artisan up

Localization

The application supports 5 languages out of the box with full RTL support for Arabic:

LanguageCodeBackendAdmin FrontendStorefront
Englishenlang/en/AdminPanel/locales/en.jsonStoreFront/locales/en.json
Bengalibnlang/bn/AdminPanel/locales/bn.jsonStoreFront/locales/bn.json
Hindihilang/hi/AdminPanel/locales/hi.jsonStoreFront/locales/hi.json
Arabicarlang/ar/AdminPanel/locales/ar.jsonStoreFront/locales/ar.json
Spanisheslang/es/AdminPanel/locales/es.jsonStoreFront/locales/es.json

Adding a New Language

  1. Backend: Copy the lang/en/ folder to lang/{code}/ and translate all PHP files.
  2. Admin frontend: Copy resources/js/AdminPanel/locales/en.json to {code}.json and translate.
  3. Storefront: Copy resources/js/StoreFront/locales/en.json to {code}.json and translate.
  4. Sort locale files: Run npm run sort:locales to ensure consistent key ordering across all files.

Branding & Customization

This section is for store owners β€” no coding required. Everything below is done from the Admin Panel β†’ Settings after installation, so you can make the platform your own: your business name, logo, favicon, and brand colors. A developer-level theming guide (for deeper visual changes) follows at the end. For the complete solution-wide walkthrough β€” including renaming both mobile apps, app icons, splash screens, and content customization β€” see the dedicated Branding & Customization Guide.

Admin Panel Business Setup β€” business name, logo, icon/favicon, and admin primary/secondary color fields 1 2 3 4

Fields on this screen

  1. Business Name β€” displayed across the storefront header, emails, and browser tab title (alongside email, phone, country, time zone, and address).
  2. Logo β€” your main brand logo shown in the storefront and admin header (JPG/PNG/JPEG, max 2 MB, ~120 Γ— 80 px).
  3. Icon β€” the favicon shown in the browser tab (JPG/PNG/JPEG, max 2 MB).
  4. Admin Primary & Secondary Color β€” the accent colors (hex) used for buttons, links, and highlights.
Admin Panel β†’ Settings β†’ Business Setup β†’ Basic Info. The single place where a store owner rebrands the platform without touching code. Numbered markers highlight the four key fields.

1. Business Name & Identity

  1. Open Business Setup Go to Admin Panel β†’ Settings β†’ Business Setup β†’ Basic Info.
  2. Set your business name, email, phone, and address These appear in the storefront header/footer, on invoices, and in transactional emails.
  3. Save Changes take effect immediately on the storefront β€” no rebuild or redeploy required.

2. Logo & Favicon

Upload your brand images from Admin Panel β†’ Settings β†’ Business Setup:

AssetWhere it appearsRecommended sizeFormat
Main logoStorefront & admin header~300 Γ— 80 px (transparent)PNG / SVG
FaviconBrowser tab512 Γ— 512 px (square)PNG / ICO
Email logoHeader of transactional emails~300 Γ— 80 pxPNG
Login/app bannerAuth & splash areas1200 Γ— 600 pxPNG / JPG
ℹ️
Use a transparent PNG for the logo so it looks correct in both light and dark headers. Keep file sizes small (under ~200 KB) for fast page loads.

3. Primary Color Scheme

The brand colors set the accent used for buttons, links, badges, and highlights across the storefront and mobile apps.

  1. Set the colors during install The installer's Step 4 β€” Theme Setup asks for a primary and secondary color as hex values (for example #6366F1).
  2. Change them any time later Update the primary/secondary colors from Admin Panel β†’ Settings β†’ Business Setup. The storefront picks up the new colors on the next page load.
  3. Match your mobile apps To keep branding consistent, set the same hex values in each Flutter app's theme file β€” see App Theme & Colors in the Customer App and Deliveryman App docs.
βœ…
White-label checklist: business name, logo, favicon, email logo, primary color, secondary color, storefront banner, app name, and app icons β€” set all of these to fully rebrand the platform as your own.

4. Developer Theming (Advanced)

For deeper visual changes beyond the admin settings, the storefront and admin UI are styled with Tailwind CSS driven by CSS variables:

ℹ️
Most owners never need this step β€” logo, favicon, and colors from the admin panel are enough to rebrand. Only edit app.css if you need to change typography, spacing, or component styling site-wide.

API Reference (Developers)

πŸ”Œ
This section summarizes the API at a glance. The complete endpoint-by-endpoint technical documentation β€” every method and path for the Customer, Deliveryman, and Admin APIs, the payment gateway callbacks, and all third-party integration points β€” is on the dedicated API Reference page.

The application ships with a Postman collection (postman-collection.json, ~485 KB) covering all API endpoints. Import it into Postman or Insomnia for interactive exploration.

Base URL & Versioning

Base URL:  https://yourdomain.com/api/v1
Auth:      Bearer JWT token (Authorization: Bearer {token})

Authentication Flow (JWT)

The API uses JWT bearer tokens (tymon/jwt-auth). A client logs in once, stores the returned token, and sends it on every subsequent request.

1. Log in to obtain a token

POST /api/v1/auth/login
Content-Type: application/json

{
  "email": "customer@example.com",
  "password": "secret123"
}

Response

{
  "success": true,
  "message": "Login successful",
  "data": {
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
    "token_type": "bearer",
    "expires_in": 3600,
    "user": { "id": 12, "name": "Jane Doe", "email": "customer@example.com" }
  }
}

2. Call a protected endpoint with the token

GET /api/v1/customer/orders
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...

3. Refresh an expiring token

POST /api/v1/auth/refresh
Authorization: Bearer {current_token}

Standard Request Headers

HeaderValueRequired
AuthorizationBearer {token}On protected routes
Content-Typeapplication/jsonOn POST/PUT
Acceptapplication/jsonRecommended
X-localizationen / bn / hi / ar / esOptional β€” sets the response language

Standard Response Envelope

All API responses follow a consistent JSON shape, so clients can parse them uniformly:

// Success
{ "success": true,  "message": "...", "data": { ... } }

// Paginated list
{ "success": true, "data": [ ... ], "meta": { "current_page": 1, "last_page": 5, "total": 92 } }

// Validation / error
{ "success": false, "message": "The given data was invalid.",
  "errors": { "email": ["The email field is required."] } }

HTTP Status & Error Codes

CodeMeaningTypical cause
200OKSuccessful GET/PUT/DELETE
201CreatedSuccessful POST that created a record
401UnauthorizedMissing, invalid, or expired token
403ForbiddenAuthenticated but lacks permission (RBAC)
404Not FoundResource or route does not exist
422Unprocessable EntityValidation failed β€” see errors object
429Too Many RequestsRate limit exceeded
500Server ErrorCheck storage/logs/laravel.log
ℹ️
The full request/response schema for every endpoint is in the bundled Postman collection (postman-collection.json). Import it to try each call live against your own installation.

Customer API Endpoints

GroupEndpoints
Authenticationlogin, OTP login, sign-up, forgot-password, verify-OTP, reset-password, Google / Facebook / Apple social login, logout, refresh, check-user-exists
App Confighome screen, app config, geocode-reverse, place-autocomplete, map-place-details, map-direction
Productslist, detail, by-category, search, featured, popular, recommended
Categorieslist, show, featured, popular
Cartget, add, update quantity, update item, remove
Checkoutplace-order, apply-delivery-charge, coupon apply/remove
Orderslist, show, cancel, track (public), invoice, history
Walletshow, add-money
Loyalty Pointsconfig, histories, redeem
Notificationslist, unread count, mark-read, mark-all-read, delete, preferences
Chatlist, start-chat, show, messages, send-message
Profileshow, update, change-password, delete-account, settings
AddressesCRUD delivery addresses
Wishlistlist, add, delete
ReviewsCRUD product reviews
Refund Requestslist, show, store, cancel

Admin API Endpoints

GroupEndpoints
Authlogin, verify-2FA, logout, refresh
Dashboardsummary stats, recent orders, real-time data
Products & Menuitems, categories, sub-categories, cuisines, labels, menu-types, addons β€” full CRUD + status toggle
Orderslist, show, update status, assign deliveryman, cancel, refund, bulk actions
Userscustomers, deliverymen, employees β€” CRUD, bulk actions, role management
Promotionscoupons, flash sales β€” full CRUD + status
Notificationscreate, send, bulk actions, mark-seen
Settingsbusiness setup, payment gateways, SMS gateways, Firebase, social auth, email, tax, currency, delivery charges, cookies, marketing tools
Analyticssales, category performance, user activity
Systemcache clear, env variable CRUD, DB backups

Deliveryman API Endpoints

GroupEndpoints
Authlogin, OTP login, forgot-password, verify-OTP, reset-password, logout, refresh
Dashboardsummary stats, earnings, delivery overview
Orderslist assigned orders, show details, update status, accept/reject
Profileshow, update, FCM token, change-password, delete-account, settings
Chatlist, conversations, messages, send-message
Notificationslist, mark-read, mark-all-read, delete
Configapp config, terms, support, map-direction

Troubleshooting

Common Environment Configuration Errors (.env)

Most post-install failures trace back to one of these .env misconfigurations. After any .env change, run php artisan config:clear (and php artisan config:cache in production) or the change will not take effect.

SymptomMisconfigured variableFix
"No application encryption key has been specified" APP_KEY empty Run php artisan key:generate then php artisan config:clear
App users logged out / API returns 401 for everyone JWT_SECRET missing or changed Run php artisan jwt:secret once; never regenerate it casually β€” it invalidates all tokens
SQLSTATE[HY000] [1045] Access denied DB_USERNAME / DB_PASSWORD / DB_DATABASE Match the credentials created in Pre-Install: Create a MySQL Database; re-grant privileges if needed
SQLSTATE[HY000] [2002] Connection refused / timed out DB_HOST / DB_PORT Use 127.0.0.1 for a local DB; for managed databases use the remote endpoint and open port 3306 (details in the FAQ)
419 Page Expired on login; assets load over HTTP; wrong links in emails APP_URL doesn't match the real domain Set APP_URL=https://yourdomain.com exactly as typed in the browser, then php artisan config:cache
Stack traces shown publicly on errors APP_DEBUG=true in production Set APP_DEBUG=false and APP_ENV=production (the installer does this automatically)
Site redirects back to the installer, or installer unreachable after install INSTALLED flag INSTALLED=true disables /install; set it to false only to deliberately re-run the installer
Uploaded images return 404 FILESYSTEM_DISK / missing symlink Run php artisan storage:link; for S3 set FILESYSTEM_DISK=s3 and all AWS_* keys
Emails / push notifications queued but never sent QUEUE_CONNECTION With database/redis a worker must be running (php artisan queue:work); on shared hosting without a worker use sync
500 error mentioning Swoole / Octane on a host without Swoole OCTANE_SERVER Remove the OCTANE_SERVER line and serve via PHP-FPM β€” Octane is optional

500 β€” Internal Server Error

Vite Manifest Not Found

npm install
npm run build
php artisan view:clear

Images / Uploads Not Showing

php artisan storage:link
# If the symlink already exists but is broken:
rm public/storage
php artisan storage:link

404 β€” Page Not Found

Emails Not Sending

CSRF Token Mismatch

Queue Jobs Not Processing

# Check if queue worker is running
supervisorctl status onemart-worker:*

# Restart if needed
supervisorctl restart onemart-worker:*

# Run manually to debug
php artisan queue:work --verbose

Push Notifications Not Working

Permission Errors

chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache

FAQ & Environment-Specific Issues

Answers to the most common questions and environment-specific hurdles encountered during installation and deployment across different hosting setups (VPS, shared hosting, cloud, and local development).

Database connection timeouts

Symptoms: SQLSTATE[HY000] [2002] Connection timed out, [2002] Connection refused, or [2006] MySQL server has gone away during the installer's database step or while the app is running.

Permission errors (storage / bootstrap / cache)

Symptoms: The stream or file "storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied, or a white screen after install.

# Grant read/write to the framework-managed directories
chmod -R 775 storage bootstrap/cache

# Give ownership to the web-server user
#   Nginx/Apache on Ubuntu/Debian: www-data
#   Apache on CentOS/RHEL:          apache
#   cPanel/shared hosting:          your cPanel username
chown -R www-data:www-data storage bootstrap/cache

"No application encryption key has been specified"

php artisan key:generate
php artisan config:clear

Installer times out or fails midway (max_execution_time / memory_limit)

Migrations and seeders can exceed conservative PHP limits on shared hosting. Raise these in php.ini (or via .user.ini / cPanel β†’ MultiPHP INI Editor):

max_execution_time = 300
memory_limit = 512M
max_input_time = 300

Large update ZIP or CSV import is rejected

Increase the upload limits so the updater and bulk import can accept larger files:

upload_max_filesize = 128M
post_max_size = 128M

419 β€” Page Expired on login

Assets load over HTTP / mixed-content warnings behind a proxy or load balancer

Composer runs out of memory on shared hosting

php -d memory_limit=-1 $(which composer) update --optimize-autoloader --no-dev

If Composer or SSH is unavailable, run composer update locally and upload the generated vendor/ folder β€” the package ships without it by design.

Emails, push notifications, or payments are not working after install

These integrations are configured in Admin Panel β†’ Settings after installation, not in .env. See the Troubleshooting section for driver-specific checks.

Extending the Platform

This section is for developers building on top of DayOneMart. The codebase follows standard Laravel 12 conventions with a service-oriented structure, so most extensions are additive β€” you add controllers, services, routes, and Vue pages without modifying core files.

Architecture at a Glance

LayerLocationResponsibility
Routesroutes/api/v1/, routes/web/Endpoint & page registration
Controllersapp/Http/Controllers/Request handling (thin)
Form Requestsapp/Http/Requests/Validation rules
Servicesapp/Services/Business logic (fat)
Modelsapp/Models/Eloquent data layer
Resourcesapp/Http/Resources/API JSON transformers
Events / Jobsapp/Events/, app/Jobs/Async & decoupled side-effects

Add a New API Endpoint (End-to-End)

  1. Create a controller Place it under app/Http/Controllers/Api/ and keep it thin β€” delegate logic to a service.
    php artisan make:controller Api/V1/Customer/FavoriteController
    
  2. Add a Form Request for validation
    php artisan make:request StoreFavoriteRequest
    
  3. Put the business logic in a service Add a class under app/Services/ and inject it into the controller's constructor.
  4. Return an API Resource Transform the model with a Resource in app/Http/Resources/ so the response matches the standard envelope (success, message, data).
  5. Register the route Add it to the correct file β€” routes/api/v1/customer.php, admin.php, or deliveryman.php β€” inside the JWT auth:api middleware group.
    Route::middleware('auth:api')->group(function () {
        Route::apiResource('favorites', FavoriteController::class);
    });
    
  6. Test it Call the new route with a bearer token, then add it to postman-collection.json so it stays documented.

Events & Listeners

Decouple side-effects (emails, push notifications, logs) from your core flow by firing events instead of calling services inline:

# Generate an event and a listener
php artisan make:event OrderPlaced
php artisan make:listener SendOrderPushNotification --event=OrderPlaced

# Dispatch from anywhere in your code
event(new OrderPlaced($order));

Register the mapping in app/Providers/EventServiceProvider.php (or via auto-discovery).

Queued Jobs (Background Work)

Offload slow work (bulk notifications, exports, third-party API calls) to the queue so requests stay fast:

php artisan make:job ProcessBulkImport

# Dispatch it
ProcessBulkImport::dispatch($payload);
ℹ️
Queued jobs require a running worker (php artisan queue:work) and QUEUE_CONNECTION set to database or redis. On shared hosting without a persistent worker, keep QUEUE_CONNECTION=sync so jobs run inline.

Add a Database Column / Migration

php artisan make:migration add_gift_note_to_orders_table
# edit the migration, then:
php artisan migrate
⚠️
Always ship schema changes as new migrations β€” never edit existing migration files that have already run in production. This keeps the built-in updater and other installs upgradeable.

Add an Admin Page / Module

  1. Create the Vue page under resources/js/AdminPanel/Pages/, following an existing module (e.g. Orders/) as a template.
  2. Add a web route in routes/web/admin.php that renders the page via Inertia.
  3. Add the sidebar/menu entry and wire up any RBAC permission so it respects employee roles.
  4. Rebuild assets with npm run build (or npm run dev during development).

Backend β€” Controllers & Services (Reference)

Frontend β€” Vue & Tailwind

Translations / i18n

Adding a Payment Gateway

  1. Create the controller in app/Http/Controllers/Payment/ implementing the gateway's webhook and redirect callbacks.
  2. Register routes in routes/payment.php.
  3. Add the gateway to settings β€” register it in the admin panel's payment gateway list and add the necessary .env variables.

Email Templates

Laravel Mailable classes are in app/Mail/. Blade email views are in resources/views/emails/. Customize the HTML/CSS directly in those files.

Development Workflow

# Start all dev services concurrently (PHP server + queue listener + logs + Vite)
composer dev

# Or start individually:
php artisan serve                    # PHP dev server on port 8000
npm run dev                          # Vite dev server with HMR
php artisan queue:listen --tries=1   # Queue listener
php artisan pail                     # Tail logs in terminal

# Optional services:
php artisan octane:start             # Octane performance server (if enabled)

Need help? Reach us via the item’s Support tab on CodeCanyon or dayonesoft.com or visit our website for support.