Page Background Animation
850 words
4 minutes
Double Vision — Moroccan E-Commerce Shop

Double Vision — متجر إلكتروني مغربي متكامل#

A full-stack Moroccan e-commerce platform targeting mobile-first users, built with a focus on WhatsApp-based ordering, a secure admin panel, and a fully dynamic product catalogue — no traditional backend server required.

Double Vision Homepage

🧠 The Concept#

Double Vision is an e-commerce web application built for a Moroccan seller who targets older, non-tech-savvy customers. The entire user experience is designed around simplicity and trust — customers can browse products, add them to a cart, place an order via a standard checkout form, or jump directly to WhatsApp to order with a single tap.

The business model is built on Cash on Delivery (الدفع عند الاستلام), which is the most trusted payment method in Morocco for this demographic. There is no payment gateway integration — the sale is confirmed via human contact.

A key commercial mechanic is a volume discount system baked into the pricing engine: the admin can configure custom prices for buying 2 or 3+ units, incentivising customers to buy more.

Promotional Banner

🌐 Live URL#

🏗️ Architecture Overview#

The application is a Single Page Application (SPA) with two distinct sides:

┌────────────────────────────────┐ ┌──────────────────────┐
│ STOREFRONT │ │ ADMIN PANEL │
│ (Public — / /checkout /track) │ │ (Private — /admin) │
│ │ │ │
│ - Product Catalogue │ │ - Dashboard (KPIs) │
│ - Product Detail Modal │ │ - Inventory Manager │
│ - Shopping Basket │ │ - Orders Kanban │
│ - Checkout Form │ │ - Category Manager │
│ - Order Tracking │ │ - Product Form │
│ - WhatsApp CTAs │ │ │
└───────────────┬────────────────┘ └──────────┬───────────┘
│ │
└──────────────┬────────────────────┘
│
┌─────────▼─────────┐
│ SUPABASE │
│(PostgreSQL + RLS) │
│ - Auth │
│ - Storage (Media) │
└───────────────────┘

🛠️ Tech Stack#

  • Frontend Framework: React 19
  • Build Tool: Vite 8
  • Routing: React Router DOM v7
  • Styling: Tailwind CSS v3 + Vanilla CSS custom design tokens
  • Icons: Lucide React
  • Drag & Drop: @hello-pangea/dnd (Kanban board)
  • XSS Protection: DOMPurify
  • Backend / Database: Supabase (PostgreSQL)
  • Authentication: Supabase Auth (behind a custom credential gate)
  • File Storage: Supabase Storage (images & videos)
  • Hosting: Vercel (automatic CI/CD)

🛍️ Storefront Features#

🏠 Homepage#

  • Hero section with a dynamic headline and live product preview (pulls the first active product from the database).
  • Trust bar highlighting key selling points: Free delivery, COD, 7/7 customer support.
  • Category browser — dynamic, admin-managed, scroll-able grid.
  • Product catalogue — a filterable grid of product cards. Search is supported via URL query parameter (?q=keyword).
  • Promotional volume-pricing banner — a visual section explaining the discount tiers (1 unit / 2 units / 3+ units).

🛒 Product Cards & Modal#

Each product card shows the primary image, title, description, category badge, and price. Clicking a card opens a Product Detail Modal with:

  • A media gallery with thumbnails for navigation.
  • Quantity selector with live subtotal calculation.
  • Volume pricing display (e.g., “2 units for 200 DH!”).
  • Two clear CTA paths: Add to Cart (standard checkout) or Order directly via WhatsApp.

🛒 Shopping Basket & Checkout#

  • A slide-in sidebar basket accessible from the header and the mobile bottom navigation.
  • Persisted to localStorage — survives page refresh.
  • Smart volume pricing automatically applies when the customer adds 2 or 3+ of the same item.
  • Simple Arabic checkout form: Name, Phone, Address. Validates all fields before submission.
  • On success, saves the order to Supabase and redirects to a confirmation page.

📍 Order Tracking#

Customers enter their phone number to find their orders. Displays a visual timeline showing the order’s current status (New → Confirmed → Preparing → Shipped → Delivered).

🔧 Admin Panel Features#

Admin Dashboard

🔐 Authentication#

A two-layer security system ensures absolute safety:

  1. Custom Credential Gate: Admin enters username and a secret password.
  2. Supabase Session: Behind the scenes, the app signs into the real Supabase account, obtaining a JWT for all privileged database operations. All Supabase RLS policies require an authenticated session for mutations.

📊 Dashboard & Inventory Manager#

  • Live counts for: Total Orders, New Orders, Orders In Progress, Delivered Orders, Active Products, Total Products.
  • Drag-and-drop media uploader for adding products (accepts multiple images AND videos simultaneously).
  • Per-product fields for 1-unit price, 2-unit bundle price, and 3-unit bundle price.

📋 Orders Kanban (Jira-Style System)#

A full Jira-style drag-and-drop Kanban board with three columns: New → In Progress → Delivered. Drag an order card to update its status in real time (optimistic update + Supabase write).

Jira-Style Kanban Board

Products Manager

📱 Mobile-First Design#

The site is built for phones first, with:

  • A fixed bottom navigation bar with 4 tabs (Home, Products, Cart, WhatsApp).
  • A raised, pill-shaped Cart FAB in the bottom nav.
  • Font sizes set to 16px minimum on all inputs to prevent iOS zoom-in.
  • RTL layout (direction: rtl) throughout, with Arabic as the primary language.

🔒 Security Design#

  • Row Level Security (RLS) is enabled on all Supabase tables. Public anonymous users can only SELECT products and categories.
  • All user-input text is sanitized with DOMPurify before rendering.
  • Environment variables are stored in .env and injected at build time by Vite.
  • Supabase Storage RLS policies ensure only authenticated admins can upload or modify files.

💬 WhatsApp Integration#

Rather than building a traditional payment flow, the entire sales funnel is optimized around WhatsApp:

  • Store-level CTA: Floating WhatsApp button that opens a pre-filled message.
  • Product-level CTA: Dedicated “Order via WhatsApp” button on modals.
  • Basket-level CTA: WhatsApp checkout option alongside the standard form.

Built by Sphynx — © 2026 DOUBLE VISION. All rights reserved.