- As a user I want to buy products from other users and vendors.
- As a user I want to search for products, and compare the best prices.
- As a buyer I want to checkout with cc.
- As a seller I want to list my products for purchase.
- As a user I want my own identifiable profile.
* Users can sign up, login, logout.
* Demo user
* Users can search for items they may want to buy.
* Sellers can tag items for search.
* Users will have a persisting cart.
* Users will have an about page where they can also list items.
* Sellers will have their products categorized on main page.
* Main page content will contain most recent additions based on category.
* Deploy to Heroku.
* Credit card checkout
* Users can change profile info after account has been created.
Click here for a better visual representation of Schema <---------------
Column name | Data Type | constraints |
---|---|---|
id | integer | not null, autoIncrement, primary key |
username | string | not null, unique |
string | not null, unique | |
hashedPassword | string | not null |
created_at | datetime | not null |
Column name | Data Type | constraints |
---|---|---|
id | integer | not null, primary key |
title | string | not null |
img | string | not null |
description | string | |
category | string | not null |
price | float | not null |
user_id | integer | not null, foreign key |
created_at | datetime | not null |
- user_id references User.id
- category references Category.id
Column name | Data Type | constraints |
---|---|---|
id | integer | not null, primary key |
category | string | not null |
Column name | Data Type | constraints |
---|---|---|
user_id | integer | not null |
product_id | integer | not null |
- user_id references Users.id
- product_id references Products.id
This is the backend for the Solo React project.
-
Clone this repository
-
Install dependencies (
npm install
) -
Create a .env file based on the example with proper settings for your development environment
-
Setup your PostgreSQL user, password and database and make sure it matches your .env file with CREATEDB privileges
-
Run
npm run db:create
npm run db:migrate
npm run db:seed:all
npm start
npm run db:drop
- if you want to quickly drop db
- Create a new project
- Under Resources click "Find more add-ons" and add the add on called "Heroku Postgres"
- Install the Heroku CLI
- Run
$ heroku login
- Add heroku as a remote to this git repo
$ heroku git:remote -a <project_name>
- Push the project to heroku
$ git push heroku master
- Connect to the heroku shell and prepare your database
$ heroku run bash
$ sequelize-cli db:migrate
$ sequelize-cli db:seed:all
(You can interact with your database this way as youd like, but beware that db:drop
should not be run in the heroku environment)
-
Add a
REACT_APP_BASE_URL
config var. This should be the full URL of your react app: i.e. "https://solo-react.herokuapp.com" -
profit