Molnz Docs

Molnz Documentation
Technical Reference
v1.0
Living Document — Continuously Updated

Molnz Technical Documentation

Comprehensive technical reference for the Molnz super app — a multi-vertical marketplace platform designed to serve the Middle Eastern market. Built with a modular, scalable architecture powered by Laravel 12 and Flutter 3, Molnz unifies food delivery, retail, services, reservations, and more under a single ecosystem.

Feb 2026
Laravel 12 + Flutter 3
10 Modules
Platform Owner
Dyar Azal
Development
Loop Company
GM. Rafid Al-Haj
Platform
Molnz (مولنز)
Multi-Vendor Marketplace

Disclaimer: This document is a living reference that is continuously updated as the platform evolves. Some sections may contain placeholders where detailed documentation is under preparation. Content accuracy is ensured at the time of each update.

Project Overview

Molnz (مولنز) is a super app — a unified multi-vertical marketplace designed for the Middle Eastern market. Rather than being a single-purpose delivery or e-commerce app, Molnz aims to consolidate multiple business verticals — food delivery, retail stores, bookings, digital goods, auctions, professional services, and international shopping — into a single platform accessible through one mobile application.

The backend is structured as 10 independent modules, each encapsulating a distinct business domain. Three modules are currently active and in production (Settings, Outlets, Users), while the remaining seven are planned for phased rollout. Each module owns its own models, controllers, migrations, seeders, routes, and views — enabling parallel development, independent deployment, and clean domain boundaries.

The platform is built with an Arabic-first (RTL) approach supporting full bilingual localization (Arabic/English). All database content stores dual-language fields (name_ar, name_en) with locale-aware accessors that automatically resolve the correct value. The architecture follows modular Domain-Driven Design (DDD) using nwidart/laravel-modules, allowing independent development and scaling of each business domain.

Technical Specifications

Core technologies, frameworks, and packages powering the platform

Backend Stack

Component Technology Version
Framework Laravel 12.x
Language PHP 8.2+
Database MySQL 8.x
Module System nwidart/laravel-modules 11.x
Authentication (API) laravel/sanctum 4.x
Media Library spatie/laravel-medialibrary 11.x
Wallet System bavix/laravel-wallet 11.x
Roles & Permissions santigarcor/laratrust 8.x
Localization mcamara/laravel-localization 2.x
Excel Export maatwebsite/excel 3.x
PDF Generation barryvdh/laravel-dompdf 3.x
Build Tool Vite 6.x

Frontend Stack (Admin Panel)

Component Technology Notes
CSS Framework Bootstrap 5 RTL Full RTL support for Arabic UI
Template Velzon Premium admin dashboard
Icons Remix Icons Via CDN
Drag & Drop SortableJS Reordering lists and items
Select Inputs Choices.js Searchable select elements
Maps Google Maps API Address picker with lat/lng
Carousel Swiper.js RTL-compatible slider

Localization Strategy

Arabic-First RTL: The platform uses Arabic as the primary language with full Right-to-Left (RTL) support. English is available as a secondary language. All UI elements, database content, and user-facing text support bilingual output. Translation keys are managed via JSON language files with 533+ keys.

System Architecture

Modular Domain-Driven Design with layered separation

Layered Architecture

The platform follows a Modular DDD approach using nwidart/laravel-modules, organizing the codebase into independent modules, each encapsulating its own domain logic.

Presentation Layer
Blade Templates Velzon Admin Bootstrap 5 RTL Vite Assets
API Layer
RESTful API Sanctum Auth JSON Resources Versioned Routes
Business Logic Layer (Modules)
Settings Outlets Delivery Users Stores Reservations Digital Products Auctions Services Global Stores
Data Layer
Eloquent ORM MySQL 8 Migrations Seeders
Infrastructure Layer
Storage Media Library Queue Cache

Standard Module Structure

Modules/{ModuleName}/
├── app/
│   ├── Http/Controllers/     # Admin & API Controllers
│   ├── Models/               # Eloquent Models
│   ├── Providers/            # Service Providers
│   └── Http/Resources/       # API Resources
├── config/                   # Module Configuration
├── database/
│   ├── migrations/           # Database Migrations
│   └── seeders/              # Data Seeders
├── resources/views/          # Module Views (if any)
├── routes/
│   ├── web.php               # Admin Routes
│   └── api.php               # API Routes
└── module.json               # Module Manifest

Platform Modules

Active

Settings

اعدادات عامة — Global configuration, cities, address types, and platform settings

Active

Outlets

ما تشتهي — Food vendors, products, categories, discounts, coupons, orders & notifications

Active

Users

المستخدمين — User accounts, addresses, roles, authentication & profiles

Planned

Delivery

التوصيل — Delivery management, drivers, tracking & logistics

Planned

Stores

المتاجر — Retail stores, inventory management & product listings

Planned

Reservations

الحجوزات — Booking management, scheduling & availability

Planned

Digital Products

المنتجات الرقمية — Digital goods, downloads & virtual items

Planned

Auctions

المزادات — Bidding system, auction management & live bidding

Planned

Services

الخدمات — Service providers, bookings & service catalog

Planned

Global Stores

متاجر عالمية — International marketplace, cross-border shopping

Mobile Application

Customer-facing mobile app built with Flutter

Component Technology Notes
Framework Flutter 3 Cross-platform (iOS & Android)
Language Dart 3.x Null safety enabled
Authentication OTP-based Phone number verification via Sanctum
Maps Google Maps Location services & address picker
Notifications Firebase FCM Push notifications
Localization Arabic / English RTL-first with English fallback

The Flutter mobile application is under active development. It communicates with the backend exclusively through the RESTful API layer using Sanctum token-based authentication. Detailed mobile architecture documentation will be available in future updates.

Settings Module

اعدادات عامة — Global platform configuration and settings management

Active

Introduction

Available

The Settings module serves as the foundational configuration layer of the Molnz platform. It manages all global reference data that other modules depend on — geographic coverage, currency definitions, and live exchange rates. This module contains 4 Eloquent models and 6 controllers, providing a centralized admin dashboard with live entity counts.

Countries & Cities — The module defines the geographic scope of the platform through a hierarchical Country → City structure. Each entity stores bilingual names (name_ar, name_en), an activation toggle (is_active), and a sort_order field for drag-and-drop reordering via SortableJS. Countries also carry an ISO code. Both support search, filtering by status, and bulk reorder operations via AJAX endpoints.

Currencies & Exchange Rates — The platform supports multiple currencies with the Yemeni Rial (YER) as the base. Each Currency stores a code, symbol, decimal precision (up to 8 places), and a formatted label accessor (e.g., "ر.ي YER"). The ExchangeRate model maintains a timestamped history of rates against YER, with a bulk-create interface that allows the admin to update all non-YER currency rates simultaneously with optional notes per entry. The exchange rate index provides both a paginated history and current-rate summary cards.

All controllers follow a consistent pattern: full CRUD + AJAX toggle for activation + drag-and-drop reordering. The admin dashboard (AdminSettingsController) aggregates live counts of countries, cities, currencies, and exchange rates into a single overview.

Entity Relationship Diagram (ERD)

Coming Soon
Detailed entity relationship diagrams will be added when this section is completed.

Sequence Diagrams

Coming Soon
Sequence diagrams illustrating key workflows will be added when this section is completed.

Use Cases

Coming Soon
Detailed use case scenarios and user stories will be added when this section is completed.

API Endpoints

Coming Soon
API endpoint documentation with request/response schemas will be added when this section is completed.

Outlets Module

ما تشتهي — Food vendors, products, discounts, orders & notifications

Active

Introduction

Available

The Outlets module is the first and largest business vertical of the Molnz super app, powering the "ما تشتهي" (What You Crave) section — the food vendor marketplace. With 11 Eloquent models and 11 controllers, it encompasses the full lifecycle of food outlet management from vendor onboarding to product catalog, pricing, and promotions. While the Outlets module is the first active vertical, it is one of many planned verticals (Stores, Services, Reservations, etc.) that will follow the same architectural patterns.

Outlet Types & Template System — The module uses a two-tier type system. OutletType defines vendor categories (e.g., Restaurants, Cafés, Bakeries) with color coding, images via Spatie Media Library, and activation controls. Each type owns template categories (OutletTypeCategory) and template addons (OutletTypeAddon) that serve as blueprints — when a new outlet is created under a type, these templates can be inherited, giving each outlet a pre-configured menu structure with the flexibility to add custom categories and addons.

Outlets & Profiles — Each Outlet belongs to a type, a user (owner), a city, and a currency. It stores GPS coordinates (latitude, longitude), open/closed status, activation state, and aggregated metrics (total_orders, total_rating). Media collections handle logo and cover images. The companion OutletProfile extends each outlet with a bilingual bio, working days schedule (JSON array), feature list, and a gallery media collection for multiple images.

Products, Options & Addons — Products belong to an outlet and a category, with bilingual names, descriptions, images, and sortable ordering. Instead of a fixed base price, each product defines its pricing through Options (OutletProductOption) — named variants like "Small", "Medium", "Large" — each with its own price and a is_default flag. The effective display price is derived from the default option. Products can also attach Addons (OutletAddon) via a many-to-many pivot, where each addon has its own price, bilingual unit label, and can be either inherited from the outlet type template or custom.

Discount & Coupon System — Both automatic discounts and code-based coupons are unified under a single Discount model with an activation field ("automatic" or "coupon"). The system supports percentage, fixed-amount, and free-delivery value types. Advanced targeting includes: outlet, product, category, and city scoping via pivot tables; audience segmentation (all users, new users, returning users); first-order-only restrictions; minimum order thresholds; per-user and total usage limits; date-range scheduling with day-of-week and time-of-day constraints; and a funding split model that tracks outlet vs. platform contribution percentages. A DiscountUsage model records each redemption with the exact amounts funded by each party.

Orders and Notifications are handled as sub-domains within this module rather than as separate standalone modules, keeping all food-related business logic tightly coupled for consistency and maintainability.

Entity Relationship Diagram (ERD)

Coming Soon
Detailed entity relationship diagrams will be added when this section is completed.

Sequence Diagrams

Coming Soon
Sequence diagrams illustrating key workflows will be added when this section is completed.

Use Cases

Coming Soon
Detailed use case scenarios and user stories will be added when this section is completed.

API Endpoints

Coming Soon
API endpoint documentation with request/response schemas will be added when this section is completed.

Users Module

المستخدمين — User accounts, addresses, roles, authentication & profiles

Active

Introduction

Available

The Users module manages all aspects of user identity, authentication, wallet operations, and profile management across the Molnz platform. With 5 Eloquent models, API and admin controllers, and dedicated Form Requests, it handles the full user lifecycle — from OTP-based phone registration through the mobile app to admin-side user management, wallet operations, and role-based access control.

Authentication — The mobile API uses a three-step OTP flow handled by AuthController: (1) sendOtp generates a time-limited OTP for a phone number with country code, (2) verifyOtp validates the code and issues a Laravel Sanctum personal access token, (3) register completes the profile with name, email, and optional avatar upload. The OTP code and expiry are stored directly on the User model and hidden from serialization for security.

User Profiles & Addresses — Each user has a one-to-one UserProfile storing gender, date of birth, home city, and a separate browsing_city_id for location-aware content delivery. Users can maintain multiple Addresses (UserAddress) with titles, descriptions, phone numbers, GPS coordinates (via Google Maps picker), city associations, address type labels, and a default designation. The model automatically unsets other defaults when a new default is chosen via a saving event hook. Avatar images are managed through Spatie Media Library with a single-file collection.

Wallet System — The module integrates Bavix Laravel Wallet, giving each user a digital wallet with deposit, withdraw, and transfer capabilities. The admin panel provides deposit functionality with required notes, paginated transaction history, and Excel export of transactions via Maatwebsite/Excel. The user detail page displays wallet balance, total deposits, and total withdrawals.

Roles & Permissions — The module integrates with Laratrust for role-based access control. Role and Permission models extend Laratrust's base classes, and the User model uses the HasRolesAndPermissions trait. The admin interface supports assigning roles during user creation and editing, enabling the multi-role architecture needed for customers, vendors, drivers, and administrators.

Entity Relationship Diagram (ERD)

Coming Soon
Detailed entity relationship diagrams will be added when this section is completed.

Sequence Diagrams

Coming Soon
Sequence diagrams illustrating key workflows will be added when this section is completed.

Use Cases

Coming Soon
Detailed use case scenarios and user stories will be added when this section is completed.

API Endpoints

Coming Soon
API endpoint documentation with request/response schemas will be added when this section is completed.

Delivery Module

التوصيل — Delivery management, drivers, tracking & logistics

Planned

Detailed Documentation Coming Soon

Comprehensive documentation for this module including introduction, ERD, sequence diagrams, use cases, and APIs is currently under preparation.

Stores Module

المتاجر — Retail stores, inventory management & product listings

Planned

Detailed Documentation Coming Soon

Comprehensive documentation for this module including introduction, ERD, sequence diagrams, use cases, and APIs is currently under preparation.

Reservations Module

الحجوزات — Booking management, scheduling & availability

Planned

Detailed Documentation Coming Soon

Comprehensive documentation for this module including introduction, ERD, sequence diagrams, use cases, and APIs is currently under preparation.

Digital Products Module

المنتجات الرقمية — Digital goods, downloads & virtual items

Planned

Detailed Documentation Coming Soon

Comprehensive documentation for this module including introduction, ERD, sequence diagrams, use cases, and APIs is currently under preparation.

Auctions Module

المزادات — Bidding system, auction management & live bidding

Planned

Detailed Documentation Coming Soon

Comprehensive documentation for this module including introduction, ERD, sequence diagrams, use cases, and APIs is currently under preparation.

Services Module

الخدمات — Service providers, bookings & service catalog

Planned

Detailed Documentation Coming Soon

Comprehensive documentation for this module including introduction, ERD, sequence diagrams, use cases, and APIs is currently under preparation.

Global Stores Module

متاجر عالمية — International marketplace & cross-border shopping

Planned

Detailed Documentation Coming Soon

Comprehensive documentation for this module including introduction, ERD, sequence diagrams, use cases, and APIs is currently under preparation.

API Reference

RESTful API endpoints for the mobile and third-party integrations

API Design Principles

  • Sanctum Authentication: Bearer token-based auth via OTP phone verification
  • Locale Header: Accept-Language: ar for bilingual responses
  • Consistent Response Format: Standardized JSON structure across all endpoints
  • API Resources: Laravel API Resources for response transformation

Current Endpoints

Method Endpoint Auth Description
POST /api/v1/auth/request-otp No Request OTP for phone authentication
POST /api/v1/auth/verify-otp No Verify OTP and receive auth token
POST /api/v1/auth/logout Yes Revoke authentication token
GET /api/v1/cities No List all active cities with areas
GET /api/v1/address-types No List available address types
GET /api/v1/user/profile Yes Get current user profile

Database Overview

MySQL 8 database with tables organized by module

Database documentation will be available when this section is activated.