SaaS, Full-stack
Tobher — multi-tenant e-commerce platform
A “Shopify for Egypt”: Arabic-first, cash-on-delivery-native stores for small merchants.
TypeScriptNext.js 14ExpressMongoDBMongooseTailwindpnpm + TurborepoPlaywrightVitestRedisCloudflarePM2
Egyptian small sellers moving from Instagram/WhatsApp DMs need a real storefront that speaks Arabic, takes cash on delivery and costs a few hundred pounds a month. Tobher lets a merchant sign up, pick a plan and get a live store on their own subdomain — or their own domain — with orders, team roles and billing handled.
- Apps
- 4 — marketing, storefront (tenant subdomains + dashboard), super-admin, API
- Shared packages
- auth, billing, db, orders, ui, types, config, test-utils
- Plans
- Free trial (15 days) → Starter → Basic → Pro → Business (99–999 EGP/month)
- Scale of work
- 12 feature specs, 459 commits (May–Sep 2026), 300+ test files
Screens
Marketing site
Screenshots of the live landing page at tobher.com.
Architecture
- pnpm-workspace + Turborepo monorepo: four deployable apps sharing typed packages (db models, auth, billing, orders, UI).
- Shared-database multi-tenancy: every record carries a tenant id; the storefront middleware resolves the tenant once from the subdomain or custom domain.
- Storefront and tenant dashboard live on the same host (store.tobher.com and /dashboard), while the super-admin is a separate app with its own design system.
- Express API with Zod validation, Mongoose models and background jobs; MongoDB runs as a replica set so order placement can use multi-document transactions.
Merchant features
- Bilingual (Arabic / English) RTL-first storefront and a mobile-first checkout with a cash-on-delivery workflow.
- Products, categories and size-based pricing; store offers and automatic discounts; low-stock events; real-time order operations dashboard.
- Team invitations and roles, onboarding progress tracking, audit log, WhatsApp-share distribution and ad-conversion tracking.
- Custom domains on higher plans: the merchant adds three DNS records (ownership TXT, ACME CNAME, traffic CNAME) and gets an HTTPS certificate issued automatically by a dedicated worker.
Billing and plan limits
- Manual-payment billing designed for the local market: tenants pay by Instapay / Vodafone Cash / bank transfer and upload proof; the owner approves and the subscription extends one cycle.
- Five scheduled jobs run daily at 02:00 Africa/Cairo: expire trials, mint renewal invoices early, suspend non-payers, cancel long-suspended tenants and send reminders — coordinated with database locks and an audit trail.
- Order-overage pricing per plan (per-order fee with a monthly ceiling) instead of hard blocking merchants at their limit.
- A tenant state machine (trial → active → past-due → suspended → cancelled) kept consistent by a single lifecycle service.
Engineering process
- Spec-driven development: each feature (auth, storefront, custom domains, checkout, order ops, billing, launch polish, overage, offers…) has a written spec, plan and quickstart under specs/.
- Playwright end-to-end and screenshot QA per feature, Vitest unit tests, Lighthouse CI, and a custom ESLint plugin for project rules.
- GitHub Actions: CI, e2e and Lighthouse workflows; push to staging or main auto-deploys over SSH with a per-environment lock.
Infrastructure and operations
- Separate staging and production environments on a DigitalOcean droplet: PM2-managed processes, nginx, and Redis; a deploy script that installs with a frozen lockfile, runs idempotent migrations, builds sequentially to fit a 1.9 GB host and polls a health endpoint before finishing.
- DNS and page rules managed as Terraform for Cloudflare; media stored in Google Cloud Storage with scoped IAM conditions.
- Runbooks for production cutover and droplet setup, plus merchant-facing guides written in Arabic (custom domains, order overage).