CASE STUDYE-Commerce · Cross-Platform · 2024

T & K Cross-Platform E-Commerce Solution

A production-grade e-commerce ecosystem — one codebase serving web and mobile — with real-time inventory, multi-gateway secure payments, personalised shopping, and analytics that actually drive decisions.

 
WEB

Unified Web Experience

React storefront with server-side rendering. Sub-second page loads. SEO-optimised from the ground up.

 
MOB

Native Mobile Commerce

React Native iOS & Android. Same catalogue, cart, and order state as web. Real-time sync across devices.

 
PAY

Secure Multi-Gateway Payments

Stripe + PayHere integration. PCI DSS compliant. Tokenised cards, 3DS2, automatic retry logic.

 
INV

Real-Time Inventory Engine

Stock levels update instantly across all channels. Automatic low-stock alerts. No overselling, no manual syncing.

T & K Cross-Platform E-Commerce Solution
Year2024
ClientT & K
IndustryE-Commerce · Retail
PlatformWeb + Mobile
Timeline2 Months
Team Size2 Engineers
StatusLive
2Engineers Built the Full Platform
2moConcept to Production Launch
<1.2sFirst Contentful Paint on Web
0Inventory Sync Errors Since Launch
Project Overview

E-commerce that works everywhere — without the complexity tax.

T & K needed more than a website with a mobile app bolted on. They needed a single, unified commerce platform where every channel shares the same data, the same logic, and the same customer experience.

The design principle: One product catalogue, one inventory engine, one customer record, one order management system. Web and mobile are two rendering surfaces for the same platform — not two separate applications that need to be kept in sync.

T & K is a growing retail business that recognised early that their customers shop on multiple devices. The problem they faced wasn’t a lack of platforms — it was the fragmentation of running separate web and mobile experiences backed by separate databases, with manual reconciliation between them at the end of every day.

NextGen Innovations built T & K a unified e-commerce platform from the ground up. The architecture is channel-agnostic: a single backend API and data layer serves the React web storefront and the React Native mobile app identically. When a product sells on web, the inventory updates on mobile instantly. When a customer adds to cart on their phone and opens a browser, their cart is there.

The platform was built for growth from day one — horizontal scaling via containerised microservices, CDN-first asset delivery, database-level performance optimisation for catalogue queries, and a modular feature architecture that lets new capabilities be added without refactoring existing ones.

 
Challenges

Four platforms’ worth of complexity. One coherent solution.

Building a cross-platform e-commerce system means solving the same problem four times simultaneously: web performance, mobile UX, payment security, and inventory reliability.

 
01

Cross-Platform Feature Parity Without Duplication

Every feature — catalogue browsing, search, cart management, checkout, order tracking, wishlists, reviews — needed to work identically on web, iOS, and Android. Building three separate implementations would triple the maintenance burden.

 
02

Sub-Second Page Performance on Web

E-commerce conversion rates drop measurably with every 100ms of additional load time. The web storefront needed to load product pages in under 1.5 seconds on standard connections — requiring SSR, image optimisation, and aggressive CDN caching.

 
03

Secure Multi-Currency Payment Processing

T & K serves customers across different markets, requiring integration with multiple payment providers. A payment system that fails silently — completing at the gateway but failing to confirm in order management — destroys customer trust.

 
04

Real-Time Inventory Across All Channels

A customer adding an item to their mobile cart at the exact moment another customer is checking out on web — with only one unit remaining — is not a hypothetical edge case. Without transactional consistency, overselling is inevitable.

 
05

Personalisation at Scale Without Latency

Personalised product recommendations are table stakes for competitive e-commerce. But recommendation queries are expensive — they needed to be pre-computed and cached, not calculated on-demand per page load.

 
06

Admin Operations Without Engineering Involvement

T & K’s operations team needed to manage products, promotions, inventory, and orders without raising development tickets — including bulk price updates, promotional discount rules, and flash sale scheduling.

 
Our Solution

Architecture-first. Then features.

Every decision started from the data model and the API contract — not from the UI. Building features on a solid foundation is the only way to avoid the fragmentation T & K was trying to escape.

01

Shared API Layer — Web and Mobile as Rendering Clients

A single Node.js + Express REST API serves all three platforms from one codebase. Business logic lives exactly once: in the API. When a rule changes — a discount logic update, a new shipping zone — it changes once and applies everywhere immediately.

Node.jsExpress REST APIAPI VersioningContract-First Design
02

Next.js SSR with Incremental Static Regeneration

Product pages are server-side rendered for first load — critical for SEO and initial performance — then hydrated to a React SPA for subsequent navigation. ISR pre-renders high-traffic pages at build time with automatic cache invalidation when data changes. Result: sub-1.2s first contentful paint with full SEO visibility.

Next.js 14ISRCDN Image PipelineCore Web Vitals
03

Dual Payment Gateway with Idempotent Order Confirmation

Stripe handles international card payments with 3D Secure 2 authentication. PayHere handles local payment methods for the Sri Lankan market. Both are integrated through an abstraction layer that normalises webhook events into a single order state machine. Customers receive confirmation only when the order has been committed in the database.

StripePayHere3DS2Idempotent WebhooksPCI DSS
04

Transactional Inventory with Optimistic Locking

Inventory deduction at checkout runs inside a PostgreSQL transaction with optimistic locking on the stock level row. If two users attempt to purchase the last unit simultaneously, exactly one succeeds and the other receives an accurate “out of stock” response before completing payment.

PostgreSQL TransactionsOptimistic LockingCart ReservationsLow-Stock Alerts
05

Recommendation Engine with Pre-Computed Vectors

User activity is logged asynchronously to avoid adding latency to the core shopping flow. A background worker runs item-based collaborative filtering nightly, pre-computing recommendation vectors for all active products. Recommendations are served from Redis cache with sub-5ms response time.

Collaborative FilteringRedis CachingAsync Event Logging
06

Full-Featured Admin Dashboard Without Code

A React 18 admin portal gives the T & K operations team complete control. The promotions engine allows discount codes, percentage and fixed-value discounts, minimum order thresholds, and time-limited flash sales — all configured through a visual interface. No API calls, no spreadsheets, no developer involvement for day-to-day operations.

React 18 AdminBulk OperationsPromotions EngineReal-Time Analytics
 
Technology Stack

Node.js and Next.js. Two engineers, one complete platform.

The stack was chosen for speed of development and reliability in production — not theoretical scalability at a scale that does not yet exist.

WEB
Web Storefront
 
Next.js

Product pages use SSR for fast first loads and full SEO indexability. Category pages use ISR — pre-built at deploy time, automatically refreshed when catalogue data changes.

 
TypeScript

Shared type definitions across the Next.js frontend and Node.js backend. A single type for the product schema ensures API response shapes never silently drift from what the frontend expects.

 
Stripe and PayHere

International card payments via Stripe with 3D Secure 2, and local payment methods via PayHere. Both gateways integrated through a normalised payment layer — one order state machine handles both.

API
Backend & Commerce API
 
Node.js with Express

RESTful API powering product catalogue, inventory, order management, customer accounts, and payment processing. The same business logic serves web, mobile, and admin clients.

 
SendGrid and FCM

Order confirmation emails and shipping updates via SendGrid. Push notifications for order status changes and promotional alerts delivered via Firebase Cloud Messaging.

 
JWT Authentication

Stateless JSON Web Token authentication across web and mobile. Refresh token rotation ensures sessions remain valid across long shopping sessions.

DB
Data & Infrastructure
 
PostgreSQL

The single source of truth for all commerce data — product catalogue, inventory levels, customer records, orders, payments, and reviews. Transactional inventory deduction prevents overselling.

 
Redis

Cart session storage with automatic TTL expiry, short-lived inventory reservation locks during checkout, and category page caching — absorbs the read load from catalogue browsing.

 
AWS S3, CloudFront and Docker

Product images on S3, delivered through CloudFront CDN with WebP conversion and aggressive cache headers. Docker containerisation ensures the two engineers ship to production with identical environments every time.

 
Team

2 engineers. 2 months. Full e-commerce platform.

T&K was built by two engineers who between them owned every layer of the stack — no external contractors, no design agency, no separate QA team. When two people build a product together from scratch, the code stays coherent and the decisions stay fast.

FS
Full-Stack Engineer 1

Node.js and Express backend API, PostgreSQL database schema, inventory transaction logic with optimistic locking, Stripe and PayHere payment gateway integration, Redis caching layer, JWT authentication, Docker containerisation, and AWS deployment. Also owned the Next.js SSR configuration and ISR cache invalidation strategy.

FS
Full-Stack Engineer 2

Next.js web storefront, all product and checkout UI components, Stripe Elements and 3DS2 payment frontend, mobile-responsive CSS across all breakpoints, admin dashboard for catalogue and order management, customer account pages, order tracking views, and end-to-end QA across web and mobile.

 
Impact

What T & K delivered for the business.

T & K launched with a platform built to compete — not a minimum viable product to iterate from, but a production-quality system capable of handling real commercial volume from day one.

 
3

Platforms launching simultaneously — Web, iOS, Android

 
<1.2s

First contentful paint on product pages with full SSR

 
0

Overselling incidents since launch

 
<5ms

Recommendation response time — Redis pre-computed vectors

 
2

Payment gateways — Stripe international, PayHere local

 
0

Developer tickets needed for day-to-day catalogue operations

 
Web and Mobile Launch on the Same Day

T & K launched simultaneously across web, iOS, and Android — no “mobile to follow soon” promise, no degraded mobile experience at launch. All three platforms were production-ready on day one, sharing the same product catalogue, inventory, and order management system in real time.

 
Sub-1.2 Second First Load — With Full Product Data

Next.js SSR with ISR delivers fully rendered product pages in under 1.2 seconds on standard connections, with complete product information, images, and pricing visible before any JavaScript executes.

 
Zero Overselling Incidents Since Launch

PostgreSQL transactional inventory with optimistic locking prevents two simultaneous purchases of the same last unit from both succeeding. Since launch, T & K has had zero overselling incidents.

 
Operations Team Works Without Developer Involvement

The T & K team manages its entire catalogue, promotions, inventory, and order operations through the admin dashboard independently. Product additions, price changes, promotional campaigns, and flash sale scheduling all happen without raising development tickets.

 
Personalised Recommendations Without Checkout Latency

Recommendation results are served at sub-5ms response times from Redis — invisible to the customer experience, but contributing meaningfully to session depth and average order value.

 
Built to Scale — Not Just Built to Launch

T & K has added hundreds of SKUs and expanded its customer base since launch with no architectural changes required. The containerised architecture means individual components can be scaled independently as traffic grows.

Conclusion

E-commerce done right looks invisible.

The best e-commerce platforms are the ones customers don’t think about. They browse, they find what they want, they buy, they receive. The technology underneath should be invisible — serving the business reliably, scaling gracefully, and never interrupting the purchase journey.

T & K launched across three surfaces simultaneously, processes payments through two gateways without failures, manages inventory without a single overselling incident, and gives the operations team complete commercial autonomy — all on infrastructure designed to grow alongside the business rather than constrain it.

 
Case Studies

More Work We Are Proud Of

Oh! Ride

Oh! Ride — SaaS Ride-Hailing Platform

Sri Lanka’s first zero-commission ride-hailing platform. 8 microservices, ML dynamic pricing, live 2+ years with zero major outages.

Read Case Study →
Mave

Mave — B2B Chat & Cashflow Platform

Real-time business communication merged with automatic cashflow intelligence. Delivered in 2 months with NLP transaction detection.

Read Case Study →
Servicemate

Servicemate — On-Demand Service Finder

Mobile-first service marketplace — iOS, Android, and web admin — with real-time booking and live job tracking. Built in 3 months.

Read Case Study →

Ready to build something exceptional?

Every project we take on is treated as if it were our own business. If you have an idea, a problem, or a deadline — let’s talk.