# SyriaZone Project Spec

## 1. Product Vision

**SyriaZone** is a managed marketplace that connects buyers with approved merchants while keeping all buyer orders routed through SyriaZone.

The buyer can browse products and request an order easily. The merchant can manage a store and products after approval. SyriaZone acts as the trusted middle layer that receives buyer requests and forwards them to the correct merchant.

## 2. Brand Direction

- English name: **SyriaZone**
- Arabic name: **سيريا زون**
- Positioning: a large marketplace for products from many merchants
- Tone: trustworthy, modern, clear, professional
- Suggested slogan: **كل السوق بمنطقة واحدة**
- Secondary slogan: **تسوق من متاجر موثوقة، والطلب عبر SyriaZone**

## 3. Core Marketplace Model

SyriaZone has three main user types:

1. Buyer
2. Merchant
3. Admin

The important business rule:

**The buyer does not contact the merchant directly. Every order goes to SyriaZone first.**

In the first version, ordering happens through WhatsApp. Later, SyriaZone can add an internal order system, online payments, delivery management, and automated merchant notifications.

## 4. MVP Scope

The first professional version should include:

- Public homepage
- Product listing
- Product details
- Buyer registration/login
- Merchant registration/login
- Merchant approval status
- Merchant dashboard
- Product creation and management
- Admin dashboard
- Merchant approval
- Product moderation
- WhatsApp order routing to SyriaZone

## 5. User Roles

### Buyer

Buyer abilities:

- Create an account using email
- Later: login with Google
- Later: login with Apple ID
- Browse products
- Search products
- Filter by category
- Open product details
- Request product through WhatsApp

Buyer cannot:

- See merchant phone number
- Contact merchant directly from the platform
- Add products

### Merchant

Merchant abilities before approval:

- Create merchant account
- Submit store information
- Upload logo
- Wait for admin approval

Merchant abilities after approval:

- Edit store profile
- Add products
- Upload product images
- Set prices
- Set stock status
- Hide or show products
- View requests forwarded by SyriaZone in later versions

Merchant cannot:

- Receive buyer contact directly from the website
- Publish without approval if moderation is enabled
- Access other merchants' products or data

### Admin

Admin abilities:

- View all users
- Approve or reject merchants
- View all stores
- View all products
- Approve, reject, hide, or feature products
- Manage categories
- Receive WhatsApp order requests
- Match each order to the correct merchant
- Later: forward orders automatically to merchants

## 6. Authentication

MVP:

- Email and password login
- Email verification

Next phase:

- Google login
- Apple ID login

Recommended service:

- Supabase Auth

## 7. Order Flow

### MVP WhatsApp Flow

1. Buyer opens a product.
2. Buyer clicks **اطلب الآن**.
3. Platform creates or prepares an order message.
4. WhatsApp opens with SyriaZone's number.
5. Message includes:
   - Product name
   - Product ID
   - Store name
   - Price
   - Buyer name if logged in
   - Buyer city if available
   - Request date
6. SyriaZone receives the message.
7. SyriaZone forwards the request to the correct merchant manually.

Example WhatsApp message:

```text
مرحبا SyriaZone
بدي اطلب المنتج التالي:

رقم المنتج: SZ-10024
اسم المنتج: سماعات لاسلكية
السعر: 25$
المتجر: Tech Store
اسم العميل: أحمد
المدينة: دمشق
```

## 8. Public Pages

### Homepage

Purpose:

- Show that SyriaZone is a large trusted marketplace
- Give quick access to products
- Encourage merchants to join

Key sections:

- Search bar
- Featured categories
- Featured products
- Trusted merchants
- Merchant join call-to-action

### Products Page

Features:

- Product grid
- Search
- Category filter
- Price filter later
- Store filter later
- Sort by newest/popular later

### Product Detail Page

Features:

- Product images
- Product title
- Price
- Description
- Store name without direct contact
- Stock status
- WhatsApp order button to SyriaZone

### Merchant Join Page

Features:

- Explain merchant benefits
- Registration form
- Required data:
  - Name
  - Email
  - Phone
  - Store name
  - Store category
  - City
  - Short description

## 9. Dashboards

### Merchant Dashboard

Sections:

- Approval status
- Store profile
- Products
- Add product
- Product status

Product fields:

- Name
- Category
- Description
- Price
- Currency
- Images
- Stock status
- SKU or internal product code

### Admin Dashboard

Sections:

- Pending merchants
- Approved merchants
- Product moderation
- Categories
- Orders later
- Featured products

Admin decisions:

- Approve merchant
- Reject merchant
- Suspend merchant
- Approve product
- Hide product
- Feature product

## 10. Database Draft

### users

- id
- email
- full_name
- role: buyer, merchant, admin
- created_at

### merchant_profiles

- id
- user_id
- store_name
- store_slug
- logo_url
- description
- city
- phone
- status: pending, approved, rejected, suspended
- created_at
- approved_at

### categories

- id
- name_ar
- name_en
- slug
- parent_id
- is_active

### products

- id
- merchant_id
- category_id
- title
- slug
- description
- price
- currency
- stock_status: in_stock, out_of_stock, preorder
- status: draft, pending_review, published, hidden, rejected
- created_at
- updated_at

### product_images

- id
- product_id
- image_url
- sort_order

### order_requests

- id
- product_id
- merchant_id
- buyer_id
- buyer_name
- buyer_phone
- buyer_city
- whatsapp_message
- status: new, forwarded, completed, cancelled
- created_at

## 11. Recommended Tech Stack

### Web App

- Next.js
- TypeScript
- Tailwind CSS

### Backend

- Supabase
- PostgreSQL
- Supabase Auth
- Supabase Storage

### Mobile Apps Later

Option A:

- Flutter for iOS and Android

Option B:

- React Native / Expo

Recommendation:

- Start with web first.
- Build the mobile apps after the marketplace flow is proven.

## 12. Development Phases

### Phase 1: Foundation

- Create web project
- Add brand styling
- Build homepage
- Build product listing
- Build product detail page
- Add WhatsApp order button

### Phase 2: Accounts

- Add Supabase
- Add email registration
- Add buyer login
- Add merchant login
- Add merchant approval status

### Phase 3: Merchant Dashboard

- Store profile form
- Add product form
- Upload images
- Product management

### Phase 4: Admin Dashboard

- Merchant approval
- Product moderation
- Category management

### Phase 5: Growth

- Google login
- Apple ID login
- Internal order tracking
- WhatsApp Business API
- Merchant notifications
- Delivery partners
- Payment integration
- Mobile apps

## 13. Important Product Rules

- Merchant phone numbers are private.
- Buyer requests go only to SyriaZone.
- Merchants need admin approval before selling.
- Products can require admin approval before appearing publicly.
- Every product should have an internal ID.
- Every order request should be traceable to a merchant and product.

## 14. Immediate Next Build Step

Start by building the first web prototype:

- SyriaZone homepage
- Product browsing page
- Product detail page
- Merchant join page
- Static sample products
- WhatsApp order link to SyriaZone number placeholder

After that, connect authentication and database.

