Skip to content

YeboMart — Product Requirements Document ​

Smart Shop Management for Africa


Overview ​

YeboMart is a comprehensive point-of-sale (POS) and shop management platform designed specifically for African small businesses. It provides inventory tracking, sales processing, staff management, AI-powered business insights, and multi-country support with PPP-adjusted pricing across 15 African nations.

Status: Built and deployed
Stack: Node.js/Express + PostgreSQL + React + Stripe
Markets: Eswatini, South Africa, Kenya, Nigeria, Ghana, Tanzania, Uganda, Rwanda, Ethiopia, Ivory Coast, Senegal, Zambia, Zimbabwe, Botswana, Mozambique


1. Vision & Problem Statement ​

The Problem ​

Small shop owners across Africa face critical challenges:

  1. Paper-based chaos — Handwritten ledgers lead to errors, theft, and no visibility
  2. No inventory insight — Shops run out of popular items, dead stock ties up cash
  3. Manual calculations — Errors in pricing, change, and daily totals
  4. No business intelligence — Owners don't know what's selling, what's not, or how profitable they are
  5. Expensive software — Western POS systems cost $50-200/month — unaffordable for African tuckshops
  6. Offline reality — Internet is unreliable; solutions must work offline

The Solution ​

YeboMart provides:

  • Mobile-first POS with offline capability and barcode scanning
  • Real-time inventory tracking with low-stock alerts
  • AI assistant that answers business questions in plain language
  • PPP-adjusted pricing — E99/month in Eswatini (not $99)
  • Multi-currency & multi-country support out of the box
  • WhatsApp reports delivered daily to the owner's phone

2. Target Users ​

User TypeDescriptionKey Needs
Shop OwnerOwns a tuckshop, grocery, hardware, or retail shopBusiness insights, profit tracking, staff management
CashierFront-line staff processing salesFast POS, PIN login, simple interface
ManagerSupervises operationsStock management, void sales, view reports
AdminYeboMart platform administratorMonitor shops, manage subscriptions

3. Features by Tier ​

Tier Structure ​

TierMonthly Price (Eswatini)ProductsUsersAI Queries
LiteE991001100
StarterE4995003500
BusinessE2,4992,500102,000
ProE4,99910,0002510,000
EnterpriseE9,999UnlimitedUnlimitedUnlimited

Feature Matrix ​

Feature                 | Lite | Starter | Business | Pro | Enterprise
------------------------|------|---------|----------|-----|------------
Point of Sale           | ✓    | ✓       | ✓        | ✓   | ✓
Stock Tracking          | ✓    | ✓       | ✓        | ✓   | ✓
Basic Reports           | ✓    | ✓       | ✓        | ✓   | ✓
AI Assistant            | ✓    | ✓       | ✓        | ✓   | ✓
Barcode Scanning        |      | ✓       | ✓        | ✓   | ✓
Low Stock Alerts        |      | ✓       | ✓        | ✓   | ✓
Staff Accounts          |      | ✓       | ✓        | ✓   | ✓
WhatsApp Reports        |      |         | ✓        | ✓   | ✓
Advanced Analytics      |      |         | ✓        | ✓   | ✓
AI Voice               |      |         |          | ✓   | ✓
Multi-Location          |      |         |          | ✓   | ✓
API Access              |      |         |          |     | ✓
Dedicated Support       |      |         |          |     | ✓

4. User Journeys ​

Journey 1: Shop Owner Onboarding ​

mermaid
graph TD
    A[Download App] --> B[Select Country]
    B --> C[Enter Phone Number]
    C --> D[Create PIN]
    D --> E[Name Your Shop]
    E --> F[Choose Business Type]
    F --> G[Name AI Assistant]
    G --> H[Start Free Trial]
    H --> I[Add First Product]

Journey 2: Making a Sale ​

mermaid
graph TD
    A[Open POS] --> B{Scan or Search}
    B -->|Scan| C[Barcode Scanner]
    B -->|Search| D[Product Grid]
    C --> E[Add to Cart]
    D --> E
    E --> F{More Items?}
    F -->|Yes| B
    F -->|No| G[Select Payment]
    G --> H[Cash/Card/MoMo/eMali]
    H --> I[Print/Email Receipt]
    I --> J[Stock Updated]

Journey 3: AI Business Insights ​

mermaid
graph TD
    A[Open Assistant] --> B[Ask Question]
    B --> C[AI Analyzes Data]
    C --> D[Products + Sales + Stock]
    D --> E[Generate Insight]
    E --> F[Actionable Response]
    F --> G{Take Action?}
    G -->|Yes| H[Navigate to Feature]
    G -->|No| I[Ask Another Question]

5. Data Models ​

Core Models ​

Shop ​

prisma
model Shop {
  id                String     @id @default(cuid())
  name              String
  ownerName         String
  ownerPhone        String     @unique  // E.164 format
  ownerEmail        String?
  password          String     // Hashed
  businessType      String     @default("general")
  assistantName     String     @default("Yebo")
  
  // Localization
  countryCode       String     @default("SZ")
  phoneCountryCode  String     @default("+268")
  currencySymbol    String     @default("E")
  currency          String     @default("SZL")
  timezone          String     @default("Africa/Mbabane")
  
  // Subscription
  tier              ShopTier   @default(LITE)
  status            ShopStatus @default(ACTIVE)
  licenseKey        String?    @unique
  licenseExpiry     DateTime?
  
  // Usage Tracking
  monthlyTransactions Int  @default(0)
  monthlyStockMoves   Int  @default(0)
  monthlyAiQueries    Int  @default(0)
  
  // Relations
  users             User[]
  products          Product[]
  sales             Sale[]
  customers         Customer[]
  suppliers         Supplier[]
  // ... more relations
}

Product ​

prisma
model Product {
  id              String   @id @default(cuid())
  shopId          String
  barcode         String?
  name            String
  category        String?
  
  // Pricing
  costPrice       Float
  sellPrice       Float
  wholesalePrice  Float?
  packPrice       Float?
  packSize        Int?
  
  // Stock
  quantity        Int      @default(0)
  reorderAt       Int      @default(10)
  unit            String   @default("each")
  trackStock      Boolean  @default(true)
  isActive        Boolean  @default(true)
  
  // Relations
  shop            Shop     @relation(fields: [shopId], references: [id])
  saleItems       SaleItem[]
  stockLogs       StockLog[]
}

Sale ​

prisma
model Sale {
  id            String        @id @default(cuid())
  shopId        String
  userId        String?
  customerId    String?
  
  // Totals
  subtotal      Float
  discount      Float         @default(0)
  totalAmount   Float
  
  // Payment
  paymentMethod PaymentMethod
  amountPaid    Float
  change        Float         @default(0)
  status        SaleStatus    @default(COMPLETED)
  receiptNumber String?
  
  // Offline sync
  localId       String?
  offlineAt     DateTime?
  syncedAt      DateTime?
  
  // Relations
  items         SaleItem[]
}

User (Staff) ​

prisma
model User {
  id            String   @id @default(cuid())
  shopId        String
  name          String
  phone         String
  pin           String?  // 4-digit PIN
  role          UserRole @default(CASHIER)
  
  // Permissions
  canDiscount   Boolean  @default(false)
  canVoid       Boolean  @default(false)
  canViewReports Boolean @default(false)
  canManageStock Boolean @default(false)
  
  // Relations
  shop          Shop     @relation(fields: [shopId], references: [id])
  sales         Sale[]
}

Supporting Models ​

  • StockLog — Tracks all inventory movements with audit trail
  • Customer — Store credit customers with balance tracking
  • CustomerCredit — Individual credit transactions
  • Supplier — Vendor management with contact info
  • PurchaseOrder — Procurement tracking
  • Return — Refunds and exchanges
  • Expense — Operating expenses by category
  • DailyReport — Generated daily summaries
  • AIConversation — Chat history with AI assistant
  • AuditLog — Security audit trail
  • Admin — Platform administrators

6. API Reference ​

Authentication ​

EndpointMethodDescription
/api/v1/auth/registerPOSTRegister new shop
/api/v1/auth/loginPOSTOwner login (phone + password)
/api/v1/auth/login/userPOSTStaff login (phone + PIN)
/api/v1/auth/refreshPOSTRefresh access token
/api/v1/auth/meGETGet current user/shop

Products ​

EndpointMethodAuthDescription
/api/v1/productsGET✓List products with pagination
/api/v1/productsPOSTManagerCreate product
/api/v1/products/:idGET✓Get product by ID
/api/v1/products/:idPATCHManagerUpdate product
/api/v1/products/:idDELETEManagerSoft delete product
/api/v1/products/barcode/:codeGET✓Lookup by barcode
/api/v1/products/categoriesGET✓List categories
/api/v1/products/exportGETManagerExport CSV
/api/v1/products/bulk/importPOSTManagerBulk import
/api/v1/products/bulk/updatePOSTManagerBulk update

Sales ​

EndpointMethodAuthDescription
/api/v1/salesGET✓List sales with filters
/api/v1/salesPOST✓Create new sale
/api/v1/sales/:idGET✓Get sale details
/api/v1/sales/:id/voidPOSTManagerVoid a sale
/api/v1/sales/daily-summaryGET✓Today's summary
/api/v1/sales/search/receiptGET✓Find by receipt number
/api/v1/sales/email-receiptPOST✓Email receipt to customer

Stock ​

EndpointMethodAuthDescription
/api/v1/stockGET✓Current stock levels
/api/v1/stock/alertsGET✓Low stock alerts
/api/v1/stock/movementsGET✓Movement history
/api/v1/stock/adjustPOSTManagerAdjust stock
/api/v1/stock/receivePOSTManagerBulk restock

AI Assistant ​

EndpointMethodAuthDescription
/api/v1/ai/chatPOST✓Chat with AI assistant
/api/v1/ai/voicePOST✓Voice query (transcribed)
/api/v1/ai/insightsGET✓Generated insights
/api/v1/ai/slow-moversGET✓Slow-moving products
/api/v1/ai/summaryGET✓Business summary

Reports ​

EndpointMethodAuthDescription
/api/v1/reports/summaryGETManagerOverview stats
/api/v1/reports/dailyGETManagerDaily report
/api/v1/reports/weeklyGETManagerWeekly report
/api/v1/reports/productsGETManagerProduct performance
/api/v1/reports/staffGETManagerStaff performance

Billing ​

EndpointMethodAuthDescription
/api/v1/billing/plansGETOptionalGet pricing plans
/api/v1/billing/checkoutPOST✓Create Stripe checkout
/api/v1/billing/webhookPOST—Stripe webhook handler

Additional Endpoints ​

  • Customers — CRUD + credit management
  • Returns — Process refunds and exchanges
  • Suppliers — Vendor management
  • Users/Staff — Staff CRUD with permissions
  • Expenses — Operating expense tracking
  • License — Subscription management
  • Audit — Security audit logs
  • Admin — Platform administration

7. Service Architecture ​

┌─────────────────────────────────────────────────────────────────┐
│                         YeboMart App                            │
│                    (React + TypeScript + PWA)                   │
├─────────────────────────────────────────────────────────────────┤
│  Stores: authStore | inventoryStore | cartStore | subscription  │
│  Features: POS | Products | Stock | Sales | Reports | AI Chat   │
└───────────────────────────┬─────────────────────────────────────┘
                            │ HTTPS
                            ▼
┌─────────────────────────────────────────────────────────────────┐
│                      YeboMart API                               │
│               (Node.js + Express + TypeScript)                  │
├─────────────────────────────────────────────────────────────────┤
│ Routes: auth | products | sales | stock | ai | billing | admin  │
├─────────────────────────────────────────────────────────────────┤
│ Middleware: auth | rateLimit | validation | license | usage     │
├─────────────────────────────────────────────────────────────────┤
│ Services:                                                       │
│   AuthService    - Registration, login, JWT                     │
│   ProductService - CRUD, bulk import/export                     │
│   SaleService    - Transactions, receipts, voids                │
│   StockService   - Inventory, adjustments, alerts               │
│   AIService      - Gemini integration, insights                 │
│   BillingService - Stripe checkout, subscriptions               │
│   ReportService  - Daily/weekly/product/staff reports           │
│   LicenseService - Tier features, usage tracking                │
│   ShopService    - Shop management, usage counters              │
└───────────────────────────┬─────────────────────────────────────┘
                            │
          ┌─────────────────┼─────────────────┐
          ▼                 ▼                 ▼
    ┌──────────┐      ┌──────────┐      ┌──────────┐
    │ Postgres │      │  Gemini  │      │  Stripe  │
    │  (Neon)  │      │   API    │      │  Billing │
    └──────────┘      └──────────┘      └──────────┘

8. Authentication & Authorization ​

Auth Flow ​

  1. Shop Registration → Creates shop + generates JWT
  2. Owner Login → Phone + password → JWT (type: shop, role: OWNER)
  3. Staff Login → Phone + 4-digit PIN → JWT (type: user, role: CASHIER/MANAGER)
  4. Token Refresh → Refresh token → New access token

Roles & Permissions ​

PermissionCASHIERMANAGEROWNER
Make sales✓✓✓
View own sales✓✓✓
Apply discountsconfigurable✓✓
Void sales—✓✓
View reportsconfigurable✓✓
Manage stockconfigurable✓✓
Manage products—✓✓
Manage staff——✓
Billing/Settings——✓

JWT Structure ​

typescript
interface ITokenPayload {
  id: string;      // User or Shop ID
  shopId: string;  // Always the shop ID
  phone: string;
  email?: string;
  role: 'OWNER' | 'MANAGER' | 'CASHIER';
  type: 'shop' | 'user' | 'admin';
}

9. Billing & Pricing ​

Multi-Country Pricing ​

YeboMart uses PPP-adjusted pricing across 15 African countries:

CountryCurrencyLiteStarterBusinessProEnterprise
🇸🇿 EswatiniSZLE99E499E2,499E4,999E9,999
🇿🇦 South AfricaZARR99R499R3,499R6,999R13,999
🇰🇪 KenyaKESKSh999KSh4,999KSh19,999KSh39,999KSh79,999
🇳🇬 NigeriaNGN₦9,999₦49,999₦199,999₦399,999₦799,999
🇬🇭 GhanaGHSGH₵99GH₵499GH₵2,699GH₵5,499GH₵10,999
🇹🇿 TanzaniaTZSTSh9,999TSh49,999TSh249,999TSh499,999TSh999,999
🇺🇬 UgandaUGXUSh19,999USh99,999USh499,999USh999,999USh1,999,999
🇷🇼 RwandaRWFFRw4,999FRw24,999FRw124,999FRw249,999FRw499,999
🇪🇹 EthiopiaETBBr499Br2,499Br12,499Br24,999Br49,999
🇨🇮 Ivory CoastXOFCFA2,999CFA14,999CFA84,999CFA169,999CFA339,999
🇸🇳 SenegalXOFCFA2,999CFA14,999CFA64,999CFA129,999CFA259,999
🇿🇲 ZambiaZMWZK99ZK499ZK2,499ZK4,999ZK9,999
🇿🇼 ZimbabweUSD$3$15$79$149$299
🇧🇼 BotswanaBWPP149P799P4,499P8,999P17,999
🇲🇿 MozambiqueMZNMT99MT499MT2,499MT4,999MT9,999

Prices shown are Launch Special discounts (75-86% off)

Stripe Integration ​

  • Checkout Flow: One-time payment → License update
  • Webhook Events: checkout.session.completed → Tier upgrade
  • Currency Handling: Convert to USD for Stripe-unsupported currencies

10. Technical Stack ​

Backend ​

ComponentTechnology
RuntimeNode.js 20.x
FrameworkExpress 4.x
LanguageTypeScript 5.x
ORMPrisma 5.x
DatabasePostgreSQL (Neon)
AuthJWT (jsonwebtoken)
ValidationJoi
AIGoogle Gemini 2.0 Flash
PaymentsStripe
File StorageCloudflare R2
HostingGoogle Cloud Run

Frontend (App) ​

ComponentTechnology
FrameworkReact 18
LanguageTypeScript
RoutingReact Router 6
StateZustand
Data FetchingTanStack Query
StylingTailwind CSS
IconsHeroicons
OfflineIndexedDB (Dexie)
BuildVite
HostingCloudflare Pages

Admin Dashboard ​

ComponentTechnology
FrameworkReact 18
ChartsRecharts
IconsLucide React
StylingTailwind CSS

11. Gaps & Future Improvements ​

Current Gaps ​

  1. Offline Sync — Framework exists but not fully implemented
  2. WhatsApp Reports — Designed but not connected
  3. Multi-Location — Schema ready, UI not built
  4. Voice Input — Endpoint exists, mobile mic integration needed
  5. Receipt Printing — Browser print only, no Bluetooth/thermal

Planned Features ​

FeaturePriorityStatus
Full offline mode with syncHighPartial
WhatsApp daily report deliveryHighDesigned
Supplier auto-reorder suggestionsMediumNot started
Multi-location stock transfersMediumSchema ready
Accounting module integrationMediumNot started
Customer loyalty/points systemLowNot started
API access for Enterprise tierLowNot started

Technical Debt ​

  • Standardize error handling across all routes
  • Add comprehensive test coverage
  • Implement proper offline conflict resolution
  • Add request logging and observability
  • Optimize database queries for large inventories

12. Success Metrics ​

Business Metrics ​

  • Monthly Active Shops — Target: 1,000 by Q4 2026
  • Paid Conversion Rate — Target: 15%
  • Monthly Recurring Revenue — Track by country
  • Churn Rate — Target: <5% monthly

Product Metrics ​

  • Daily Transactions Processed — Growth indicator
  • AI Query Usage — Feature adoption
  • Average Session Duration — Engagement
  • Feature Adoption by Tier — Upsell opportunities

Technical Metrics ​

  • API Response Time — P95 < 500ms
  • Uptime — 99.9% target
  • Sync Success Rate — For offline mode
  • Error Rate — < 0.1% of requests

Appendix: Business Types ​

YeboMart supports various shop types with tailored categories:

  • Tuckshop — Small convenience store
  • Grocery — Food and household items
  • Hardware — Construction and tools
  • Pharmacy — Medicines and health products
  • Salon/Barbershop — Beauty services
  • Electronics — Phones, accessories, repairs
  • Clothing — Fashion and apparel
  • Restaurant/Fast Food — Food service
  • General — Multi-category retail

Each type comes with pre-configured product categories and suggested units.

One chat. Everything done.