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

Order Management

Product & Menu Management

Marketing & Promotions

User Management

Website & Content

Communication

Settings & Integrations

System & Security

Installer & Updater

Prerequisites

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

Pre-flight Checklist

5-Step Quick Install

  1. Extract the archive Extract the downloaded ZIP to your server's web directory (e.g. /var/www/onemart). Point your Nginx/Apache document root to the /public folder.
  2. Set permissions
    chmod -R 775 storage bootstrap/cache
    chown -R www-data:www-data .
    
  3. Install dependencies & prepare environment
    composer install --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

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

cp .env.example .env
php artisan key:generate
php artisan jwt:secret
composer install --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

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;

    root /var/www/onemart/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

[program:onemart-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/onemart/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

Add the Laravel scheduler to your crontab (crontab -e):

* * * * * cd /var/www/onemart && php artisan schedule:run >> /dev/null 2>&1

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

# 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 .

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/youruser/onemart
chmod -R 775 storage bootstrap/cache
chmod 644 .env

Step 5 β€” Install Dependencies

Connect via SSH and run:

cd /home/youruser/onemart
composer install --optimize-autoloader --no-dev
cp .env.example .env
php artisan key:generate
php artisan jwt:secret

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/youruser/onemart/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.
  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.

Manual Update via SSH

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

# 2. Backup database
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. Update dependencies
composer install --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.

API Reference

The application ships with a complete 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})

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

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

Customization

Backend β€” Controllers & Services

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? Contact contact@6amtech.com or visit our website for support.