Skip to content

Commit 7754302

Browse files
committed
Resolve conflicts and merge from main
2 parents 7445f8c + b99eb54 commit 7754302

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+11880
-20
lines changed

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
.vscode
9+
10+
# testing
11+
/coverage
12+
13+
# next.js
14+
/.next/
15+
/out/
16+
17+
# production
18+
/build
19+
20+
# misc
21+
.DS_Store
22+
*.pem
23+
24+
# debug
25+
npm-debug.log*
26+
yarn-debug.log*
27+
yarn-error.log*
28+
29+
# local env files
30+
.env*.local
31+
32+
# vercel
33+
.vercel
34+
35+
# typescript
36+
*.tsbuildinfo
37+
next-env.d.ts

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm pre-commit

docker-compose.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
services:
2+
frontend:
3+
image: asia-southeast1-docker.pkg.dev/cs3219-g11-peerprep/cs3219-g11-repo/peerprep-fe:latest
4+
build:
5+
context: ./peerprep-fe
6+
dockerfile: Dockerfile
7+
# volumes:
8+
# - ./peerprep-fe:/app # Mount src directory for hot reloading
9+
# - /app/node_modules # Prevent overwriting node_modules
10+
# - /app/.next
11+
ports:
12+
- "3000:3000"
13+
environment:
14+
- NODE_ENV=production
15+
networks:
16+
- peerprep-network
17+
env_file:
18+
- ./peerprep-fe/.env.production
19+
question-service:
20+
image: asia-southeast1-docker.pkg.dev/cs3219-g11-peerprep/cs3219-g11-repo/question-svc:latest
21+
build:
22+
context: ./question-service
23+
dockerfile: Dockerfile
24+
volumes:
25+
- ./question-service:/app # Mount src directory for hot reloading
26+
- ./question-service/node_modules:/app/node_modules
27+
ports:
28+
- "4001:4001"
29+
environment:
30+
- NODE_ENV=production
31+
- PORT=4001
32+
networks:
33+
- peerprep-network
34+
env_file:
35+
- ./question-service/.env.dev
36+
networks:
37+
peerprep-network:
38+
driver: bridge

k8s/peerprep-fe.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: peerprep-fe
5+
labels:
6+
type: frontend
7+
app: peerprep-fe
8+
spec:
9+
selector:
10+
matchLabels:
11+
type: frontend
12+
app: peerprep-fe
13+
template:
14+
metadata:
15+
name: peerprep-fe
16+
labels:
17+
type: frontend
18+
app: peerprep-fe
19+
spec:
20+
containers:
21+
- name: peerprep-fe
22+
image: asia-southeast1-docker.pkg.dev/cs3219-g11-peerprep/cs3219-g11-repo/peerprep-fe:latest
23+
# imagePullPolicy: Never # only used for local builds
24+
ports:
25+
- containerPort: 3000
26+
---
27+
apiVersion: v1
28+
kind: Service
29+
metadata:
30+
name: peerprep-fe
31+
spec:
32+
type: LoadBalancer
33+
ports:
34+
- port: 80
35+
targetPort: 3000
36+
selector:
37+
type: frontend
38+
app: peerprep-fe
39+
---
40+
apiVersion: autoscaling/v2
41+
kind: HorizontalPodAutoscaler
42+
metadata:
43+
name: peerprep-fe
44+
spec:
45+
scaleTargetRef:
46+
apiVersion: apps/v1
47+
kind: Deployment
48+
name: peerprep-fe
49+
minReplicas: 1
50+
maxReplicas: 5
51+
metrics:
52+
- type: Resource
53+
resource:
54+
name: cpu
55+
target:
56+
type: Utilization
57+
averageUtilization: 80

k8s/question-service.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: question-svc
5+
labels:
6+
type: backend
7+
app: question-svc
8+
spec:
9+
selector:
10+
matchLabels:
11+
type: backend
12+
app: question-svc
13+
template:
14+
metadata:
15+
name: question-svc
16+
labels:
17+
type: backend
18+
app: question-svc
19+
spec:
20+
containers:
21+
- name: question-svc
22+
image: asia-southeast1-docker.pkg.dev/cs3219-g11-peerprep/cs3219-g11-repo/question-svc:latest
23+
# imagePullPolicy: Never # only used for local builds
24+
ports:
25+
- containerPort: 4001
26+
envFrom:
27+
- configMapRef:
28+
name: question-service-config
29+
dnsPolicy: ClusterFirst
30+
---
31+
# This is an internal service, not exposed
32+
apiVersion: v1
33+
kind: Service
34+
metadata:
35+
name: question-svc
36+
spec:
37+
type: LoadBalancer
38+
ports:
39+
- port: 4001
40+
targetPort: 4001
41+
selector:
42+
type: backend
43+
app: question-svc
44+
---
45+
apiVersion: autoscaling/v2
46+
kind: HorizontalPodAutoscaler
47+
metadata:
48+
name: question-svc
49+
spec:
50+
scaleTargetRef:
51+
apiVersion: apps/v1
52+
kind: Deployment
53+
name: question-svc
54+
minReplicas: 1
55+
maxReplicas: 5
56+
metrics:
57+
- type: Resource
58+
resource:
59+
name: cpu
60+
target:
61+
type: Utilization
62+
averageUtilization: 80

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"scripts": {
3+
"pre-commit": "npm run --workspaces pre-commit",
4+
"prepare": "husky"
5+
},
6+
"devDependencies": {
7+
"husky": "^9.1.6"
8+
},
9+
"workspaces": [
10+
"question-service",
11+
"peerprep-fe"
12+
]
13+
}

peerprep-fe/.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
./node_modules
2+
.next
3+
.git
4+
.env*.local

peerprep-fe/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["next/core-web-vitals", "next/typescript"]
3+
}

peerprep-fe/.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
.env.*
31+
32+
# vercel
33+
.vercel
34+
35+
# typescript
36+
*.tsbuildinfo
37+
next-env.d.ts

peerprep-fe/.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 80,
6+
"plugins": ["prettier-plugin-tailwindcss"]
7+
}

0 commit comments

Comments
 (0)