# Migrating a Moroccan Store from YouCan to Next.js and NestJS

> Anass Essadikine is a Full-Stack Developer and Data & AI Engineer based in Casablanca, Morocco. He builds web applications with Next.js, React and Spring Boot, and data and AI solutions: Power BI dashboards, data pipelines, machine learning, RAG assistants and n8n automation.

- HTML version: https://essadikine.com/blog/youcan-to-nextjs-ecommerce-migration-morocco
- Version française (Markdown) : https://essadikine.com/md/fr/blog/youcan-to-nextjs-ecommerce-migration-morocco.md

- Author: Anass Essadikine
- Published: 2026-11-28
- Updated: 2026-11-28

## TL;DR

To leave a hosted builder like YouCan without losing Google traffic, migrate the full catalogue, redirect every old URL to its new page, and rebuild checkout around how customers in Morocco buy: cash on delivery, a delivery price per city and WhatsApp confirmation. For Wadoxe that meant 483 products, 37 brands and 345 cities on Next.js and NestJS.

Wadoxe sells small home appliances and cookware across Morocco: air fryers, blenders, stand mixers, vacuum cleaners, heaters. When they came to me, the shop ran on YouCan, a hosted store builder that is popular here. It worked, but the team kept hitting the same wall: anything outside the template (a promotion with its own rules, a product pack, a landing page, real SEO control) needed a workaround or was not possible at all.

So we rebuilt it. Store, back office and API, all custom. This post is about the decisions that mattered, not a feature tour.

## The constraints I started from

Four things were non-negotiable:

1. **Do not lose Google rankings.** The old store had pages that people found. Every one of them had to keep working after the switch.
2. **Arabic and French, both for real.** Not a translation plugin. Arabic right to left, with its own URLs and its own SEO.
3. **Mobile first.** Most visitors are on a phone, often on a mid-range Android and mobile data.
4. **The team runs everything alone.** Orders, stock, promotions, content. If they need me to change a banner, I failed.

And the business reality of Moroccan e-commerce: most orders are **cash on delivery**, delivery costs depend on the city, and orders get confirmed on WhatsApp before they ship.

## The stack, and why

- **Next.js 15 (React 19)** for the store, rendered on the server with caching. Product and category pages are what Google sees first, so they had to arrive as HTML, fast.
- **NestJS 11 + Prisma 6 + PostgreSQL 16** for one API shared by the store and the back office. One source of truth for prices, stock and orders.
- **pgvector** inside the same Postgres for semantic product search. I did not want a second search service to run and pay for.
- **Redis** for cache and queues, **MinIO** for images.
- **Docker** on a VPS behind **Caddy** and **Cloudflare**, deployed by **GitHub Actions**. Daily backups of the database and images, with an off-site copy.

Nothing exotic. The goal was a stack one developer can operate for years.

## Migration: the part that decides if the project succeeds

The catalogue moved over in full: **483 products, 37 brands and 25 collections**, with their photos and descriptions.

The bigger job was URLs. YouCan has its own URL patterns and the new store has clean, bilingual ones. I built a redirect for **every old address** to its new page, so links shared on WhatsApp months ago, and pages Google had indexed, land on the right product instead of a 404.

If you do a migration like this, treat the redirect map as a feature with tests, not as a task at the end. It is the difference between keeping your traffic and starting from zero.

## Built for how people actually buy in Morocco

- **Cash on delivery** by default, with coupons and a loyalty program.
- **A delivery price for each of 345 cities.** Flat shipping would either lose money on far cities or overcharge near ones.
- **Guest checkout**, because asking for an account before a first order kills conversion.
- **WhatsApp order confirmation**, and a **"call back" status** in the back office with a reminder on the day the customer asked to be called.

That last one came from how the team works: a lot of customers say "call me tomorrow". Now that is a status with a date, not a note on paper.

## A back office the team can run alone

Some of the things I am happiest with are boring on purpose:

- Bulk status changes on orders.
- Editing the products inside an existing order, with **stock and totals recalculated** automatically.
- **Abandoned carts and unsent checkout forms** that can be turned into orders. People often fill the form, then hesitate. Those are warm leads.
- Promotions, coupons, packs, a media library and a rich content editor, so marketing pages do not need a developer.
- Excel exports and sales analytics **by traffic source**, so they know which channel actually sells.
- Roles and permissions per user, **two-factor authentication** and a change history.

## Where AI actually helps (and where it does not)

I used AI for three narrow jobs, each with a person checking the result:

1. **Product pages.** Gemini drafts descriptions, the Arabic and French versions and the SEO texts. The team edits and publishes.
2. **Search.** Embeddings stored with pgvector let a search like "something to make juice" find blenders even when the word is not in the title.
3. **Order entry from a WhatsApp screenshot.** Customers send orders as screenshots. The back office reads one and pre-fills the order form.

None of these replace the team. They remove the copy and paste.

## SEO, in two languages

- Structured data for products, the organization, the website and breadcrumbs.
- Sitemaps and **Arabic/French hreflang** so each language version is indexed as its own page.
- A **Google Merchant Center feed** for Google Shopping.
- An **llms.txt** file, so AI assistants get a clean summary of the store.
- And the redirects from every old URL, which matter more than all of the above.

## What I would tell someone starting the same project

- Write the redirect map before you write the new templates.
- Model delivery cost per city from day one. Retrofitting it is painful.
- Put the "messy" real-world flows (call back later, abandoned forms, screenshot orders) in the back office as first-class features. That is where the time goes for the team.
- Keep the stack small enough that you can run it alone at 2 a.m.

The store is live at [wadoxe.com](https://wadoxe.com). The full case study, with the architecture and the complete feature list, is on my site: [Wadoxe case study](https://essadikine.com/portfolio/wadoxe-ecommerce-platform-morocco).

I am Anass Essadikine, a full-stack developer and Data & AI engineer in Casablanca. If you are planning a migration off a hosted store builder, or a bilingual Arabic store, [get in touch](https://essadikine.com/contact).

## Frequently asked questions

### Will I lose my Google rankings if I leave YouCan?

Not if every old URL redirects to its new page. On Wadoxe every old address was redirected, so indexed pages and links shared on WhatsApp still land on the right product.

### Why Next.js and NestJS for an online store in Morocco?

Next.js renders product pages on the server, so they load fast on mobile and are easy for Google to read. NestJS gives one API for the store and the back office, so prices, stock and orders have a single source of truth.

### Can a custom store handle cash on delivery and delivery prices per city?

Yes. Wadoxe uses cash on delivery by default and has a delivery price for each of 345 cities, with order confirmation on WhatsApp and a call back status in the back office.
