Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wanjinyoo/buy_and_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.
https://github.com/wanjinyoo/buy_and_sell

ajax bootstrap4 database-schema expressjs node-js postgresql

Last synced: about 2 months ago
JSON representation

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.

Awesome Lists containing this project

README

        

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`
3. Install dependencies: `npm i`
4. Fix to binaries for sass: `npm rebuild node-sass`
5. Reset database: `npm run db:reset`
- Check the db folder to see what gets created and seeded in the SDB
7. Run the server: `npm run local`
- Note: nodemon is used, so you should not have to restart your server
8. 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
3. 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
6. date_listed
8. price
9. number_of_likes
10. Sold? Y/N
11. sold_to (not FK, but will be populated when marked SOLD)
12. sold_date
13. Deleted? Y/N
14. Delete_Reason

4. Conversations - buyer, seller & admin
15. id PK
16. from_id References user(id)
17. to_id References user(id)
18. item_id
19. message_date
20. 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
4. 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