Skip to content

Commit 0def43c

Browse files
committed
link question service to frontend
- add cors to question service - add prettier and prettier tailwind to peerprep-fe - add axios to peerprep-fe
1 parent 4574203 commit 0def43c

33 files changed

+679
-411
lines changed

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@ services:
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
1115
networks:
1216
- peerprep-network
17+
env_file:
18+
- ./peerprep-fe/.env.production
1319
question-service:
1420
image: asia-southeast1-docker.pkg.dev/cs3219-g11-peerprep/cs3219-g11-repo/question-svc:latest
1521
build:
1622
context: ./question-service
1723
dockerfile: Dockerfile
24+
volumes:
25+
- ./question-service:/app # Mount src directory for hot reloading
26+
- ./question-service/node_modules:/app/node_modules
1827
ports:
1928
- "4001:4001"
2029
environment:

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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
"build": "next build",
88
"start": "next start -p 3000 -H 0.0.0.0",
99
"lint": "next lint",
10-
"pre-commit": "pnpm lint"
10+
"format": "prettier --write \"src/**/*.tsx\" \"src/**/*.ts\" \"./tailwind.config.ts\"",
11+
"pre-commit": "pnpm format && git add -u"
1112
},
1213
"dependencies": {
1314
"@radix-ui/react-dialog": "^1.1.1",
1415
"@radix-ui/react-icons": "^1.3.0",
1516
"@radix-ui/react-popover": "^1.1.1",
1617
"@radix-ui/react-select": "^2.1.1",
1718
"@radix-ui/react-slot": "^1.1.0",
19+
"axios": "^1.7.7",
1820
"class-variance-authority": "^0.7.0",
1921
"clsx": "^2.1.1",
2022
"cmdk": "1.0.0",
@@ -33,6 +35,8 @@
3335
"eslint": "^8",
3436
"eslint-config-next": "14.2.12",
3537
"postcss": "^8",
38+
"prettier": "^3.3.3",
39+
"prettier-plugin-tailwindcss": "^0.6.8",
3640
"tailwindcss": "^3.4.1",
3741
"typescript": "^5"
3842
}

peerprep-fe/pnpm-lock.yaml

Lines changed: 145 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)