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.
Problem
- Monolithic codebase tightly coupled to views and business logic
- Slow checkout flows, p95 > 4.5s on peak traffic
- Authentication and session handling vulnerable to common OWASP issues
- No clear separation for inventory, orders, and payments
Solution
- Domain‑oriented modular architecture:
auth
,catalog
,cart
,orders
,payments
- JWT for stateless auth, refresh tokens, and role‑based access control
- PostgreSQL with tuned indexes and connection pooling
- Caching for product and 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
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.