- Create the
.env
by using.env.example
as a reference:cp .env.example .env
- Update the .env file with your correct local information
- username:
labber
- password:
labber
- database:
midterm
- Install dependencies:
npm i
- Fix to binaries for sass:
npm rebuild node-sass
- Reset database:
npm run db:reset
- Check the db folder to see what gets created and seeded in the SDB
- Run the server:
npm run local
- Note: nodemon is used, so you should not have to restart your server
- Visit
http://localhost:8080/
- Do not edit the
layout.css
file directly, it is auto-generated bylayout.scss
- Split routes into their own resource-based file names, as demonstrated with
users.js
andwidgets.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.
- 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
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:
-
As a user, I can browse thru the list of items
-
As a user, I can search specific items on:
- Price
- Min
- Max
- High to Low
- Low to High
- Date listed - stretch
- Price
-
As a user I can create a favourites list
-
As a user I can send messages to the seller
-
As an Admin - I can add to the list of items (create items)
-
As an admin - I can remove items (Update as Delete and don't show in main list)
-
As an Admin - I can mark items as SOLD (update and don't show in main list)
-
As an Admin -
- I can message to seller/buyer
- I can text back seller/buyer(SMS) on negotiations to purchase the item. stretch
-
As an Admin - I can view all messages:
- of all buyers
- on all items
Entities - TABLES
-
Users - seller and buyer both
- id PK
- name
- phone
- is_admin?
-
User/Favourites
- id PK
- user_id references user(id)
- item_id references items(id)
-
Items - Electronics
- id PK
- title
- description
- thumbnail_photo_url
- date_listed
- price
- number_of_likes
- Sold? Y/N
- sold_to (not FK, but will be populated when marked SOLD)
- sold_date
- Deleted? Y/N
- Delete_Reason
-
Conversations - buyer, seller & admin
-
id PK
-
from_id References user(id)
-
to_id References user(id)
-
item_id
-
message_date
-
message
Types of Users - Admin(seller) / User (Buyer)
-
Main Page
- Header / Menu Bar - My Favourites, Conversations, Items List, User Information (Welcome User!, Today's date), Logout
- 3 Featured - most liked / random
- No scrolling of items
-
Login / Sign-up / logout - Dead Link. All users for Demo purposes will directly use the route
-
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
- should not allow user to message seller for such sold items
- Allow buyer to message the seller
-
Conversations
- 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.
-
Items List
- Filter on price
- Scroll thru items
- select item
- Open Item specific page (#6)
- mark / unmark as favourite
- Should not allow any activity if items is SOLD / DELETED.
-
Specific Items from the Items List
- Message Seller
- re-route to conversation/id page (#4.2)
- Message Seller
-
Main Page
- Header / Menu Bar - Home, Create Listing, Items, Conversations
- 3 Featured - most liked / random
- No scrolling of items
-
Login / Sign-up / logout - Dead Link. All users for Demo purposes will directly use the route
-
Create Listing (Add)
- Add a item for sale - opens a new page. ON addition, return back to #3.2
-
Conversations
- list of all conversations by buyers who have already messaged the seller 2. allow admin to continue message to buyer