Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud fix #207

Open
wants to merge 341 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
341 commits
Select commit Hold shift + click to select a range
27c51c9
change
simbayippy Oct 9, 2024
11bda37
attempt
simbayippy Oct 9, 2024
b776d4c
change from sha to latest
simbayippy Oct 9, 2024
21792f2
change from sha to latest
simbayippy Oct 9, 2024
21d7906
update docker file location
simbayippy Oct 9, 2024
eff1262
point to right manifest file
simbayippy Oct 9, 2024
fe03658
change to fix-auth branch
simbayippy Oct 9, 2024
1371bc3
see if githubactions work
simbayippy Oct 9, 2024
1555ba0
add cloudbuilds for question and user service
simbayippy Oct 9, 2024
96170a9
cleanup before deploying to GKE
simbayippy Oct 9, 2024
f62a4b2
Merge pull request #44 from CS3219-AY2425S1/fix/auth
simbayippy Oct 9, 2024
460587c
try 1 less service
simbayippy Oct 9, 2024
ed0af95
add sercret ref to gke
simbayippy Oct 9, 2024
1a7fd87
fix manifest, now CD piple finished
simbayippy Oct 9, 2024
ef6de7f
finish CD, change on-push branch to main
simbayippy Oct 9, 2024
78c10ac
test
simbayippy Oct 9, 2024
0e5a893
test passed, change target branch back to main
simbayippy Oct 9, 2024
61f1806
change question service from configMap to sercretRef
simbayippy Oct 9, 2024
563bf2a
set enviornment variables in kubernetes
simbayippy Oct 9, 2024
acdb1a4
set target branch back to main again
simbayippy Oct 9, 2024
06d007c
Merge pull request #53 from CS3219-AY2425S1/feat/35-continuous-deploy…
simbayippy Oct 10, 2024
e27dd28
set next.config.mjs to use kubernetes env var
simbayippy Oct 10, 2024
095660d
Merge pull request #54 from CS3219-AY2425S1/fix/production-endpoints
simbayippy Oct 10, 2024
512cfb8
change env
simbayippy Oct 10, 2024
240fad3
change env
simbayippy Oct 10, 2024
7a30651
try hosting secrets for fe on github actions to use on buiild
simbayippy Oct 10, 2024
45db24a
Merge pull request #55 from CS3219-AY2425S1/fix/production-endpoints
simbayippy Oct 10, 2024
b6694c7
add middleware
Kurtyjlee Oct 9, 2024
0652041
add persistent store for auth
Kurtyjlee Oct 9, 2024
e782a2b
remove next auth
Kurtyjlee Oct 9, 2024
d3431be
configure admin middleware
Kurtyjlee Oct 10, 2024
2493c78
add delete question operation
Kurtyjlee Oct 11, 2024
0b29aff
add edit operations for admins
Kurtyjlee Oct 11, 2024
6191e71
add create question operation
Kurtyjlee Oct 11, 2024
6fc94ea
Merge pull request #46 from CS3219-AY2425S1/feat/admin-fe
Kurtyjlee Oct 11, 2024
1de9cd3
update nextjs env
Kurtyjlee Oct 11, 2024
4c6bb4f
update env pointers
Kurtyjlee Oct 11, 2024
677ef59
Merge pull request #56 from CS3219-AY2425S1/chore/update_env
Kurtyjlee Oct 11, 2024
a306603
add substitutions
simbayippy Oct 11, 2024
635180a
remove env in next.config.mjs
simbayippy Oct 11, 2024
11f36a6
Merge pull request #57 from CS3219-AY2425S1/fix/cloud-env
Kurtyjlee Oct 11, 2024
b7e5f8c
fix formatting
simbayippy Oct 11, 2024
c90a848
Merge pull request #58 from CS3219-AY2425S1/fix/cloud-env
Kurtyjlee Oct 11, 2024
d9c2c11
update script command
Kurtyjlee Oct 11, 2024
1c4f745
Merge pull request #59 from CS3219-AY2425S1/chore/update_script
simbayippy Oct 11, 2024
28a2d24
fix kubernetes script
Kurtyjlee Oct 11, 2024
2a877a7
fix middleware
Kurtyjlee Oct 11, 2024
db23cec
Merge pull request #60 from CS3219-AY2425S1/fix/fix-kubernetes-script
Kurtyjlee Oct 11, 2024
ce7db21
init matching service
Kurtyjlee Oct 15, 2024
c823aed
init redis, add connection to rabbit, add matching algo
Kurtyjlee Oct 16, 2024
50f395b
remove env
Kurtyjlee Oct 16, 2024
d6be5ab
remove dist
Kurtyjlee Oct 16, 2024
b7b7a17
abstract subscribe to queue and add comments
Kurtyjlee Oct 16, 2024
564be4f
add reconnection to rabbit
Kurtyjlee Oct 16, 2024
aa3b93b
update kubernetes file
Kurtyjlee Oct 16, 2024
46158b6
add manifest files
Kurtyjlee Oct 16, 2024
3b186ad
update env
Kurtyjlee Oct 16, 2024
0bd6de6
Merge pull request #62 from CS3219-AY2425S1/feat/matching-service
Kurtyjlee Oct 17, 2024
c198f2e
Update FilterBar.tsx
lsyurea Oct 19, 2024
f9198e5
Create matching page
lsyurea Oct 19, 2024
e873775
Remove admin match page
lsyurea Oct 19, 2024
81da6ef
Update button
lsyurea Oct 19, 2024
2fd8e22
Update Navbar.tsx
lsyurea Oct 19, 2024
ac6b19c
Merge pull request #69 from CS3219-AY2425S1/feat/loading_page
lsyurea Oct 19, 2024
664558e
Update Navbar.tsx
lsyurea Oct 19, 2024
e714581
Merge pull request #70 from CS3219-AY2425S1/feat/loading_page
lsyurea Oct 19, 2024
dfce7c1
Update files
lsyurea Oct 19, 2024
fff7add
Merge pull request #71 from CS3219-AY2425S1/feat/loading_page
lsyurea Oct 19, 2024
31efa27
Fix Sign Up bug
tyouwei Oct 19, 2024
e99a0b7
Merge pull request #72 from CS3219-AY2425S1/fix/auth
ZD292 Oct 20, 2024
33a94d4
Establish rabbitmq comms
tyouwei Oct 20, 2024
c8c689e
Merge pull request #73 from CS3219-AY2425S1/feat/fe_to_rabbitmq
ZD292 Oct 20, 2024
6d697e2
i have no idea whats wrong
simbayippy Oct 20, 2024
1a8b5d0
....
simbayippy Oct 20, 2024
a3c7746
Add Match handling
tyouwei Oct 20, 2024
6fe25a7
Fix router bug
tyouwei Oct 20, 2024
9a4a8ec
Merge pull request #75 from CS3219-AY2425S1/feat/fe_to_rabbitmq
simbayippy Oct 20, 2024
1fb9336
init
simbayippy Oct 20, 2024
82d5267
init
simbayippy Oct 20, 2024
b1653d0
add collab page
Kurtyjlee Oct 20, 2024
da83053
remove routing
Kurtyjlee Oct 20, 2024
3d30a01
Merge pull request #76 from CS3219-AY2425S1/feat/fe-for-matching
Kurtyjlee Oct 20, 2024
2b6b27e
update matching service with fe connection to use websocket
simbayippy Oct 20, 2024
d259255
handle removing user from quque
simbayippy Oct 20, 2024
e1af8a0
remove comment
simbayippy Oct 20, 2024
88f399e
remove comment
simbayippy Oct 20, 2024
cd8f1cf
remove comment
simbayippy Oct 20, 2024
d58e3f2
Merge pull request #77 from CS3219-AY2425S1/fix/matching-service-update
tyouwei Oct 21, 2024
23c304b
Update states
lsyurea Oct 21, 2024
01c1103
Update store
lsyurea Oct 21, 2024
a73c094
fix middleware url
Kurtyjlee Oct 21, 2024
17db733
Update button color
lsyurea Oct 21, 2024
ff0bd82
Update Navbar.tsx
lsyurea Oct 21, 2024
22ab0b6
Update button logic
lsyurea Oct 21, 2024
9b1f53a
Update layout.tsx
lsyurea Oct 21, 2024
f2c99e5
Merge pull request #79 from CS3219-AY2425S1/fix/question_button
lsyurea Oct 21, 2024
4c33287
save progress
simbayippy Oct 21, 2024
89b19b6
create gateway, left matching
simbayippy Oct 21, 2024
81825f9
fix conflict
simbayippy Oct 21, 2024
15e6f7d
setup api gateway done
simbayippy Oct 21, 2024
a8ece1e
Remove .env file from repository
simbayippy Oct 21, 2024
926b643
remove loggin in userservice
simbayippy Oct 21, 2024
34bd659
remove axiosServer
simbayippy Oct 21, 2024
fd99498
remove axiosMatchingClient
simbayippy Oct 21, 2024
6a2524c
add changes to cloudbuild and github actions, but docker fails for ap…
simbayippy Oct 22, 2024
912a02e
fix .env for api-gateway
simbayippy Oct 22, 2024
6922b05
make preMatch dialog bg black
simbayippy Oct 22, 2024
a80ad4d
Add stomp/AMQP over Websocket for AMQP benefits
tyouwei Oct 22, 2024
0c4a3ba
Clean up backend code
tyouwei Oct 22, 2024
6d6e4c4
Remove stomp client connection after listening/broadcasting once
tyouwei Oct 22, 2024
9d71dbe
fix logout rerouting
Kurtyjlee Oct 15, 2024
a7fb9a8
add collaboration page skeleton
Kurtyjlee Oct 15, 2024
c978a40
fix signup url
Kurtyjlee Oct 15, 2024
9c3aba9
Merge pull request #61 from CS3219-AY2425S1/feat/collaboration-page
Kurtyjlee Oct 23, 2024
f7af20b
Set strictmode to default and added useRef to make sure only one list…
tyouwei Oct 27, 2024
e8c6a54
Remove unnecessary returns
tyouwei Oct 27, 2024
e5ee647
Merge branch 'main' of https://github.com/CS3219-AY2425S1/cs3219-ay24…
tyouwei Oct 27, 2024
f25206e
Add back consume function call
tyouwei Oct 27, 2024
0a8f464
add versioning to api gateway url
simbayippy Oct 27, 2024
f961011
Merge pull request #81 from CS3219-AY2425S1/improvement/amqp_over_ws
tyouwei Oct 27, 2024
e59076b
fix merge conflicts
simbayippy Oct 27, 2024
0733d23
merge
simbayippy Oct 27, 2024
796cd5f
Bug fixes and remove redundant features
tyouwei Oct 27, 2024
30ff2fe
Add interfaces
tyouwei Oct 27, 2024
e8a1082
Merge pull request #89 from CS3219-AY2425S1/improvement/amqp_over_ws
simbayippy Oct 27, 2024
51cee0b
remove matching routes from api gateway
simbayippy Oct 27, 2024
4a7e60d
merge with main
simbayippy Oct 27, 2024
cf257d7
Fix cancel press bug
tyouwei Oct 27, 2024
d043bfe
Merge pull request #90 from CS3219-AY2425S1/improvement/amqp_over_ws
simbayippy Oct 27, 2024
4fc26e1
merge with main
simbayippy Oct 27, 2024
7ed5456
remove config
simbayippy Oct 27, 2024
8841d1a
create websocket connection with apigateway from fe
simbayippy Oct 28, 2024
503dc8d
finish
simbayippy Oct 28, 2024
aa3e452
Remove redundant rabbitmq lib in FE code
tyouwei Oct 28, 2024
f71e7c0
Merge pull request #80 from CS3219-AY2425S1/feat/17-api-gateway
simbayippy Oct 28, 2024
6b05e0a
Add live collaboration between users
tyouwei Oct 31, 2024
85eb6f0
Change testing variables to real match variables
tyouwei Oct 31, 2024
81d2da9
Add cleaning up of binding & provider resources
tyouwei Oct 31, 2024
8da2551
Add tracking of num of pax in room
tyouwei Oct 31, 2024
94dd023
Remove redundant code and fix linting issues
tyouwei Oct 31, 2024
9e8fe3f
add burst mode to pods
Kurtyjlee Nov 2, 2024
579a709
add github OAuth
Kurtyjlee Nov 2, 2024
42525ec
remove redundant redirect uri
Kurtyjlee Nov 2, 2024
dedc491
remove google OAuth
Kurtyjlee Nov 2, 2024
5cd08e4
add suspense to useSearchParams
Kurtyjlee Nov 2, 2024
dd7919e
Merge pull request #98 from CS3219-AY2425S1/feat/add-oauth
Kurtyjlee Nov 2, 2024
d6b6319
Merge pull request #97 from CS3219-AY2425S1/feat/add-gke-burst
Kurtyjlee Nov 2, 2024
1a73a71
Merge pull request #95 from CS3219-AY2425S1/feat/live_collaboration
tyouwei Nov 3, 2024
ef42e8d
modify docker compose to use locally installed modules
Kurtyjlee Oct 30, 2024
fd486bc
add ui and api connection for user profile
Kurtyjlee Oct 30, 2024
a955ed8
add error handling for updating username and email
Kurtyjlee Oct 31, 2024
6018e6d
add route to verify password and change password
Kurtyjlee Oct 31, 2024
fa04d27
add delete account
Kurtyjlee Oct 31, 2024
42e4624
fix error handling for signin and signup
Kurtyjlee Oct 31, 2024
9f0c2f1
hide match button and remove redundant buttons
Kurtyjlee Oct 31, 2024
4f8aa2d
remove redundant console log
Kurtyjlee Oct 31, 2024
69a3f7c
fix hover and propagation
Kurtyjlee Nov 2, 2024
d9aee83
add validation for email and password
Kurtyjlee Nov 3, 2024
4767563
Merge pull request #96 from CS3219-AY2425S1/feat/user-profile
Kurtyjlee Nov 3, 2024
c2aeb46
fix match callback on problem row dialog
simbayippy Nov 3, 2024
be13c7f
create proper types and clean code for collaboration code
simbayippy Nov 3, 2024
0db9755
wrap collaboration page in a susepense in order to use useSearchParams
simbayippy Nov 3, 2024
126721c
fix use of programming languages in editor
simbayippy Nov 3, 2024
47d6171
add toasts for when user connects or disconnects
simbayippy Nov 3, 2024
0848e26
add rejoin logic + leave logic
simbayippy Nov 3, 2024
6cb9f6c
add token to login
Kurtyjlee Nov 3, 2024
ab14ee4
save progress
simbayippy Nov 3, 2024
e21e273
add cloudbuild for api-gateway
simbayippy Nov 3, 2024
81578ca
fix comments
simbayippy Nov 3, 2024
9697134
only render toast if number of clients changed
simbayippy Nov 3, 2024
fa1e913
fix OAuth formatting and request errors
Kurtyjlee Nov 3, 2024
735fe93
Merge pull request #104 from CS3219-AY2425S1/feat/91-cloud-deploy
simbayippy Nov 3, 2024
7693b02
merge conflicts
simbayippy Nov 3, 2024
2ddfb18
Merge pull request #105 from CS3219-AY2425S1/fix/OAuth
simbayippy Nov 3, 2024
dec5533
fix no any
simbayippy Nov 3, 2024
cf8dc13
fix no any
simbayippy Nov 3, 2024
3c9c51a
Merge pull request #102 from CS3219-AY2425S1/feat/82-reconnection-ui
simbayippy Nov 3, 2024
5aba852
revmove sock in github workflow
simbayippy Nov 3, 2024
0542573
Merge pull request #106 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
009ff33
remove the referenbce of .env.production in api gateway DockerFile
simbayippy Nov 3, 2024
712b09b
Merge pull request #107 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
a05c89a
remove COPY .env.prod in Docker file
simbayippy Nov 3, 2024
2f9e91a
fix merge conflicts
simbayippy Nov 3, 2024
bbb25a0
remove backend from label, such that its an exact match to kubernetes…
simbayippy Nov 3, 2024
3268da9
Merge pull request #108 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
066ac58
fml
simbayippy Nov 3, 2024
7f4a40c
Merge pull request #109 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
2a91bf8
Add names to all service ports in api-gateway
simbayippy Nov 3, 2024
84ae111
Merge pull request #110 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
cdeeb8d
make port right name
simbayippy Nov 3, 2024
5fed02d
Merge pull request #111 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
6de1686
setup cors
simbayippy Nov 3, 2024
7515751
Merge pull request #112 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
39c2bdd
allow everyone to access cors
simbayippy Nov 3, 2024
47a2b38
Merge pull request #113 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
7b3f8c0
change
simbayippy Nov 3, 2024
7b59b97
Merge pull request #114 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
a2f2e3f
use github actions instead of google cloud build
simbayippy Nov 3, 2024
e1931dd
Merge pull request #115 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
8e50f16
add all types of workflows
simbayippy Nov 3, 2024
8127afc
Merge pull request #116 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
136b467
matching service change
simbayippy Nov 3, 2024
e2ff168
Merge pull request #117 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
18c8b5b
add the matching and session outputs
simbayippy Nov 3, 2024
9cde73f
hi
simbayippy Nov 3, 2024
3c3292b
Merge pull request #118 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
a0b8d0f
create sessionservice k8
simbayippy Nov 3, 2024
39eb71b
Merge pull request #119 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
0956c86
Merge pull request #99 from CS3219-AY2425S1/fix/94-match-button
simbayippy Nov 3, 2024
db8b08e
add tsc to docker
simbayippy Nov 3, 2024
b606f09
Merge pull request #120 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
e8f874f
push user service to build again
simbayippy Nov 3, 2024
df48b96
Merge pull request #121 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
edb8935
fix docker for session service
simbayippy Nov 3, 2024
b6dd289
Merge pull request #122 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
cb5d729
remove label of backend
simbayippy Nov 3, 2024
5f29278
Merge pull request #123 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
fd4604d
remove label of backend
simbayippy Nov 3, 2024
b54f36d
Merge pull request #124 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
35b9c92
rebuild fe
simbayippy Nov 3, 2024
2e91c7a
Merge pull request #125 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
bdf5ebf
fix cloud build
simbayippy Nov 3, 2024
d577860
Merge pull request #126 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
7d84102
add last remaining var
simbayippy Nov 3, 2024
1649d72
Merge pull request #127 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
385957f
fix docker file for session service
simbayippy Nov 3, 2024
1c43969
Merge pull request #128 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
22d0610
change port for k8 session service
simbayippy Nov 3, 2024
8251349
Merge pull request #129 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
db7ddb3
push fe to build again
simbayippy Nov 3, 2024
28341bd
Merge pull request #130 from CS3219-AY2425S1/cloud-fix
simbayippy Nov 3, 2024
cbd3549
Create audio service
lsyurea Nov 4, 2024
34458ab
fix middleware route
Kurtyjlee Nov 4, 2024
05177fe
Merge pull request #132 from CS3219-AY2425S1/fix/middleware
Kurtyjlee Nov 4, 2024
fc0dabf
add topics
Kurtyjlee Nov 4, 2024
44aaf03
reuse question description component
Kurtyjlee Nov 4, 2024
64e96c9
Fix bugs
lsyurea Nov 4, 2024
a173ac7
Create toggle
lsyurea Nov 5, 2024
c825b84
Merge pull request #131 from CS3219-AY2425S1/feat/audio
lsyurea Nov 5, 2024
384b4b2
Merge pull request #133 from CS3219-AY2425S1/fix/admin-validation
Kurtyjlee Nov 5, 2024
132cb48
add streaming port
Kurtyjlee Nov 5, 2024
00f7566
redeploy session service
Kurtyjlee Nov 5, 2024
71b3fd9
fix k8 formatting
Kurtyjlee Nov 5, 2024
f1f7f16
Merge pull request #134 from CS3219-AY2425S1/fix/fix-k8-streaming
lsyurea Nov 5, 2024
8ae49ad
add port name
Kurtyjlee Nov 5, 2024
b6a2e1b
redeploy session service
Kurtyjlee Nov 5, 2024
690716e
Merge pull request #135 from CS3219-AY2425S1/fix/add-port-name
lsyurea Nov 5, 2024
fd87332
add env variable to fe
simbayippy Nov 5, 2024
ac2939d
change session service to be loadbalancer
simbayippy Nov 5, 2024
e15a5c1
run prod command concurrently
Kurtyjlee Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .github/.keep
Empty file.
131 changes: 131 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Deploy to GCP

on:
push:
branches:
- main

jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
fe: ${{ steps.filter.outputs.fe }}
api: ${{ steps.filter.outputs.api }}
question: ${{ steps.filter.outputs.question }}
user: ${{ steps.filter.outputs.user }}
matching: ${{ steps.filter.outputs.matching }}
session: ${{ steps.filter.outputs.session }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
fe:
- 'peerprep-fe/**'
api:
- 'api-gateway/**'
question:
- 'question-service/**'
user:
- 'user-service/**'
matching:
- 'matching-service/**'
session:
- 'session-service/**'

deploy-fe:
needs: check-changes
if: ${{ needs.check-changes.outputs.fe == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_SA_KEY }}"
- uses: "google-github-actions/setup-gcloud@v2"
- name: "Trigger FE Cloud Build"
env:
NEXT_PUBLIC_API_GATEWAY_URL: ${{ secrets.NEXT_PUBLIC_API_GATEWAY_URL }}
NEXT_PUBLIC_GITHUB_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_GITHUB_CLIENT_ID }}
NEXT_PUBLIC_SOCK_SERVER_URL: ${{ secrets.NEXT_PUBLIC_SOCK_SERVER_URL }}
NEXT_PUBLIC_AUDIO_SERVER_URL: ${{ secrets.NEXT_PUBLIC_AUDIO_SERVER_URL }}
run: |
gcloud builds submit --config cloudbuilds/fe.yaml \
--substitutions _NEXT_PUBLIC_API_GATEWAY_URL="$NEXT_PUBLIC_API_GATEWAY_URL",_NEXT_PUBLIC_GITHUB_CLIENT_ID="$NEXT_PUBLIC_GITHUB_CLIENT_ID",_NEXT_PUBLIC_SOCK_SERVER_URL="$NEXT_PUBLIC_SOCK_SERVER_URL",_NEXT_PUBLIC_AUDIO_SERVER_URL="$NEXT_PUBLIC_AUDIO_SERVER_URL"

deploy-api-gateway:
needs: check-changes
if: ${{ needs.check-changes.outputs.api == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_SA_KEY }}"
- uses: "google-github-actions/setup-gcloud@v2"
- name: "Trigger API Gateway Cloud Build"
run: |
gcloud builds submit --config cloudbuilds/api-gateway.yaml

deploy-question-svc:
needs: check-changes
if: ${{ needs.check-changes.outputs.question == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_SA_KEY }}"
- uses: "google-github-actions/setup-gcloud@v2"
- name: "Trigger Question Service Cloud Build"
run: |
gcloud builds submit --config cloudbuilds/question-service.yaml

deploy-user-svc:
needs: check-changes
if: ${{ needs.check-changes.outputs.user == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_SA_KEY }}"
- uses: "google-github-actions/setup-gcloud@v2"
- name: "Trigger User Service Cloud Build"
run: |
gcloud builds submit --config cloudbuilds/user-service.yaml

deploy-matching-svc:
needs: check-changes
if: ${{ needs.check-changes.outputs.matching == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_SA_KEY }}"
- uses: "google-github-actions/setup-gcloud@v2"
- name: "Trigger Matching Service Cloud Build"
run: |
gcloud builds submit --config cloudbuilds/matching-service.yaml

deploy-session-svc:
needs: check-changes
if: ${{ needs.check-changes.outputs.session == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_SA_KEY }}"
- uses: "google-github-actions/setup-gcloud@v2"
- name: "Trigger Session Service Cloud Build"
run: |
gcloud builds submit --config cloudbuilds/session-service.yaml
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules/

# Build output
dist/
build/

# Logs
*.log

# Environment variables
.env

# IDE files
.vscode/
.idea/

# OS files
.DS_Store
Thumbs.db
# pnpm stores
*/.pnpm-store

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
*/.env
&/.env.dev

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm pre-commit
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/bzPrOe11)
# CS3219 Project (PeerPrep) - AY2425S1
## Group: Gxx

Expand Down
6 changes: 6 additions & 0 deletions api-gateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/node_modules
.env
.env.*
/dist
combined.log
error.log
6 changes: 6 additions & 0 deletions api-gateway/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80
}
36 changes: 36 additions & 0 deletions api-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Base stage for both dev and prod
FROM node:18-alpine AS base

# Install pnpm globally
RUN npm install -g pnpm

# Set the working directory in the container
WORKDIR /app

# Copy package.json and pnpm-lock.yaml
COPY package.json ./

RUN pnpm install

# Development stage
FROM base AS development

COPY src ./src
COPY tsconfig.json ./

# Note: Don't expose ports here, Compose will handle that for us

CMD ["pnpm", "dev"]


# Production stage
FROM base AS production
ENV NODE_ENV=production
ENV PORT=8001

COPY src ./src
COPY tsconfig.json ./

EXPOSE ${PORT}

CMD ["pnpm", "start"]
41 changes: 41 additions & 0 deletions api-gateway/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "api-gateway",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "nodemon --exec ts-node src/app.ts",
"start": "tsc && node dist/app.js",
"build": "tsc",
"format": "prettier --write \"src/**/*.ts\"",
"test": "echo \"Error: no test specified\" && exit 1",
"pre-commit": "pnpm format && git add -u"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@stomp/stompjs": "^7.0.0",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.21.1",
"http-proxy-middleware": "^3.0.3",
"jsonwebtoken": "^9.0.2",
"socket.io": "^4.8.1",
"winston": "^3.15.0",
"ws": "^8.13.0"
},
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^5.0.0",
"@types/jsonwebtoken": "^9.0.7",
"@types/node": "^22.7.7",
"@types/ws": "^8.5.12",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"nodemon": "^3.1.7",
"prettier": "^3.3.3",
"ts-node": "^10.9.2",
"typescript": "^5.6.3"
}
}
Loading