Building a commerce platform that stays lightweight when the business is small — and ready when it grows.
ShappX is a physical and online sportswear retailer selling jerseys, sneakers, tracksuits, caps, bags, and accessories. Morphlix designed and built the platform around the realities of the business: customers discover products online, place orders through a lightweight storefront, confirm orders over WhatsApp, and walk into the physical store to buy directly from the counter. Instead of running a traditional always-on commerce stack, Morphlix rebuilt the platform around serverless infrastructure — replacing persistent application and database infrastructure with an on-demand architecture that consumes resources as the business is actually used.
- SMB
- AWS
- Serverless
- Cloud Modernization
- Industry
- Retail · Commerce
- Engagement
- Studio build
Results
3
Connected commerce experiences
One platform powers the customer storefront, merchant back office, and physical-store till — each designed around its own operational role.
0
Always-on application servers
The backend runs entirely on AWS Lambda, while commerce data is stored in Amazon DynamoDB on demand.
1
Serverless data layer
A single DynamoDB table replaced the previous PostgreSQL/RDS architecture, removing the always-on database infrastructure that was disproportionate to the business's workload.
The challenge
A small retailer shouldn't need enterprise infrastructure to sell online.
ShappX needed to support two worlds at the same time. There was the online storefront, where customers browse products, select variants, add items to a cart, and place orders. Then there was the physical store, where staff need to search products, process counter sales, manage inventory, and see orders without waiting for a complex backend stack to respond. The challenge was not simply building an ecommerce website. It was building the operating system behind a small retail business without introducing infrastructure costs and operational complexity that the business did not need.
Online and physical sales needed one source of truth
A product sold at the counter needs to affect the same inventory that customers see online. A new order placed online needs to appear in the back office. The system therefore needed one consistent commerce data model across both channels.
The database was costing more than the business needed
The original backend used PostgreSQL with a persistent RDS database. For a small retail operation with highly variable traffic, keeping database infrastructure running continuously was difficult to justify. Most of the time, there simply wasn't enough traffic to warrant a permanently running database.
The storefront and back office have different jobs
The customer-facing storefront needs fast, cacheable, SEO-friendly product pages. The back office needs operational screens, inventory management, order processing, reporting, and a physical-store till. Putting everything into one application would couple release cycles and introduce unnecessary runtime requirements.
WhatsApp is part of the buying journey
The web checkout creates the order, but customer confirmation happens over WhatsApp. The platform therefore needed to treat WhatsApp as part of the commerce workflow rather than as a marketing widget bolted onto the storefront.
Morphlix rebuilt the platform around the actual business: lightweight online commerce, physical retail, and conversational order confirmation.
The solution
Three experiences. One commerce system.
Morphlix separated ShappX into three independently deployed experiences while keeping them connected through a shared backend and data model.
Customer storefront
The customer-facing storefront is built with Next.js and the App Router, using incremental static regeneration to keep product pages fast while allowing catalogue changes to appear without a full rebuild. Customers can: Browse the catalogue, Filter products by category, View product details, Select variants and sizes, Add products to cart, Save favourites, Submit orders, Select payment preferences, Receive a human-readable order number and Continue the conversation through WhatsApp. Product pages are prerendered and refreshed through ISR, allowing the storefront to remain highly cacheable without requiring a permanently running application server.
Merchant back office
A dedicated Vite single-page application provides the operational interface for the business. Staff can manage: Products, Variants, Categories, Inventory, Orders, Customers, Promotions, Store settings, Storefront content, Product imagery and Payment preferences. The back office loads its operational data through a consolidated bootstrap request and then operates as an interactive application.
Physical-store till
The back office also contains a dedicated Till experience for counter sales. Staff can search by: Product name, SKU and Barcode. Variant selection and quantity controls are driven by the actual inventory available on the shelf. When a counter sale is completed, the order is recorded and inventory is reduced atomically. If another transaction has already consumed the stock, the sale is rejected rather than allowing the inventory to become inconsistent.
Online orders and physical sales therefore operate against the same commerce state.
Architecture
Replacing always-on infrastructure with an on-demand commerce stack.
The original ShappX backend used PostgreSQL and Amazon RDS.
Morphlix redesigned the architecture around the actual workload and moved the application to a fully serverless compute and data model.
The result is a significantly smaller operational footprint.
Edge & delivery
Customer traffic enters through: Amazon Route 53 → AWS WAF → Amazon CloudFront. CloudFront provides the delivery layer while AWS WAF protects the public edge. Traffic is then routed to the appropriate application surface.
Storefront
The Next.js storefront runs on AWS Amplify and uses incremental static regeneration. Product pages can therefore be served efficiently without maintaining an always-running application server.
Merchant application
The Vite admin application is compiled into static assets and delivered through: Amazon S3 → Amazon CloudFront. There is no application server required for the merchant interface.
API
The backend is a Go application running on AWS Lambda behind Amazon API Gateway. There are no always-on application servers. Lambda scales with requests and remains idle when the business is idle.
Data
The backend uses a single Amazon DynamoDB table using a composite: PK + SK data model. This replaced the previous PostgreSQL/RDS architecture. The single-table model was designed around the access patterns of the application rather than around relational tables. Products, categories, orders, variants, and related records are represented through partition and sort-key relationships, allowing the API to retrieve related records through DynamoDB queries rather than full-table scans.
Supporting services
The architecture also uses AWS managed services for: Amazon S3, Amazon SQS, Amazon SNS, Amazon EventBridge, Amazon CloudWatch, AWS X-Ray, AWS Secrets Manager and AWS Certificate Manager. The result is a platform where infrastructure scales with actual activity instead of remaining continuously provisioned.
The Data Model
Moving from relational transactions to atomic serverless writes.
Moving from PostgreSQL to DynamoDB was not simply a database migration.
The data model had to change.
Three relational patterns were particularly important.
The migration was therefore not “Postgres replaced with DynamoDB.” It was a redesign around the way the application actually reads and writes data.
Transactions
Several records that previously required a database transaction were redesigned so the required information could be embedded into the parent record. This allowed the operation to become a single atomic DynamoDB write.
Sequential order numbers
The original system relied on database-generated numeric identifiers. The new system uses atomic counter records to generate human-readable order numbers such as: SX-1043. This also eliminates the race condition associated with generating identifiers through a MAX(id) + 1 approach.
Sorting
Relational ORDER BY operations were replaced with access-pattern-specific ordering. Where ordering matters for DynamoDB queries, the sort key encodes the required ordering information. Where datasets are already bounded by a query, ordering can be applied after retrieval.
Commerce Without a Payment Gateway
Checkout captures intent. WhatsApp closes the loop.
ShappX deliberately does not process online card payments.
Instead, checkout captures the customer's preferred payment method: Bank transfer, Pay on delivery and Card.
The order becomes the system record, while WhatsApp remains the primary customer confirmation channel.
This removes unnecessary payment infrastructure from the first version of the product while keeping the customer journey familiar.
WhatsApp is integrated throughout the experience: Floating WhatsApp contact, Footer contact, Order confirmation messaging and Direct customer communication.
The web creates the order. WhatsApp continues the conversation.
Inventory & Point of Sale
The till and storefront share the same stock.
Physical retail introduces a problem that many ecommerce implementations overlook.
A product can be sold online and at the counter within seconds of each other.
ShappX handles this at the data layer.
When a counter sale is completed, the order and inventory adjustment are performed atomically.
Each product's stock is checked against the quantity recorded at the time of sale.
If the stock has changed in the meantime, the transaction fails rather than allowing a second sale to create an invalid inventory state.
This makes the POS more than a separate screen.
It is another interface into the same commerce system.
The Serverless Migration
The goal wasn't to make the architecture bigger. It was to make it appropriate.
The original architecture used infrastructure designed around a traditional web application.
That introduced a fixed database cost even when the business had little or no traffic.
Morphlix looked at the actual workload and redesigned the system around three principles.
Pay for activity
Compute should run when requests arrive rather than remain online waiting for requests.
Keep the data model close to the access patterns
DynamoDB should not be treated like a relational database. The application was redesigned around predictable partition and query patterns.
Remove infrastructure that doesn't create product value
The new architecture eliminates the need to operate: Persistent API servers, Persistent database instances, Database connection pools and Traditional database replication management. The result is a smaller platform with fewer moving parts and a much lower idle footprint.
Engineering the Details
The hard parts were not the AWS icons. They were the boundaries between them.
The migration exposed several problems that only appeared when the system was exercised end to end.
The image pipeline had to be redesigned around DynamoDB's item-size constraints. Uploaded images are now cropped and re-encoded to a controlled 900×900 JPEG output before storage.
The deployment process was hardened after environment configuration was found to be capable of overriding production values with development configuration.
The catalogue was also made safe to reseed without resurrecting deleted products.
The admin experience was separated from the customer storefront so the two applications could evolve and deploy independently.
The domain and DNS configuration was moved into Route 53, giving the platform a single managed DNS layer.
Testing was added from a previously empty test suite to approximately 50 Go tests alongside a 95-assertion end-to-end suite covering the deployed API and critical commerce flows.
The result wasn't simply a cheaper architecture. It was a more deliberate one.
Technology stack
A deliberately small AWS footprint.
Edge & delivery
- Amazon Route 53
- AWS WAF
- Amazon CloudFront
- AWS Amplify
- Amazon S3
- AWS Certificate Manager
Compute
- AWS Lambda
- Amazon API Gateway
Data
- Amazon DynamoDB
Events & messaging
- Amazon EventBridge
- Amazon SQS
- Amazon SNS
Security & operations
- AWS Secrets Manager
- Amazon CloudWatch
- AWS X-Ray
Application
- Go
- net/http
- Next.js
- React
- Vite
Outcome
A retail platform that scales down as naturally as it scales up.
Morphlix transformed ShappX from a conventional ecommerce application into a serverless commerce platform designed around the actual scale of the business.
The platform now supports three connected experiences — the online storefront, merchant back office, and physical-store till — through a single backend and data model.
The backend runs on Lambda, the data layer uses DynamoDB on demand, and the customer-facing applications are delivered through managed AWS services.
That means the platform does not need a fleet of servers or an always-running database waiting for the next customer.
When the store is quiet, the infrastructure can be quiet too.
At the same time, the architecture leaves room to grow: more products, more orders, more customers, and more traffic can increase consumption without requiring the team to redesign the application around a larger server footprint.
Outcome
From ecommerce website to lightweight commerce infrastructure.
ShappX demonstrates a principle we apply across Morphlix builds:
Infrastructure should follow the business, not the other way around.
For a growing retailer, that meant replacing always-on infrastructure with an architecture that is: Serverless, On-demand, Operationally lightweight, Cost-conscious, Designed around real access patterns and Shared across online and physical commerce.
The result is not an over-engineered ecommerce platform.
It is a commerce system sized for the business today, with an architecture capable of growing with it tomorrow.
More from the library.
All case studiesAI · Productivity
Building Seshira: an AI-native project management platform
Replacing fragmented project workflows with one cloud-native workspace where the agent and the team call the same tools.
Commerce Infrastructure
Commerce infrastructure for African businesses
POS, WhatsApp-native ordering, multi-location inventory and a double-entry ledger in one platform.
Work with the studio
Ready to future-proof
your infrastructure?
Tell us what you are building and where the current stack is holding you back. We will come back with an architecture and a plan.