Senior Full Stack Software Engineer

Senior Software Engineer and Front End Developer with nine years programming scalable web applications, internal tools, and B2B platforms using Next.js, React, and Laravel.

SakhtBazar: Construction B2B Marketplace, project by Ali Emami

SakhtBazar: Construction B2B Marketplace

Migrated a construction B2B marketplace from Laravel Blade to Next.js ISR: cut category load time from 20s to 3s, lowered LCP to 1.6s, and drove 3x organic search growth.

Project Overview

SakhtBazar is a high-volume B2B marketplace built to connect construction material suppliers, manufacturers, and contractors across a multi-category catalog. As the frontend developer on the project, contributing full-stack engineering expertise to backend optimization, I led the migration from a monolithic Laravel Blade frontend to a modern, decoupled Next.js architecture while collaborating with the backend team to resolve critical database and query bottlenecks.

The Challenge: Severe Latency and Rendering Bottlenecks

Prior to the overhaul, the marketplace operated entirely on traditional server-rendered Laravel Blade templates. As the supplier and product catalog expanded, severe performance degradation emerged:

  • 20-second category page loads: Heavy category listing pages suffered from unoptimized Eloquent queries, missing database indices, and inefficient relation loading, causing database CPU spikes and 20-second response times.
  • Multilingual overhead: The existing localization setup repeatedly parsed dynamic language keys on every request, creating massive overhead across all pages.
  • Search engine visibility limits: The slow response times hurt crawl budgets and Core Web Vitals, limiting organic discovery for hundreds of thousands of construction product listings.

Architecture & Implementation

To eliminate these bottlenecks while ensuring optimal SEO for catalog pages, we decoupled the presentation layer into Next.js and restructured the communication with Laravel:

  • Incremental Static Regeneration (ISR): We implemented Next.js ISR for product detail, category, and search landing pages. This ensured search crawlers and users received instant, pre-rendered HTML while background workers regenerated stale pages on schedule.
  • Feature-based frontend architecture: The frontend was structured around distinct domain features (such as catalog, vendor profiles, inquiries, and checkout). Over 50 modular React components were built, maintaining a clean boundary between domain-specific components and reusable shared UI primitives.
  • Secure authentication with Laravel Sanctum: User sessions and vendor dashboards were integrated using Laravel Sanctum with secure HTTP-only cookies, effectively safeguarding against cross-site scripting (XSS) risks without adding stateful session drag on the API.
  • Event-Driven backend architecture: The Laravel backend leveraged an event-driven pattern for inventory updates, catalog changes, and vendor notifications, keeping synchronous request lifecycles lean and fast.

Performance Engineering & Multi-Layer Redis Caching

Achieving fast Core Web Vitals required full-stack optimization across both Laravel and Next.js:

  • Database & query optimization: We refactored heavy queries, established eager loading relationships to eradicate N+1 query patterns, and added composite indexes to frequently filtered columns in MySQL, dropping baseline query execution times significantly.
  • Decoupled JSON localization: We replaced dynamic server-side translation lookups with precompiled static JSON translation files, removing the i18n latency bottleneck across all localized views.
  • Multi-layer Redis caching: Implemented Redis caching for high-frequency database queries and API responses, as well as caching rendered fragments. Category page load times dropped from 20 seconds to 3 seconds.
  • Next.js asset optimization: Integrated next/image with automatic WebP conversion and responsive source sets. Non-critical interactive widgets and below-the-fold modules were loaded on demand using next/dynamic code splitting.
  • LCP reduction: Largest Contentful Paint (LCP) was reduced from 4.5 seconds to 1.6 seconds, representing an approximate 80% decrease in overall page load latency.

Technical SEO Strategy & 3× Organic Traffic Growth

Search visibility was the core business driver for the marketplace. The technical SEO plan focused on crawl efficiency and search indexing:

  • Dedicated SSR for search bots: Automated fallback server-side rendering ensured search engine crawlers always received fully hydrated semantic HTML with zero rendering delays.
  • Structured Data (Schema.org): Built-in JSON-LD markup for Product, Offer, BreadcrumbList, and Organization schemas to capture rich snippets on Google Search.
  • Canonical discipline: Self-referencing canonical tags were strictly generated across complex faceted search and filter combinations to eliminate duplicate content issues.
  • Dynamic XML sitemaps: Segmented sitemaps generated automatically from live database records, keeping new materials and supplier profiles indexed quickly.
  • Clean URL hierarchies: Restructured category and product URLs with clean, keyword-rich slugs reflecting the construction trade taxonomy.

Key Measured Outcomes

  • 80% reduction in page load latency: LCP dropped from 4.5s to 1.6s, moving the platform into passing Core Web Vitals thresholds.
  • Category loading cut from 20s to 3s: Indexing, relationship refactoring, and Redis caching transformed the slowest pages into snappy catalog views.
  • 3× organic search growth: Combining fast ISR pages, rich schema, and canonical indexing discipline drove a 300% surge in qualified organic search traffic.
  • Scalable component ecosystem: 50+ reusable, feature-based components established the foundation for rapid feature releases and consistent UX.
  • Next.js

  • React

  • Laravel

  • Redis

  • Laravel Sanctum

  • ISR (Incremental Static Regeneration)

  • Event-Driven Architecture

  • Technical SEO

  • Docker

  • MySQL

SakhtBazar: Construction B2B Marketplace screenshot
SakhtBazar: Construction B2B Marketplace screenshot
Previous
Next

Project Details

Name: SakhtBazar: Construction B2B Marketplace
Client: SakhtBazar
Category: B2B Marketplaces
Tags: Next.js, React, Laravel, Redis, Laravel Sanctum, ISR (Incremental Static Regeneration), Event-Driven Architecture, Technical SEO, Docker, MySQL
Let's chat with me? - Online
Please fill out the form below to start chatting with me directly.