Capturing amazon's free shipping with the power of community
This project was built as part of our internship at Microsoft and the Open University of Israel.
In this project we built a functioning web service based on the following technologies:
- Flask
- Python
- PostGress
- React
While using the following API's:
- Firebase
- PayPal
This project let's a user (costumer) to upload an item from Amazon which doesn't meet the requirement for free shipping to our web service for him to be paired with one (or more) other items in order to get the free shipping discount. We would love for you to shop with us, AmazonUs
- Frontend:
Dvir Bar Marziano
Omri Steinberg - Backend:
Eitan Bar Shimon
Elad Zaltsman
Ziv Farin
- Download python
- Python packages
pip install pipenv
- Python packages
- Download PostgreSQL (this might save you some searching...).
- Leave the 'PG-admin' option CHECKED!!!!! (just leave all of them checked...)
- In the second 'check the wanted options' I've checked every thing except the already installed option in it's latest version - in 64 bits. Skip this at your own peril.
- Make all DB related passwords '12345678', otherwise - go with the defaults.
- Download Postman (which is used to "automate" api calls to the backend without needing a frontend or even a browser)
- Clone this project from this GitHub repo.
- Running the backend
- Preparing the backend server
- In the terminal -
cd
into "backend" folder - Run
pipenv install
which will download and install all of this project's dependencies into an environment.
- In the terminal -
- Running the backend server
- Inside the backend folder - run
pipenv shell flask run
.
It's better to keep this terminal open and open another one for the frontend using VSCode's 'split terminal feature. - Use a 'GET' request in postman on 'http://localhost:5000' just to see you get a valid responses.
If you did - it works.
- Inside the backend folder - run
- Preparing the DB:
- Follow the instructions in the backend video from about 09:40 and on regarding how to set up a DB on your computer.
Note that your password should be '12345678' and the DB name should be 'amazonus'. Just keep on using these throughout the setup process.
I recommend doing the sql server set up and postman actions with him until everything is working.
- Follow the instructions in the backend video from about 09:40 and on regarding how to set up a DB on your computer.
- Preparing the backend server
- Running the Frontend
- If you already have react installed on your computer - just navigate into the frontend folder and run
npm start
(you should do this after the server is running).
- If you already have react installed on your computer - just navigate into the frontend folder and run
-
Running the reset script
- Do not run this script on your own! This script will reset all the tables in the DB and will re-add the mock data. Only run this script after receiving team approval!
- In the terminal -
cd
into "backend/DB" folder. - Run
python dbsetup.py
.
- In the terminal -
- Do not run this script on your own! This script will reset all the tables in the DB and will re-add the mock data. Only run this script after receiving team approval!
-
Setting the DB in pgAdmin4
- In pgAdmin4 in the top left, right click
Servers
. Then clickRegister
->Server...
. - In the 'General' tab, set the 'Name' field to
amazonus
. - In the 'Connection' tab
- Set the 'Host name/address' field to
amazonus.cjtaog2z5fsh.eu-north-1.rds.amazonaws.com
. - Set the 'Password' field to
12345678
. - Make sure that 'Port' is set to
5432
, and that 'Username' is set topostgres
.
- Set the 'Host name/address' field to
- Click Save.
To initiate DB creation, run
python3 create_basic_db.py
from the project root. - In pgAdmin4 in the top left, right click