SaaS Commerce

Akhyan SaaS Commerce

TypeScript

SaaS Commerce Featured

Akhyan SaaS Commerce

A SaaS commerce experience connecting storefront, operations and real-time updates.

0 stars 0 forks 0 issues Created May 2026

Preview

Live screenshotOpen live site
Akhyan SaaS Commerce — live screenshot

A screenshot of the project’s live deployment. Use “Open live site” to visit it.

What this demonstrates

  • Decoupled Next.js and Laravel architecture
  • Admin and customer dashboards
  • Real-time updates with Laravel Reverb
  • Orders, promotions and PDF invoices

Tech stack

TypeScript 97.2%JavaScript 2.1%CSS 0.4%Shell 0.2%
Next.jsTypeScriptLaravelMySQLSanctumWebSockets

Overview

A SaaS e-commerce product with a Next.js 16 and TypeScript storefront connected to a Laravel 13 REST API. MySQL stores commerce data, Sanctum authenticates customers and administrators, and Laravel Reverb powers real-time updates. Product, order and promotion management come together in the admin dashboard.

Project README

Akhiyan BD E-Commerce

A full-stack e-commerce platform for natural herbal products, built with Next.js 16 and Laravel 13.


Tech Stack

LayerTechnologyVersion
FrontendNext.js (App Router)16.2.2
UI FrameworkReact19.2.4
LanguageTypeScript5.x
StylingTailwind CSS4.x
Backend APILaravel13.0
DatabaseMySQL8.x
AuthLaravel Sanctum4.0
SearchLaravel Scout (database driver)11.x
Real-timeLaravel Reverb (WebSocket)1.x
RuntimeNode.js24.x
RuntimePHP8.4
Package Managernpm11.x
PHP PackagesComposer2.x

Frontend Libraries

  • Framer Motion — Animations (dashboard modals)
  • Swiper — Carousel/slider
  • React Icons — Icon library (Feather + Font Awesome)
  • html2canvas-pro + jsPDF — Invoice PDF generation
  • Laravel Echo + Pusher.js — Real-time WebSocket client

Fonts

LanguageHeadingsBody
Bangla (default)Hind SiliguriHind Siliguri
EnglishPlayfair DisplayManrope
Bangla numeralsLiAbuJMAkkas (custom TTF)—

Architecture

mabheshoj/
├── src/                    # Next.js frontend
│   ├── app/                # App Router pages
│   │   ├── page.tsx        # Homepage
│   │   ├── shop/           # Shop page
│   │   ├── products/[slug] # Product detail (dynamic)
│   │   ├── checkout/       # Checkout
│   │   ├── dashboard/      # Admin + customer dashboard
│   │   ├── about/          # Static pages
│   │   ├── contact/
│   │   └── api/            # API routes (revalidation)
│   ├── components/         # React components
│   ├── lib/                # Context providers, API client, hooks
│   ├── i18n/               # Translation files (bn, en)
│   ├── data/               # Static fallback data
│   └── utils/              # Utilities (toBn number converter)
├── backend/                # Laravel REST API
│   ├── app/
│   │   ├── Models/         # Eloquent models
│   │   ├── Http/Controllers/Api/  # API controllers
│   │   └── Events/         # WebSocket events
│   ├── database/
│   │   ├── migrations/     # Database schema
│   │   └── seeders/        # Initial data
│   └── routes/api.php      # API routes
├── public/                 # Static assets
├── next.config.ts          # Next.js configuration
├── package.json            # Node dependencies
└── tsconfig.json           # TypeScript config

Key Design Decisions

  • Decoupled architecture — Next.js frontend communicates with Laravel API via REST
  • ISR (Incremental Static Regeneration) — Pages are statically generated and revalidated every 5 minutes
  • On-demand revalidation — Backend triggers Next.js cache purge after admin changes
  • Optimistic UI — Dashboard CRUD operations update the UI instantly without re-fetching
  • Dual language — Bangla/English toggle with automatic font switching
  • WebSocket live refresh — Product/category changes push updates via Laravel Reverb

Prerequisites

Make sure you have the following installed:

  • PHP >= 8.3
  • Composer >= 2.x
  • Node.js >= 20.x
  • npm >= 10.x
  • MySQL >= 8.x (or MariaDB)
  • Git

Recommended: Laragon (Windows) or Herd (macOS) for local PHP/MySQL setup.


Getting Started

1. Clone the repository

git clone https://github.com/your-username/mabheshoj.git
cd mabheshoj

2. Install frontend dependencies

npm install

3. Set up the backend

cd backend
composer install

4. Configure environment files

Frontend — create .env.local in the project root:

NEXT_PUBLIC_API_URL=http://localhost:8001/api/v1

# Laravel Reverb WebSocket (optional, for real-time updates)
NEXT_PUBLIC_REVERB_APP_KEY=your-reverb-app-key
NEXT_PUBLIC_REVERB_HOST=localhost
NEXT_PUBLIC_REVERB_PORT=6001

# Revalidation secret (must match backend)
REVALIDATE_SECRET=your-secret-here

Backend — copy and edit .env in the backend/ directory:

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

Edit backend/.env with your database credentials:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mabhesojdb
DB_USERNAME=root
DB_PASSWORD=

CACHE_STORE=database
SANCTUM_STATEFUL_DOMAINS=localhost:3000

5. Set up the database

Create the MySQL database:

CREATE DATABASE mabhesojdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Run migrations and seeders:

cd backend
php artisan migrate
php artisan db:seed

6. Create the storage symlink

cd backend
php artisan storage:link

This makes uploaded files (product images) accessible via /storage/ URLs.

7. Run the development servers

From the project root:

npm run dev

This starts three processes concurrently:

ServiceURLDescription
Next.jshttp://localhost:3000Frontend
Laravel APIhttp://localhost:8001REST API
Laravel Reverbws://localhost:6001WebSocket server

Alternatively, run them individually:

# Terminal 1 — Frontend
npm run dev:next

# Terminal 2 — API
cd backend && php artisan serve --port=8001

# Terminal 3 — WebSocket (optional)
cd backend && php artisan reverb:start

8. Build for production

npm run build
npm start

API Endpoints

All routes are prefixed with /api/v1/.

Public

MethodEndpointDescription
GET/productsPaginated product list
GET/products/{slug}Single product
GET/products/top-ratedTop selling products
GET/products/search?q=Full-text search
GET/categoriesAll categories
GET/flash-sales/activeCurrent flash sale
GET/bannersHomepage banners
GET/settingsSite settings
POST/ordersCreate order (guest checkout)

Protected (Bearer token)

MethodEndpointDescription
POST/auth/registerRegister
POST/auth/loginLogin
GET/auth/userCurrent user
GET/ordersUser's orders
POST/reviewsSubmit review

Admin

All admin endpoints require authentication with an admin-role user. Full CRUD for: products, categories, brands, orders, users, reviews, flash-sales, coupons, banners, menus, blog posts, landing pages, shipping zones, and site settings.


Features

  • Product catalog with categories, brands, and search
  • Flash sales with countdown timer
  • Shopping cart with guest checkout
  • Order management with status tracking
  • Customer reviews and ratings
  • Coupon/discount system
  • Admin dashboard with full CRUD
  • PDF invoice generation
  • Dual language (Bangla/English) with font switching
  • Real-time updates via WebSocket
  • SEO optimised with JSON-LD, meta tags, sitemap
  • Mobile-responsive design

License

Private project. All rights reserved.