Skip to content

Commit 03cdc11

Browse files
authored
Merge pull request #22 from CS3219-AY2425S1/feat/link-fe-to-question-service
2 parents 654a40e + 5619e9d commit 03cdc11

40 files changed

+6109
-514
lines changed

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
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: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
1-
version: "3"
21
services:
32
frontend:
3+
image: asia-southeast1-docker.pkg.dev/cs3219-g11-peerprep/cs3219-g11-repo/peerprep-fe:latest
44
build:
55
context: ./peerprep-fe
66
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
711
ports:
812
- "3000:3000"
913
environment:
1014
- NODE_ENV=production
11-
12-
# Add other microservices here
13-
# backend:
14-
# ...
15-
# database:
16-
# ...
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

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/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ yarn-error.log*
2727

2828
# local env files
2929
.env*.local
30+
.env.*
3031

3132
# vercel
3233
.vercel

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+
}

peerprep-fe/next.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
output: "standalone",
3+
output: "standalone"
44
};
55

66
export default nextConfig;

peerprep-fe/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start -p 3000 -H 0.0.0.0",
9-
"lint": "next lint"
9+
"lint": "next lint",
10+
"format": "prettier --write \"src/**/*.tsx\" \"src/**/*.ts\" \"./tailwind.config.ts\"",
11+
"pre-commit": "pnpm format && git add -u"
1012
},
1113
"dependencies": {
1214
"@radix-ui/react-dialog": "^1.1.1",
1315
"@radix-ui/react-icons": "^1.3.0",
1416
"@radix-ui/react-popover": "^1.1.1",
1517
"@radix-ui/react-select": "^2.1.1",
1618
"@radix-ui/react-slot": "^1.1.0",
19+
"axios": "^1.7.7",
1720
"class-variance-authority": "^0.7.0",
1821
"clsx": "^2.1.1",
1922
"cmdk": "1.0.0",
@@ -32,6 +35,8 @@
3235
"eslint": "^8",
3336
"eslint-config-next": "14.2.12",
3437
"postcss": "^8",
38+
"prettier": "^3.3.3",
39+
"prettier-plugin-tailwindcss": "^0.6.8",
3540
"tailwindcss": "^3.4.1",
3641
"typescript": "^5"
3742
}

0 commit comments

Comments
 (0)