- Clone the application to local (i.e.
git clone https://github.com/nguyensjsu/fa21-172-group-7.git
). - Make sure Node.js is installed.
- Install node dependencies for React front office by
cd frontoffice
andnpm install
. - Install node dependencies for React back office by
cd backoffice
andnpm install
. - You're done!
These journals will include the following contents as per the project requirements:
- A snapshot (point-in-time) image of the Team's Task Board highlighting which "Card" you worked on
- A discussion of your accomplishments that week with a list of links to your Code Commits and PRs.
- A discussion of the challenges you faced that week and how your resolved those issues.
These journals are located in the journals folder. They can also be accessed with the links below:
GameGo is a platform for purchasing video games, similar to GameStop.
- User tasks:
- Can register for an account, log in, and log out
- Video games can be seen and selected for purchase
- User can purchase a video game with a credit card
- Admin tasks:
- Game inventory can be accessed and the number of remaining games can be viewed
- Previous transactions' information can be seen
- List of user accounts can be seen
- If a user is locked out of their account by too many log in attempts, admin can unlock them
- Help inquiries sent in by the user can be seen
-
Frontend
- React JS
-
Backend
- Spring
- MySQL 8.0
- RabbitMQ
- Kong API Gateway
- CyberSource Payment Gateway
-
JDK 11
-
Gradle 5.6
- Okta Authentication
- MySQL Cloud Database
// Found in package.json of base directory
npm run backend // Runs Spring Backend, SQL, Kong, Rabbit on Docker
npm run fo // Runs frontoffice web app
npm run bo // Runs backoffice web app
npm run clean-all // Stop and remove Spring Backend, SQL, Kong, Rabbit Docker Images
cd frontoffice / backoffice
npm install
npm start
cd backend
gradle bootRun
cd backend
gradle bootJar
// Start Docker Desktop
docker build -t spring-gamego .
docker images
docker network create --driver bridge gamego-network
docker network ls
docker network inspect gamego-network
docker run -d --name spring-gamego --network gamego-network -td spring-gamego
docker run -d --name kong \
--network=gamego-network \
-e "KONG_DATABASE=off" \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
-p 80:8000 \
-p 443:8443 \
-p 8001:8001 \
-p 8444:8444 \
kong:2.4.0
http :8001/config config=@kong.yaml
docker exec -it kong kong reload
http localhost/api/ping
http localhost/api/ping apikey:2H3fONTa8ugl1IcVS7CjLPnPIS2Hp9dJ
curl localhost/api/ping -H 'apikey:2H3fONTa8ugl1IcVS7CjLPnPIS2Hp9dJ'
// Test it on the React app (Took Kong 20 seconds to respond on Windows)
// Make sure the Kong functions in App.js useEffect() are being used, not the non-Docker ones
npm start
-
Create a new MySQL instances. Also remember to activate google-MySQL API. Sample tutorial.
-
Go to
connection
and add your public ipv4 address.
- Enable VPC private IP
- Go to
user
and addadmin
-password
.
- Go to
database
and addcmpe172
.
- Change your
MYSQL_HOST
in deployment.yml of Kubernetes backend-deployment
Upload GKE yml files from https://github.com/nguyensjsu/fa21-172-group-7/tree/main/backend/GKE_rabbit
Get credentials on GKE console:
gcloud container clusters get-credentials YOURCLUSTERHERE --zone YOURCLUSTERZONEHERE
ex:
gcloud container clusters get-credentials cluster-backend --zone us-central1-a
Execute scripts on GKE console:
kubectl create -f rabbitmq-pod.yaml
kubectl create -f rabbitmq-console.yaml
kubectl create -f rabbitmq-service.yaml
Upload GKE yml files from https://github.com/nguyensjsu/fa21-172-group-7/tree/main/backend/docker https://github.com/nguyensjsu/fa21-172-group-7/tree/main/backend/kong
Get credentials on GKE console:
gcloud container clusters get-credentials YOURCLUSTERHERE --zone YOURCLUSTERZONEHERE
ex:
gcloud container clusters get-credentials cluster-backend --zone us-central1-a
Execute scripts on GKE console:
kubectl create -f deployment.yaml
kubectl create -f service.yaml
kubectl apply -f https://bit.ly/k4k8s
kubectl apply -f kong-ingress-rule.yaml
kubectl apply -f kong-strip-path.yaml
kubectl patch ingress gamego-api -p '{"metadata":{"annotations":{"konghq.com/override":"kong-strip-path"}}}'
kubectl apply -f kong-cors.yaml
kubectl apply -f kong-key-auth.yaml
kubectl patch service spring-gamego-api-service -p '{"metadata":{"annotations":{"konghq.com/plugins":"kong-key-auth"}}}'
kubectl apply -f kong-consumer.yaml
kubectl create secret generic apikey \
--from-literal=kongCredType=key-auth \
--from-literal=key=2H3fONTa8ugl1IcVS7CjLPnPIS2Hp9dJ
kubectl apply -f kong-credentials.yaml
Has the same steps as deploying Backend-Spring:
- In
package.json
, change proxy to theBackend-IP:Port
- build img -
docker build -t frontend-gamego .
- tag -
docker tag frontend-gamego YourDockerRepo
docker push YourDockerRepo
- Uploads deployment.yml to GKE and create a pod and expose it with service.