Skip to content

An app where you can put different types of things up for sale. You can pick a specific niche of items to sell for the app (a cars site, a shoes site, etc). This lets buyers find the items they are looking for quickly, and easily contact the seller.

Notifications You must be signed in to change notification settings

WanjinYoo/buy_and_sell

Repository files navigation

BUy & Sell Website

Project Setup

Getting Started

  1. Create the .env by using .env.example as a reference: cp .env.example .env
  2. Update the .env file with your correct local information
  • username: labber
  • password: labber
  • database: midterm
  1. Install dependencies: npm i
  2. Fix to binaries for sass: npm rebuild node-sass
  3. Reset database: npm run db:reset
  • Check the db folder to see what gets created and seeded in the SDB
  1. Run the server: npm run local
  • Note: nodemon is used, so you should not have to restart your server
  1. Visit http://localhost:8080/

Warnings & Tips

  • Do not edit the layout.css file directly, it is auto-generated by layout.scss
  • Split routes into their own resource-based file names, as demonstrated with users.js and widgets.js
  • Split database schema (table definitions) and seeds (inserts) into separate files, one per table. See db folder for pre-populated examples.
  • Use the npm run db:reset command each time there is a change to the database schema or seeds.
    • It runs through each of the files, in order, and executes them against the database.
    • Note: you will lose all newly created (test) data each time this is run, since the schema files will tend to DROP the tables and recreate them.

Dependencies

  • body-parser: ^1.19.0,
  • chalk: ^2.4.2,
  • cookie-session: ^1.4.0,
  • dotenv: ^2.0.0,
  • ejs: ^2.6.2,
  • express: ^4.17.1,
  • moment: ^2.29.1,
  • morgan: ^1.9.1,
  • node-sass-middleware: ^0.11.0,
  • pg: ^6.4.2,
  • pg-native: ^3.0.0,
  • twilio: ^3.52.0

About the App

Buy / Sell

An app where you can put different types of things up for sale. You can pick a specific niche of items to sell for the app (a cars site, a shoes site, etc). This lets buyers find the items they are looking for quickly, and easily contact the seller.

Requirements: users can see featured items on a main feed users can filter items by price, users can favourite items to check up on them later users can send messages to the seller

Admins can: post items, which can be seen by others remove items from the site mark items as SOLD!, send a message via app, or text back on negotiations in buying the said item

Story:

  1. As a user, I can browse thru the list of items

  2. As a user, I can search specific items on:

    1. Price
      1. Min
      2. Max
      3. High to Low
      4. Low to High
    2. Date listed - stretch
  3. As a user I can create a favourites list

  4. As a user I can send messages to the seller

  5. As an Admin - I can add to the list of items (create items)

  6. As an admin - I can remove items (Update as Delete and don't show in main list)

  7. As an Admin - I can mark items as SOLD (update and don't show in main list)

  8. As an Admin -

    1. I can message to seller/buyer
    2. I can text back seller/buyer(SMS) on negotiations to purchase the item. stretch
  9. As an Admin - I can view all messages:

    1. of all buyers
    2. on all items

Entities - TABLES

  1. Users - seller and buyer both

    1. id PK
    2. name
    3. email
    4. phone
    5. is_admin?
  2. User/Favourites

    1. id PK
    2. user_id references user(id)
    3. item_id references items(id)
  3. Items - Electronics

    1. id PK
    2. title
    3. description
    4. thumbnail_photo_url
    5. date_listed
    6. price
    7. number_of_likes
    8. Sold? Y/N
    9. sold_to (not FK, but will be populated when marked SOLD)
    10. sold_date
    11. Deleted? Y/N
    12. Delete_Reason
  4. Conversations - buyer, seller & admin

  5. id PK

  6. from_id References user(id)

  7. to_id References user(id)

  8. item_id

  9. message_date

  10. message

Types of Users - Admin(seller) / User (Buyer)

Buyer Logs in:

  1. Main Page

    1. Header / Menu Bar - My Favourites, Conversations, Items List, User Information (Welcome User!, Today's date), Logout
    2. 3 Featured - most liked / random
      1. No scrolling of items
  2. Login / Sign-up / logout - Dead Link. All users for Demo purposes will directly use the route

  3. My Favourites 2. List of all items clicked as favourite - use the Items List (#5) to show only the buyer's favourites. 3. Should not display SOLD items

    1. should not allow user to message seller for such sold items
    2. Allow buyer to message the seller
  4. Conversations

    1. list of all items where buyer has already messaged the seller 2. allow buyer to continue message to seller 3. Should not allow any more messaging if items is SOLD / DELETED.
  5. Items List

    1. Filter on price
    2. Scroll thru items
    3. select item
      1. Open Item specific page (#6)
      2. mark / unmark as favourite
    4. Should not allow any activity if items is SOLD / DELETED.
  6. Specific Items from the Items List

    1. Message Seller
      1. re-route to conversation/id page (#4.2)

Admin / Seller Logs in: (seller can also be a buyer)

  1. Main Page

    1. Header / Menu Bar - Home, Create Listing, Items, Conversations
    2. 3 Featured - most liked / random
      1. No scrolling of items
  2. Login / Sign-up / logout - Dead Link. All users for Demo purposes will directly use the route

  3. Create Listing (Add)

    1. Add a item for sale - opens a new page. ON addition, return back to #3.2
  4. Conversations

    1. list of all conversations by buyers who have already messaged the seller 2. allow admin to continue message to buyer

About

An app where you can put different types of things up for sale. You can pick a specific niche of items to sell for the app (a cars site, a shoes site, etc). This lets buyers find the items they are looking for quickly, and easily contact the seller.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •