This is the repository for the CSE442 BuyNSell Web app project. Project Description Hundreds of students graduate each year all having to get rid of their belongings (furniture, textbooks, etc.) Our mission is to connect students to buy and sell their used or unused items in a more organized and safe way for UB Students as opposed to (Craigslist, Facebook Marketplace, letgo).
Before running our codes, we need to setup the below components.
- Please make a docker account at This link.
- Downloads the docker install file at the below links depends on the Operating System.
- After executing the downloaded file, open the
termial
orcmd
.- Type the below codes to check successfully Docker is installed.
docker version // to check that you have the latest release installed docker run hello-world // to verify that Docker is pulling images and running as expected
- Enjoy it.
- Please signup for the Heroku.
- install heroku from heroku website with following the instruction.
- Downloads the codes of this repository and move to the directory.
git clone https://github.com/JacobYim/CSE442-BuyNSell.git
Note: make sure that the Docker is running.
- Run Docker Image at the port 8080.
docker build -t buynsell . docker-compose up -d node server.js
(Note : the
docker-compose
has components to make server docker, so it tries to the server docker at 8080. However it does not survive becuase the database connection is not set)If does not works, please type the following command at terminal:
npm install pg
.
Approach http://0.0.0.0:8080 with Web Browser.
When want to quit the server press
control + C
key on keyboad at the terminal typednode server.js
When want to quit database pressdocker-compose down
on the terminal.When want to run shell of the server, type the command
docker exec -it <container id> /bin/bash
- If there is changes, type the below.
docker-compose down docker images docker image rm -f buynsell postgres docker build -t buynsell . docker-compose up -d
After running the command docker-compose up -d
(where -d
tag make run in the background) and docker ps
,
use docker exec -it <container name> psql -U postgres -W postgres
. And type the password.
If you want to access in bash shell,
docker exec -it <container name> bash // enter into docker with bash
su - postgres
psql
Acceptance test file for the feature listed below :
- login
- singin
- add item
- show item in category
- add user image
- change user image and information
- change password
- user-session
- logout
are in the test directory. Please read the README.md file in test directory to run acceptance test.
To connect with Heroku,
heroku login
heroku container:login
heroku create
docker build -t registry.heroku.com/<your-app-number>/web .
docker push registry.heroku.com/<your-app-number>/web
heroku container:release web -a <your-app-number>
heroku open -a <your-app-number>
When stop the app,
heroku ps:scale web=0
Restart,
heroku ps:scale web=1