HOMY Website https://www.figma.com/file/PcvdanDPepHWlgwj24AQo5/Homy-Ecommerce?node-id=2%3A3 Dashboard: 1/ Products list (add, edit, delete, sort , search ) 2/ Users list (view, add, edit, delete, sort , search ) 3/ Categories list 4/ brands list 5/ bannar form / list 6/ Account info 7/ login form /logout 8/ Reports 9/ Home Page (charts) --------------------------------------------------------------------------------- Routes For Dashboard # /api/v1/dashboard/admin { mehtod: post} => send in the body of request { email, password} # /api/v1/permission-role?roleId=?? {method:get} ==> this is request should do after login /Done # /api/v1/roles{method:get}just admin you can do that /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/roles {method : post } just admin you can do that /Done =>send token in headers for request like this "Bearer ${token}" => send body for requerst like this { "name": "special employee", "permissionPage":[{ "permissionId":1, "pageId":2 },{ permissionId":2, pageId:1 }] } # /api/v1/permissions {method : get} just admin you can do that =>send token in headers for request like this "Bearer ${token}" # /api/v1/pages {method : get} just admin you can do that =>send token in headers for request like this "Bearer ${token}" /Done # /api/v1/employee {method : post} just admin you can do that /Done =>send token in headers for request like this "Bearer ${token}" => send in body { name,email,password,phone,roleId} # /api/v1/users-employees {method : get} just admin you can do that /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/role/:id {method:delete} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/user/:id {method:delete} /Done =>send token in headers for request like this "Bearer ${token}" ****For Banners هنا بدك تعدلي بكل ريكوست وتحطي الpathname # /api/v1/dashboard/banners { method:get } /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/banner {method:post} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { name,image} # /api/v1/dahboard/banner/:id { method:put} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { name,image} **For Brands** هنا بدك تعدلي بكل ريكوست وتحطي الpathname # /api/v1/dashboard/brands { method:get } /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/brand {method:post} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { name,image} # /api/v1/dahboard/brand/:id { method:put} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { name,image} ****For products هنا بدك تعدلي بكل ريكوست وتحطي الpathname # /api/v1/dashboard/products {method:get} /Done =>send token in headers for request like this "Bearer ${token}" => when send query like this ?archive=true get all archived products otherwise not send query get all not archived products # /api/v1/dashboard/product{method:post} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { name,price,image,albums,description,quickOverview,discount,shipment,brand,inStock,subCategoryId, categoryId, } # /api/v1/dashboard/product/:id{method:put} /Done =>send token in headers for request like this "Bearer ${token}" => send in body {name,price,image,albums,description,quickOverview,discount,shipment,brand,inStock,subCategoryId, categoryId, } # /api/v1/dashboard/product/:id{method:delete} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/product/:id/archive {method:put} /Done =>send token in headers for request like this "Bearer ${token}" => when send query like this ?archive=true you will archived product otherwise not send query you will not archived product ****For categories هنا بدك تعدلي بكل ريكوست وتحطي الpathname # /api/v1/dashboard/categories {method:get} /Done =>send token in headers for request like this "Bearer ${token}" => when send query like this ?archive=true get all archived categories otherwise not send query get all not archived categories # /api/v1/dashboard/category{method:post} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { name,image,place, hasSubCategories} # /api/v1/dashboard/category/:id{method:put} =>send token in headers for request like this "Bearer ${token}" => send in body { name,image,place, hasSubCategories} # /api/v1/dashboard/category/:id{method:delete} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/category/:id/archive {method:put} /Done =>send token in headers for request like this "Bearer ${token}" => when send query like this ?archive=true you will archived category otherwise not send query you will not archived categoriy ****For sub-categories هنا بدك تعدلي بكل ريكوست وتحطي الpathname # /api/v1/dashboard/sub-categories {method:get} /Done =>send token in headers for request like this "Bearer ${token}" => when send query like this ?archive=true get all archived sub categories otherwise not send query get all not archived sub categories # /api/v1/dashboard/sub-category{method:post} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { name,categoryId } # /api/v1/dashboard/sub-category/:id{method:put} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { name,categoryId } # /api/v1/dashboard/sub-category/:id{method:delete} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/sub-category/:id/archive {method:put} /Done =>send token in headers for request like this "Bearer ${token}" => when send query like this ?archive=true you will archived sub category otherwise not send query you will not archived sub categoriy ******For orders هنا بدك تعدلي بكل ريكوست وتحطي الpathname # /api/v1/dashboard/order/:id/status {method:put} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { status } just one of that { complete, reject,pending } # /api/v1/dashboard/orders {method:get} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/employee/:id/update-role { method: put } :id the id for the user /Done =>send token in headers for request like this "Bearer ${token}" => send in body { roleId } *For Home in Dashboard***************************** # /api/v1/dashboard/order-status {method:get} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/top-products?dashboard=true {method:get} =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/statistics {method:get} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/order-month {method:get} =>send token in headers for request like this "Bearer ${token}" ****For Promo Codes # /api/v1/dashboard/promo-codes {method:get} /Done ببعت هنا الpathname =>send token in headers for request like this "Bearer ${token}" # /api/v1/dashboard/promo-code{method:post} /Done ببعت هنا الpathname =>send token in headers for request like this "Bearer ${token}" => send in body { name,discount} # /api/v1/dashboard/promo-code/:id{method:put} ببعت هنا الpathname /Done =>send token in headers for request like this "Bearer ${token}" => send in body { discount } # /api/v1/dashboard/promo-code/:id{method:delete} ببعت هنا الpathname /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/promo-code/:name {method:get} هادا عند اليوزر # /api/v1/dashboard/user/:id {method:delete} /Done =>send token in headers for request like this "Bearer ${token}" ## HOMY Pages : -1 Sign In -2 Sign up -3 Home (Header, Mune, slider, Shop By category, Super Deals, Top Sellers, Smart home systems, bannar, BRANDS CURRENTLY TRENDING, footer) -4 Products (filter, search , sort, add to cart) -5 Product Details -6 Cart Page -7 Shipping & Payment -8 Confirm Order -9 Account Information, Address Information (Edit , change password) -10 FAQ -10 About Us -11 Empty Cart - Page Not Found -12 Order Status -13 Order Review # Routes in Backend Not Finished #### Frontend ## Order Task flow: ![](https://i.imgur.com/z3nSNR2.png) ## Dashboard: ## Backend Routes # /api/v1/categories {method : get} / Done => to get all categories # /api/v1/categories?place=in {method : get} / Done => to get indoor categories # /api/v1/categories?place=out {method : get}/ Done => to get outdoor categories ****** # /api/v1/subCategories/:categoryId {method : get} => to get subcategories for each category ****** # /api/v1/product/:productId {method : get} / Done => get single product by id # /api/v1/product/:productId/review {method : get} /Done => get reviews for single product # /api/v1/product/:productId/rate {method : get} /Done => get atings for single product ****** - **validation must be also in front like this => name--- string().required('Name is required'), email--- string().email('Your email must be a valid email').required('Your email is required to register'), phone--- string().min(12, 'your phone number must be 12 digits').required('Your phone number is required'), password--- string().min(8, 'Your password must be 8 digits at least').required('Password is required'), # /api/v1/signup {method : post} / Done =>send in body for request { name,email,phone,password } + add in .env SECRET_KEY = homyKuwait2022 # /api/v1/signin {method : post} / Done =>send in body for request { email,password } # /api/v1/user/:id/update {method : put} / Done =>send token in headers for request like this "Bearer ${token}" => send in body { name, email , phone } and must this validation like above # /api/v1/user/:id/address {method : get} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/user/:id/address {method : post} /Done =>send token in headers for request like this "Bearer ${token}" => send in body { city, area , street, block, building } and must be not empty value # /user/:id/address/:addressId {method : delete} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/user/:id/address {method : put } /Done =>send token in headers for request like this "Bearer ${token}" => send in body { city, area , street, block, building }=>id for address and must be not empty value # /api/v1/user/:id/address/default {method : put } /Done =>send token in headers for request like this "Bearer ${token}" => send in body { id }=>id for address and must be not empty value # /api/v1/product/super {method : get } /Done => return all products that have discount >=50 # /product/:productId/review { method : post } =>send token in headers for request like this "Bearer ${token}" => send in body { comment, rate }=> and must be not empty value # /api/v1/user/:id/change-password {method : put } / Done =>send token in headers for request like this "Bearer ${token}" => send in body { newPassword, oldPassword }=> and must be not empty value # /api/v1/user/:id/orders {method : get } /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/single-order/:orderNumber {method : get } /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/single-order {method : post } /Done => send in body { email, orderNumber }=> and must be not empty value # /api/v1/order {method: post} /Done => send in body { email, phone, name, amount, payment, products, addresses, orderNumber} You must suer the addresses send in array like this [city,area,street,block, building] "addresses": [ "Kuwait", "First Residence Building", "Kuwait Street", "2", "10" ] مهم جداااااا الترتيب You must suer the products send in array like this [[product_id,quantity]] "products": [ [ "4", "10" ], [ "1", "1" ], [ "5", "3" ] ] مهم جداااااا الترتيب # /api/v1/brands { method: get} / Done # /api/v1/search { method: get} / Done => send query in the request {?productName= ??} # /api/v1/top-seller /Done # /api/v1/user/:id/cart { method: get} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/user/:id/cart/:productId { method: delete} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/user/:id/cart { method: post} /Done =>send token in headers for request like this "Bearer ${token}" => send in body like this ((((Be sure the id and quantity is send for each product in array )))) "carts": [ { "id": 2, "name": "Acer SB220Q bi 21.5 inches Full HD (1920 x 1080) IPS Ultra-Thin", "price": 5.5, "image": "https://fakestoreapi.com/img/81QpkIctqPL._AC_SX679_.jpg", "albums": [ "https://fakestoreapi.com/img/81QpkIctqPL._AC_SX679_.jpg", "https://fakestoreapi.com/img/81QpkIctqPL._AC_SX679_.jpg" ], "description": "21. 5 inches Full HD (1920 x 1080) widescreen IPS display And Radeon free Sync technology. No compatibility for VESA Mount Refresh Rate: 75Hz - Using HDMI port Zero-frame design | ultra-thin | 4ms response time | IPS panel Aspect ratio - 16: 9. Color Supported - 16. 7 million colors. Brightness - 250 nit Tilt angle -5 degree to 15 degree. Horizontal viewing angle-178 degree. Vertical viewing angle-178 degree 75 hertz", "quick_overview": "21. 5 inches Full HD (1920 x 1080) widescreen IPS display And Radeon free Sync technology. No compatibility for VESA Mount Refresh Rate: 75Hz - Using HDMI port Zero-frame design | ultra-thin | 4ms response time | IPS panel Aspect ratio - 16: 9. Color Supported - 16. 7 million colors. Brightness - 250 nit Tilt angle -5 degree to 15 degree. Horizontal viewing angle-178 degree. Vertical viewing angle-178 degree 75 hertz", "discount": 50, "brand": "Acer", "instock": true, "sub_category_id": null, "createdat": "2022-08-09T15:54:17.057Z", "category_id": 1, "quantity":6 }, ] # /api/v1/user/:id/wishlist { method: get } /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/user/:id/wishlist/:productId { method: delete} /Done =>send token in headers for request like this "Bearer ${token}" # /api/v1/user/:id/wishlist { method: post} /Done =>send token in headers for request like this "Bearer ${token}" => send in body like this ((((Be sure the id is send for each product in array )))) "wishlists": [ { "id": 2, "name": "Acer SB220Q bi 21.5 inches Full HD (1920 x 1080) IPS Ultra-Thin", "price": 5.5, "image": "https://fakestoreapi.com/img/81QpkIctqPL._AC_SX679_.jpg", "albums": [ "https://fakestoreapi.com/img/81QpkIctqPL._AC_SX679_.jpg", "https://fakestoreapi.com/img/81QpkIctqPL._AC_SX679_.jpg" ], "description": "21. 5 inches Full HD (1920 x 1080) widescreen IPS display And Radeon free Sync technology. No compatibility for VESA Mount Refresh Rate: 75Hz - Using HDMI port Zero-frame design | ultra-thin | 4ms response time | IPS panel Aspect ratio - 16: 9. Color Supported - 16. 7 million colors. Brightness - 250 nit Tilt angle -5 degree to 15 degree. Horizontal viewing angle-178 degree. Vertical viewing angle-178 degree 75 hertz", "quick_overview": "21. 5 inches Full HD (1920 x 1080) widescreen IPS display And Radeon free Sync technology. No compatibility for VESA Mount Refresh Rate: 75Hz - Using HDMI port Zero-frame design | ultra-thin | 4ms response time | IPS panel Aspect ratio - 16: 9. Color Supported - 16. 7 million colors. Brightness - 250 nit Tilt angle -5 degree to 15 degree. Horizontal viewing angle-178 degree. Vertical viewing angle-178 degree 75 hertz", "discount": 50, "brand": "Acer", "instock": true, "sub_category_id": null, "createdat": "2022-08-09T15:54:17.057Z", "category_id": 1, "quantity":6 }, ] # /api/v1/products/:categoriesId/recommended { method: get } /Done => in the single product page when get information for product send this request to get similar 4 product in the same page # /api/v1/forget-password { method : patch } /Done => send in body for the request {email} there have must and the end send email for the user # /api/v1/reset-password/:token { method : patch } /Done => send in body for the request {newPassword} # /api/v1/products?categoryId=&place=&page= {method : post} /Done place in when choose indoor and out when choose outdoor =>send in body if you don't have subCategory must be value 0 { "filter": { "minPrice":"0", "maxPrice":"10000", "subCategory":"0", "brands":[] } } # /api/v1/banners {method : get} /Done # /api/v1/categories/:categoryId { method : get } / Done *before* # /api/v1/order {method: post} /Done => send in body { email, phone, name, amount, payment, products, addresses, orderNumber} You must suer the addresses send in array like this [city,area,street,block, building] "addresses": [ "Kuwait", "First Residence Building", "Kuwait Street", "2", "10" ] مهم جداااااا الترتيب You must suer the products send in array like this [[product_id,quantity]] "products": [ [ "4", "10" ], [ "1", "1" ], [ "5", "3" ] ] *after* # /api/v1/order {method: post} /Done => send in body { email, phone, name, amount, payment, products, addresses, orderNumber, promoDiscount, shippingCost, subTotal} You must suer the addresses send in array like this [city,area,street,block, building] "addresses": [ "Kuwait", "First Residence Building", "Kuwait Street", "2", "10" ] مهم جداااااا الترتيب You must suer the products send in array like this [[product_id,quantity,price,discount]] "products": [ [ "4", "10", "50", "10" ], [ "1", "1", "50", "10" ], [ "5", "3", "50", "10" ] ]