Skip to content
Back to shipped records
Client: Sajjan Dera Livestock (Pvt) Ltd./Industry: Agricultural Technology & E-Commerce

Sajjan Dera Platform

We built a livestock inventory and sales system in Next.js deployed on Cloudflare Workers edge nodes.

Key OutcomeGlobal

pages load in under 120ms from Cloudflare's edge network.

Key OutcomeLivestock

inventory counts synchronize in real time to prevent double booking.

The Failure / Problem

System Bottlenecks

Agricultural businesses often use manual checklists and legacy spreadsheets that fail to sync livestock counts, veterinary logs, and customer orders, causing double bookings and delivery delays.

The Resolution / Solution

Architectural Move

We built a multi-app system containing a customer storefront, an admin panel, and an automated schema runner. The code is written in Next.js, compiled for Cloudflare Workers using OpenNext, and queries a replicated D1 SQLite database to sync animal records across farm locations.

Execution Path

1

System Architecture: We built the storefront and the administration portal using Next.js App Router.

2

Edge Compilation: We configured OpenNext to bundle Next.js assets and API endpoints to run inside Cloudflare Workers.

3

Migration Runner: We wrote a script in Bun to apply database schema changes across replicated D1 databases using Wrangler.

"The system tracks animal health records and bookings online. We manage reservations directly from the pastures."

— Musa Ibrahim, Managing Director, Sajjan Dera Livestock

Core Stack

  • Next.js (App Router)
  • OpenNext (Cloudflare adapter)
  • Cloudflare D1 (Serverless SQLite)
  • Bun (Package manager & scripting)
  • Wrangler & TailwindCSS

Under-the-hood Challenge

Running a Next.js application on Cloudflare's edge runtime, which lacks native support for some Node.js libraries. We solved this by setting up OpenNext to bundle polyfilled modules, replacing standard Node libraries with edge-safe equivalents, and writing database queries to Cloudflare D1.

Sajjan Dera moves farm operations to an edge network. Running Next.js on Cloudflare Workers allows the system to scale for seasonal buying spikes without requiring server capacity planning.

Have a system that needs scaling?Initiate Brief