Souk.com Serverless E-commerce Platform Development

Job ID: 40561862

Budget: $30 – $250 USD

## Phase 1 Project Brief: souk.com
### 1. Core Architecture & Speed Foundations
* **Infrastructure:** True **Serverless architecture** (e.g., AWS Lambda or Google Cloud Functions). The souk.com backend must scale computing power automatically based on traffic.
* **Database (Keep it Simple for Now):** Use a standard relational database (like **PostgreSQL**) or NoSQL (like **MongoDB/DynamoDB**). However, the schemas *must* be strictly indexed from day one so we can swap in a dedicated search engine (like Elasticsearch) in Phase 2 without having to rewrite the souk.com app.
* **Asset Delivery:** All product listings, thumbnails, and banners must be served via a **Content Delivery Network (CDN)** with automated WebP image compression to save bandwidth.
* **UI Performance:** The frontend must maintain a minimum of **60 FPS scrolling smoothness** on mid-range Android and iOS devices. Heavy operations (image loading, data sorting) must run on background threads.
### 2. Milestone-Based Order Tracking (No Live Maps)
To keep Phase 1 simple and cost-effective, souk.com will use a milestone status bar instead of live GPS tracking.
| Milestone Status | Trigger Event | User Notification |
|---|---|---|
| **1. Order Confirmed** | SyriaCash webhook confirms payment | In-app status update |
| **2. Processing** | Warehouse picks and packs order | In-app status update |
| **3. Out for Delivery** | Driver scans/assigns batch in the morning | Automated WhatsApp (with Delivery OTP) |
| **4. Delivered** | Driver inputs correct OTP in driver app | Order closed out on server |
### 3. Conditional Proof-of-Delivery (PoD) OTP
* **Trigger Rule:** Server-side check. If the total cart value on souk.com is **greater than $50 USD**, the server flags the order for PoD verification.
* **Morning Generation:** The 6-digit OTP is generated by the server *only* when the order status changes to "Out for Delivery" in the morning.
* **Lifespan (TTL):** The OTP must remain valid for **14 hours** (e.g., 8:00 AM to 10:00 PM).
* **Driver Lockout:** The logistics app must completely lock the "Complete Delivery" button for these orders. If a driver enters an incorrect OTP 3 times, the app must lock them out of the order and instantly alert the souk.com dispatch team.
### 4. Communication & Local Integrations
* **Primary Channel (WhatsApp API):** Integrate an official Meta Business Solution Provider (like Twilio or Infobip) registered via our UAE entity/number to send automated souk.com order updates and morning OTPs to Syrian phone numbers (+963).
* **Secondary Channel (SMS Fallback):** If the WhatsApp message fails to deliver within 60 seconds, the server must automatically route the OTP via a local Syrian bulk SMS gateway.
* **SyriaCash Gateway:**
* Implement a **centralized exchange rate module** on the backend where admins can update the daily USD/SYP rate.
* The backend converts the $50+ USD threshold to SYP at checkout before handoff.
* Payment verification must rely on secure **Server-to-Server Webhooks** from SyriaCash, not the user's app.
### 5. Deliverables & Quality Assurance (QA)
Before final payment and sign-off, the development agency must provide:
1. **Load Test Report:** Proof that the serverless functions and database can handle 1,000 concurrent simulated users browsing a souk.com database of 50,000 mock listings without latency spiking above 300ms.
2. **Failure Path Demo:** Live demonstration of how the app behaves during a failed SyriaCash transaction and an offline network drop on the driver's app.