E-commerce Platform with an AI Sales Assistant
A full rebuild of an online retailer's shop in Morocco: a bilingual storefront, a complete back office and an AI sales assistant that understands Darija and hands over to WhatsApp.

Overview
For an online retailer in Morocco, I rebuilt the existing shop as a custom platform: a Next.js storefront in French and Arabic (right-to-left), a Next.js admin back office and a NestJS API with Prisma on PostgreSQL. The store data was imported from the old shop with dedicated scripts. On top of the shop, I built an AI sales assistant that answers customers with real products from the catalogue and escalates to WhatsApp when they want a human.
The problem
The retailer's existing shop limited what the team could manage on its own (promotions, packs, content, SEO), and customer questions mostly arrived on WhatsApp, often in Darija, with no help to point people to products in stock.
What I built
I built a NestJS API covering the whole store: catalogue, brands and categories, packs and promotions, coupons, cart sessions, orders, returns, reviews, loyalty tiers, delivery cities, CMS pages, blog, banners and analytics, with payment drivers (cash on delivery, bank transfer, card gateways). The AI assistant classifies the intent, retrieves products with keyword and semantic search (pgvector embeddings kept in sync by a scheduled job), and uses an LLM to understand Darija, French and Arabic and write the reply, while product cards stay built from live database data; when no model is available it falls back to rule-based answers. A WhatsApp inbox (Twilio) lets the team reply to customers from the back office, and AI helpers draft SEO and product content. The stack runs in Docker Compose (PostgreSQL with pgvector, Redis, MinIO, Caddy) and deploys through GitHub Actions.
Results
- Storefront, admin back office and API delivered as one Docker Compose stack with automated deploys
- French and Arabic interface with right-to-left support, and an assistant that also understands Darija
- GitHub Actions workflows for tests, image builds, deployment, load tests, health checks and logs
- Daily backup and restore scripts for the database and media storage
- User guides in French and Arabic generated from screenshots of the real interface
Highlights
- AI sales assistant: intent detection, product retrieval with pgvector, structured product and pack cards
- Darija lexicon and language detection for Latin and Arabic script messages
- WhatsApp escalation and a WhatsApp inbox in the back office
- Complete back office: products, packs, promotions, coupons, orders, returns, loyalty, CMS, SEO and analytics
- Pluggable payment drivers, including cash on delivery
- Admin security with role permissions and two-factor authentication (TOTP)


