- Aaron Warren
- Alexander Len
- Jeffrey Wu
The project is a normal store front where a user can purchase products on their account, save card information, and keeps track of user history as well as the most popular items on the store. The program runs using Docker with ReactJS on the frontend, in the backend is Spring boot with a java based backend, and then the database is an AWS RDS running MySQL.
Login Page
Register Page
Home Page
Profile Page
Order History Page
- Docker
- Node
- Java8
To run the project locally, follow all the instructions below carefully.
- CD into
./frontend
- Run the command
docker build -t sample:dev -f ./Dockerfile.txt .
- Once the image is done building, run the command
docker run -it --rm -v ${pwd}:/app -v /app/node_modules -p 3001:3000 sample:dev
- After that the page will be accessible at either http://192.168.99.100:3001/ or http://localhost:3001/
- If the page is not accessible at http://localhost:3001/, additional setup is necessary
- Exit the program on docker
- Open the folder located at
./backend/src/main/java/com/store/backend
- Open all the files that end in "Controller.java"
- At the top before the class declaration you will see:
@CrossOrigin(origins = "http://localhost:3001")
- Change
"http://localhost:3001"
to the IP and Port of where docker launched the application - For example:
@CrossOrigin(origins = "http://192.168.99.100:3001/")
- Change
- After doing this for all 5 Controller files, restart the initial frontend setup and then frontend setup is complete
- CD into
./backend
- Run the command
.\mvnw.cmd spring-boot:run
- This will start the backend on http://localhost:8080/
account(account_id, email, password, address, cell, name, session_id)
card_info(card_id, card_holder, code, card_number, zip, exp_month, exp_year)
cart(id, account_id, item_id, quantity)
orders(order_id, price)
items(item_id, description, image, name, price, purchased)
item_categories(category_id, category_name)
holds(id, account_id, card_id)
belongs(id, category_id, item_id)
make(id, account_id, order_id)
contains(id, item_id, order_id, quantity)
All database queries were made using CRUD and spring boots RestController functions. This meant that queries were not done in normal SQL and instead are done in functions. For example, if trying to get all the rows in the Table cart
based on the account_id
I would make a function in the CartRepo.java
file called Iterable<Cart> findAllByAccountId(Integer accountId
. This would allow it so that whenever I made a call to this function it would return all the rows that contained accountId
. The only functions that were not made are the ones provided by the CRUD dependency which is only findAll()
and findById(Integer Id)
. Otherwise the functions that were created are in their respective files that end with Repo.java
.
All calls are made from the frontend via Get requests to the backend. The requests are intercepted by the various Controllers for their respective data sets. The functions on the frontend can all be found in ./frontend/src/APIFunctions.js
. The functions on the backend can all be found in ./backend/src/main/java/com/store/backend
. In that folder are various java files that end with Controller.java
that handle all requests made by the frontend.
For all our data transport needs we sent the information from the backend to the frontend in JSON format. For sending data from the frontend to the backend we sent the information using HTTP Get requests.