Skip to content

AppBK/Sweetwafer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sweetwafer

Sweetwafer is a partial clone of the website 'Sweetwater', an e-commerce site that I like to describe as 'Amazon for musicians'. I've always loved the layout and functionality of this site. It has the right amount of redundancy to make navigation easy and intuitive. The site is visually busy without feeling crowded or messy. The site also sports some impressive css features such as auto-zoom on hover for product page images and more. Hopefully I can get to some of these extras, but 2 weeks can be a tight deadline... Moving past the deadline of the capstone project, I hope to make this clone REALLY shine and occupy it's rightful place as the jewel of my resume!

Live Link

https://sweetwafer.onrender.com

Tech Stack

Frameworks and Libraries

Python Flask JavaScript React Redux CSS3 HTML5

Database:

Postgres

Hosting:

Render

Index

Feature List | Database Schema | User Stories | Wireframes

Landing Page

Product Page

Cart

Endpoints

Auth Routes

Current User

  • Purpose: This fetch is sent upon initial app load and on subsequent refreshes and navigations. It returns an object representing the current user, if user is logged in.
  • Method: POST
  • URL: /api/auth/
  • Successful Response: HTTP Status Code 200
{
    'cart': ARRAY_OF_PRODUCT_OBJECTS,
    'createdat': STRING,
    'email': STRING,
    'id': INT,
    'updatedat': STRING,
    'username': STRING
}
  • Error Response: HTTP Status Code 401
{
  'errors': 'Unauthorized'
}

Unauthorized (from @login_required)

  • Purpose: This endpoint will be routed to in the case that a protected route does not pass validations for the current user.
  • Method POST
  • URL: /api/auth/unauthorized
  • Successful Response: NA
  • Error Response: HTTP Status Code 401
{
  'errors': 'Unauthorized'
}

Sign Up

  • Purpose: This fetch sends the signup form data to the backend to process the creation of a new user.
  • Method: POST
  • URL: /api/auth/signup
  • Successful Response: HTTP Status 201
{
   'id': INT,
   'username': STRING,
   'email': STRING,
}
  • Error Response: HTTP Status 400
{
   'errors': ARRAY_OF_STRINGS
}

Login

  • Purpose: This fetch attempts to login a user with the provided credentials.
  • Method: POST
  • URL: /api/auth/login
  • Successful Response: HTTP Status 200
{
   'id': INT,
   'username': STRING,
   'email': STRING,
}
  • Error Response: HTTP Status 400
{
   'errors': ARRAY_OF_STRINGS
}

Logout

  • Purpose: This fetch will logout the current user.
  • Method: POST
  • URL: /api/auth/logout
  • Successful Response: HTTP Status 200
{
   'message': 'User logged Out'
}
  • Error Response: HTTP Status 404
{
   'errors': 'No session'
}

Cart Routes

Add Item to Cart

  • Purpose: This fetch is sent to add a new item to the cart table.
  • Method: POST
  • URL: /api/cart/add
  • Body:
{
   'item_id': INT
}
  • Successful Response: HTTP Status 201
{
   'id': INT,
   'category': STRING,
   'vendor_name': STRING,
   'manufacturer_id': STRING,
   'name': STRING,
   'model': STRING,
   'serial': STRING,
   'description': STRING,
   'tech_specs': STRING,
   'price': FLOAT,
   'quantity': INT
}
  • Error Response: HTTP Status 404
{
   'error': 'Item with given id Not Found'
}

Update Cart Item Quantity

  • Purpose: This fetch is sent to update the quantity value of a cart item.
  • Method: PUT
  • URL: /api/cart/quantity
  • Body:
{
   'id': INT,
   'val': INT
}
  • Successful Response: HTTP Status 200
{
   'id': INT,
   'category': STRING,
   'vendor_name': STRING,
   'manufacturer_id': STRING,
   'name': STRING,
   'model': STRING,
   'serial': STRING,
   'description': STRING,
   'tech_specs': STRING,
   'price': FLOAT,
   'quantity': INT
}
  • Error Response1: HTTP Status 404
{
   'errors': 'Item with given id Not Found'
}
  • Error Response2: HTTP Status 400
{
   'errors': ARRAY_OF_STRINGS
}

Remove Item from Cart

  • Purpose: This fetch is sent to delete an item from the cart.
  • Method: DELETE
  • URL: /api/cart/delete/int:id
  • Successful Response: HTTP Status 200
{
   'message': 'Success'
}
  • Error Response: HTTP Status 404
{
   'errors': 'Item with given id Not Found'
}

Empty Cart

  • Purpose: This fetch is sent to delete all items from the cart.
  • Method: DELETE
  • URL: /api/cart/clear/int:id
  • Successful Response: HTTP Status 200
{
   'message': 'Cart Emptied'
}
  • Error Response: HTTP Status 404
{
   'errors': 'Cart with given id Not Found'
}

Shipping Info Routes

Get Current User Shipping Info

  • Purpose: This fetch is sent to retrieve all shipping info records for the user specified by the id.
  • Method: GET
  • URL: /api/shipping/int:user_id
  • Successful Response: HTTP Status 200
[
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
]
  • Error Response: HTTP Status 404
{
   'errors': 'User with given id Not Found'
}

Create a new Shipping Record

  • Purpose: This fetch is sent to add a new entry to the shipping info table.
  • Method: POST
  • URL: /api/shipping/add
  • Body:
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
  • Success Response: HTTP Status 201
[
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
]
  • Error Response1: HTTP Status 400
{
   'errors': ARRAY_OF_STRINGS
}
  • Error Response2: HTTP Status 404
{
   'errors': 'User with given id Not Found'
}

Update Shipping Record

  • Purpose: This fetch is sent to update the shipping info record specified by the shipping id.
  • Method: PUT
  • URL: /api/shipping/update/int:shipping_id
  • Body:
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
  • Successful Response: HTTP Status 200
[
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
]
  • Error Response1: HTTP Status 400
{
   'errors': ARRAY_OF_STRINGS
}
  • Error Response2: HTTP Status 404
{
   'errors': 'Shipping Record with given id Not Found'
}

Delete Shipping Record

  • Purpose: This fetch sends a shipping info id in the body of the request of the record to be deleted.
  • Method: DELETE
  • URL: /api/shipping/delete
  • Body:
{
   'id': INT
}
  • Successful Response: HTTP Status 200
[
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
]
  • Error Response: HTTP Status 404
{
   'errors': 'Shipping Record with given id Not Found'
}

Billing Info Routes

Get Current User Billing Info

  • Purpose: This fetch is sent to retrieve all billing info records for the user specified by the id.
  • Method: GET
  • URL: /api/billing/int:user_id
  • Successful Response: HTTP Status 200
[
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
]
  • Error Response: HTTP Status 404
{
   'errors': 'User with the given id Not Found'
}

Create new Billing Record

  • Purpose: This fetch is sent to add a new entry to the billing info table.
  • Method: POST
  • URL: /api/billing/add
  • Body:
{
   apt_number: INT,
   city: STRING,
   company: STRING,
   country: STRING,
   primary: BOOLEAN,
   shipping_name: STRING,
   state: STRING,
   street: STRING,
   user_id: INT,
   zip: STRING
}
  • Successful Response: HTTP 201
[
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
]
  • Error Response1: HTTP Status 400
{
   'errors': ARRAY_OF_STRINGS
}
  • Error Response2: HTTP Status 404
{
   'errors': 'User with given id Not Found'
}

Update Billing Record

  • Purpose: This fetch is sent to update the billing info record specified by the billing id.
  • Method: PUT
  • URL: /api/shipping/update/int:billing_id
  • Body:
{
   apt_number: INT,
   city: STRING,
   company: STRING,
   country: STRING,
   primary: BOOLEAN,
   shipping_name: STRING,
   state: STRING,
   street: STRING,
   user_id: INT,
   zip: STRING
}
  • Successful Response: HTTP Status 200
[
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
]
  • Error Response1: HTTP Status 400
{
   'errors': ARRAY_OF_STRINGS
}
  • Error Response2: HTTP Status 404
{
   'errors': 'Billing Record with given id Not Found'
}
  • Error Response3: HTTP Status 404
{
   'errors': 'User with given id Not Found'
}

Delete Billing Record

  • Purpose: This fetch sends a billing info id in the body of the request. Upon successful deletion we return the updated array of user entries.
  • Method: DELETE
  • URL: /api/billing/delete
  • Body:
{
   'id': INT
}
  • Successful Response: HTTP Status 200
[
   {
      apt_number: INT,
      city: STRING,
      company: STRING,
      country: STRING,
      primary: BOOLEAN,
      shipping_name: STRING,
      state: STRING,
      street: STRING,
      user_id: INT,
      zip: STRING
   }
]
  • Error Response: HTTP Status 404
{
   'errors': 'Billing record with given id Not Found'
}

Feature List

  1. Cart
  2. Shipping Entries
  3. Billing Accounts

Future Implementation Goals

  1. Reviews (w/AWS image uploads)
  2. ChatHelpBot (websockets)
  3. Search Bar
  4. Sales Professionals
  5. Payment Accounts (Credit Cards / PayPal)
  6. Make pixel perfect to target site.

Connect

LinkedIn

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages