Tryglasses is an e-commerce website for all types of eyewears.It is a soft clone of GlassesUSA.com.
Check out Tryglasses
MVP Feature List | Database Scheme | User Stories | Wire Frames |
-
Clone this repository:
https://github.com/coderaries12/GlassesUSAclone.git -
Install dependencies into the Backed and the Frontend by making a terminal for each one and then run the following:
npm install
-
Create a .env file using the .envexample provided
-
Set up your database with information from your .env and then run the following to create your database, migrate, and seed:
npx dotenv sequelize db:createnpx dotenv sequelize db:migratenpx dotenv sequelize db:seed:all
-
Start the app for both backend and frontend using:
npm start
-
Now you can use the Demo User or Create an account
- Product are listed in form of two categories one is eyeglasses and other one is sunglasses
- Users can create Reviews on Product
- Users can read/view all of the Reviews on a Product
- Users can delete their Review(s) on a Product
Logged-in Users can
- Add a product at a shopping cart
- Update the quantity of the product
- List all products in there shopping cart
- Delete/Cancel individual product
Logged-in Users can
- Place a order
- Update the shipping address in order
- List all orders of logged-in users in purchase history page
- Delete/Cancel individual order if order is in preparing state
Logged-in Users can
- Add a product to its favorite collection by clicking heart icon on images
- List all of their favorite products
- Unlike their favorite products by clicking hear icon on images
Logged-in Users can
- Can search any product by typing in search bar and by clicking the product can go to product detail page
- More categories in terms of gender and brands
- Live try-on camera
| Request | Purpose | Return Value |
|---|---|---|
| GET /api/auth/ | Fetches the current logged in user or returns null | { id: int, username: STRING, email: STRING } |
| POST /api/auth/login | Logs in user | { id: INT, username: STRING, email: STRING } |
| GET /api/auth/logout | Logsout user | {'message': 'User logged out'} |
| POST /api/auth/signup | Signs up user | { id: INT, username: STRING, email: STRING } |
| GET /api/eyeglasses | Get all eyeglasses collection | { id: INT, title: STRING, price: INT} |
| GET /api/sunglasses | Get all sunglasses collection | { id: INT, title: STRING, price: INT} |
| GET /api/products/:productId | Get individual detail of Product | { id: INT, userId: INT, title: STRING, price: INT, size: STRING, frameType: STRING, frameColor: STRING, frameMaterial: STRING, frameShape: STRING, previewImage: STRING, images: ARRAY, user: OBJECT, reviews: ARRAY, Description: STRING, type: STRING } |
| POST /api/products/:productId/reviews | create a review for a listing | { id: INT, productId: INT, userId: INT, reviewTitle: STRING, quality: STRING, fit: STRING, style: STRING, review: STRING, stars: INT, reviewImage: STRING } |
| PUT /api/products/:productId/reviews/:reviewId | update a review | { id: INT, productId: INT, userId: INT, reviewTitle: STRING, quality: STRING, fit: STRING, style: STRING, review: STRING, stars: INT, reviewImage: STRING } |
| DELETE /api/products/:productId/reviews/:reviewId | delete a review | { "message": "Review succesfully deleted" } |
| GET /api/favorites | Listing of favorite items of a user | { user_id: INT, product_id: INT, title: STRING, description: STRING, frameType: STRING, price: INT, previewImages: STRING, size: STRING, type: STRING, } |
| POST /api/users/:userId/favorites/products/:productId | Add the product to favorite collection | { id: INT, username: STRING, email: STRING, user_favorites: ARRAY } |
| DELETE /api/users/:userId/favorites/products/:productId | Remove the product from favorite | { id: INT, username: STRING, email: STRING, user_favorites: ARRAY } |
| GET /api/shoppingcart | Listing of items to shopping cart page | { userId: INT, productId: INT, title: STRING, description: STRING, frameType: STRING, price: INT, previewImages: STRING, size: STRING, type: STRING, } |
| POST /api/users/userId/cart/products/:productId/:value | Add the product to shopping cart | { sessionId:userId, productId: INT, quantity: INT } |
| PUT /api/users/userId/cart/products/:productId/:cartId/:value | Edit the quantity of the product to shopping cart | {sessionId:userId, productId: INT, quantity: INT} |
| DELETE /api/users/userId/cart/products/:productId/:cartId/:value | Delete the product from shopping cart | {sessionId:userId, productId: INT, quantity: INT } |
| POST /api/orders/new | Place the order | { id: INT, fullname: STRING, email: STRING, phone:INT,city: STRING, state: STRING } |
| GET /api/orders/:orderId | Listing of cart items to order review page | { cart_items: ARRAY, title: STRING, price: INT, previewImages: STRING } |
| PUT /api/orders/:orderId | Edit the shipping address to order | {orderId:INT, fullname: STRING, email: STRING, phone:INT,city: STRING, state: STRING } |
| DELETE /api/orders/:orderId | Delete the order from purchase history page | {orderId:INT } |
| GET /api/purchase-history | Listing of all orders placed by logged-in user | { order_number: INT, order_date: INT, order_status: STRING, title: INT, previewImages: STRING, price: INT } |






