---
# System prepended metadata

title: 'Back-End Design Analysis :'

---

# Back-End Design Analysis : 

## Pages :
1. Landing Page 
2. Classified Page
3. Product Page
4. Profile Page
5. Documentation Page
6. Admin Page 
---

~~- [x] Create Database Schema **(Ahmed)**~~
~~- [x] Create Connection.js and build.js **(Umar)**~~
~~- [x] Create Fake Data **(Muath)**~~

## Routes : 

 1. Landing Page 
    ~~- '/products/public?class=new'  (GET) => [4] **(Sabbah)**~~
    ~~- '/products/public?class=favs' (GET) => [4] **(Sabbah)**~~
    ~~- '/products/public?class=type' (GET) => [4] **(Sabbah)**~~
    - ~~'/products/favorites/:productId' (POST) // increase the likes in the product page and add the product to the user favorites **(Muath)**~~
    ~~- '/products/favorites/:productId' (DELETE) **(Sabbah)**~~

2. Classified Page
   - '/products/:page/:classified' (GET)  //electric,home,sport => { } **(Muath)**
   - '/products?name=userInput' (GET) **(Umar)**

3. Product Page
   ~~- '/products/:productId' (GET)  => [ ] **(Umar)**~~

4. Profile Page
   - '/products' (POST,Protected) => 201 // approved = false  **(Sabbah)** 
   - '/products/profile/:userId' (GET) //products for the user  **(Sabbah)**
   - '/products/:productId' (DELETE,protected) **(Sabbah)**
   - '/products/favorites/:userId' (GET) **(Muath)**


6. Admin Page 
   - '/products/:productId' (UPDATE,Protected) =>  [ ]  // change approved to true **(Umar)**
   ~~- '/admin/products?status={approved || pending}' (GET,Protected) =>  [ ]  **(Umar)**~~
   
   ~~- '/admin/users' (GET) => []  **(Umar)**~~
   - '/admin/users/userId' (DELETE) **(Umar)**
    
  
   
7. Public Routes 
     - '/signin' (POST) 403 = auth , 404 = db errors **(Sabbah)**
     - '/admin/login' (POST) **(Sabbah)**
     - '/signup' (POST) 403 = auth , 404 = db errors **(Umar)**
     ~~- '/logout' (GET) **(Umar)**~~
     ~~- '/admin/logout' (GET) **(Umar)**~~

---

- Database : 

- users : 
  - id 
  - name
  - email 
  - password
- products  :
  - id 
  - userId
  - name
  - class
  - type 
  - date
  - city
  - phone #
  - description 
  - price 
  - currency
  - approved => (true , false)


## Stretch Goals : 

- [ ] Socket.io 
- [ ] Redis