Contents
Share this article
ADHURI CART – Scalable E‑commerce Backend with Adonis.js
Overview
ADHURI CART is a scalable e‑commerce backend built on Adonis.js with JWT authentication, PostgreSQL, caching, and robust observability. The goal was to modernize a legacy monolith that caused slow checkouts and recurring security incidents.

Before → After (Checkout p95)
2.6s → 1.5s (−42%)
| Metric | Before | After | Change |
|---|---|---|---|
| Checkout p95 | 2.6s | 1.5s | −42% |
| Error rate | 1.8% | 0.6% | −66% |
| Uptime (90d) | 99.2% | 99.9% | +0.7 pp |
Problem
- Monolith tightly coupled to views and business logic
- Slow checkout flows (p95 > 4.5s on peak traffic)
- Auth/session handling vulnerable to common OWASP issues
- No separation for inventory, orders, payments
Solution
- Domain‑oriented modular architecture:
auth,catalog,cart,orders,payments - JWT for stateless auth + refresh tokens and RBAC
- PostgreSQL with tuned indexes and connection pooling
- Caching for product/cart reads to reduce DB load
- Queues for order fulfillment and email notifications
- Observability: structured logging, metrics, health checks

Architecture
- API gateway exposes RESTful endpoints with versioning (e.g.,
/v1/orders) - Service layer encapsulates domain rules; repositories handle persistence
- Validation at the edge; rate limiting and input sanitization
Outcomes
- Checkout time: −42% (p95 ~ 2.6s → 1.5s)
- Uptime: 99.9% sustained over 90 days
- Compliance: aligned with OWASP best practices
Timeline
- Discovery & planning: 1 week
- Implementation: 3–4 weeks
- Stabilization & launch: 1 week
Stack
- Adonis.js, TypeScript, PostgreSQL, Redis, JWT, REST
Key Learning
Modular boundaries and observability drove most of the reliability gains while JWT + RBAC simplified auth flows across services.
Share this article
TagsCase StudiesWeb DevelopmentProgramming
STAY UPDATED
Join my newsletter
Get the latest articles, tutorials, and updates delivered straight to your inbox. No spam, unsubscribe anytime.

