Skip to content

Commit 29159f0

Browse files
authored
Merge pull request #43 from CS3219-AY2425S1/PEER-234-Editor-UI
PEER-234: Add Editor UI
2 parents 3fcfda8 + 8ec9976 commit 29159f0

40 files changed

+2388
-306
lines changed

.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ QUESTION_PGDATA="/data/qn-db"
1010

1111
COLLAB_SERVICE_NAME=collab-express
1212
COLLAB_EXPRESS_PORT=9003
13-
COLLAB_EXPRESS_DB_PORT=5435
13+
COLLAB_EXPRESS_DB_PORT=5434
1414
COLLAB_PGDATA="/data/collab-db"
1515

1616
MATCHING_SERVICE_NAME=match-express

.github/workflows/build-docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
cache-to: type=gha,mode=max
184184

185185
results:
186-
if: ${{ always() }}
186+
if: ${{ always() && !github.event.pull_request.draft }}
187187
runs-on: ubuntu-latest
188188
name: Final Results
189189
needs: build-and-push-image

backend/collaboration/.env.docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PEERPREP_UI_HOST=http://host.docker.internal:5173
22

33
EXPRESS_PORT=9003
44
EXPRESS_DB_HOST=host.docker.internal
5-
EXPRESS_DB_PORT=5435
5+
EXPRESS_DB_PORT=5434
66
POSTGRES_DB=collab
77
POSTGRES_USER=peerprep-collab-express
88
POSTGRES_PASSWORD=6rYE0nIzI2ThzDO

backend/collaboration/.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PEERPREP_UI_HOST="http://localhost:5173"
22

33
EXPRESS_PORT=9003
44
EXPRESS_DB_HOST="localhost"
5-
EXPRESS_DB_PORT=5435
5+
EXPRESS_DB_PORT=5434
66
POSTGRES_DB="collab"
77
POSTGRES_USER="peerprep-collab-express"
88
POSTGRES_PASSWORD="6rYE0nIzI2ThzDO"

backend/collaboration/src/server.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,21 @@ import { setUpWSServer } from './ws';
1515

1616
const app = express();
1717

18-
app.use(pino());
18+
app.use(
19+
pino({
20+
serializers: {
21+
req: ({ id, method, url, headers: { host, referer }, query, params }) => ({
22+
id,
23+
method,
24+
url,
25+
headers: { host, referer },
26+
query,
27+
params,
28+
}),
29+
res: ({ statusCode }) => ({ statusCode }),
30+
},
31+
})
32+
);
1933
app.use(json());
2034
app.use(
2135
cors({

backend/matching/src/server.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,21 @@ import { UI_HOST } from './config';
1111
import { createWs } from './ws';
1212

1313
const app = express();
14-
app.use(pino());
14+
app.use(
15+
pino({
16+
serializers: {
17+
req: ({ id, method, url, headers: { host, referer }, query, params }) => ({
18+
id,
19+
method,
20+
url,
21+
headers: { host, referer },
22+
query,
23+
params,
24+
}),
25+
res: ({ statusCode }) => ({ statusCode }),
26+
},
27+
})
28+
);
1529
app.use(json());
1630
app.use(
1731
cors({

backend/question/src/server.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,21 @@ import { logger } from '@/lib/utils';
1313
import questionsRouter from '@/routes/question';
1414

1515
const app = express();
16-
app.use(pino());
16+
app.use(
17+
pino({
18+
serializers: {
19+
req: ({ id, method, url, headers: { host, referer }, query, params }) => ({
20+
id,
21+
method,
22+
url,
23+
headers: { host, referer },
24+
query,
25+
params,
26+
}),
27+
res: ({ statusCode }) => ({ statusCode }),
28+
},
29+
})
30+
);
1731
app.use(json());
1832
app.use(helmet());
1933
app.use(

backend/user/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "user-express",
2+
"name": "user",
33
"version": "1.0.0",
44
"main": "dist/index.js",
55
"scripts": {

backend/user/src/server.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,21 @@ import authCheckRoutes from '@/routes/auth-check';
1616
import userRoutes from '@/routes/user';
1717

1818
const app = express();
19-
app.use(pino());
19+
app.use(
20+
pino({
21+
serializers: {
22+
req: ({ id, method, url, headers: { host, referer }, query, params }) => ({
23+
id,
24+
method,
25+
url,
26+
headers: { host, referer },
27+
query,
28+
params,
29+
}),
30+
res: ({ statusCode }) => ({ statusCode }),
31+
},
32+
})
33+
);
2034
app.use(json());
2135
app.use(helmet());
2236
app.use(cookieParser());

docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ services:
227227
environment:
228228
- VITE_USER_SERVICE=http://${USER_SERVICE_NAME}:${USER_EXPRESS_PORT}
229229
- VITE_QUESTION_SERVICE=http://${QUESTION_SERVICE_NAME}:${QUESTION_EXPRESS_PORT}
230+
- VITE_COLLAB_SERVICE=http://${COLLAB_SERVICE_NAME}:${COLLAB_EXPRESS_PORT}
231+
- VITE_COLLAB_WS=ws://${COLLAB_SERVICE_NAME}:${COLLAB_EXPRESS_PORT}
230232
- VITE_MATCHING_SERVICE=http://${MATCHING_SERVICE_NAME}:${MATCHING_EXPRESS_PORT}
231233
- FRONTEND_PORT=${FRONTEND_PORT}
232234
depends_on:

0 commit comments

Comments
 (0)