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

Support for storage of multiple coding languages in editor #27

Open
wants to merge 162 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
e9879d0
Add collaboration service
meowwtama Oct 17, 2024
9c6b141
Update MonacoEditor.tsx
meowwtama Oct 20, 2024
d2bbcbf
show username when logged in
abstxn Oct 24, 2024
eb4257c
add logout feature
abstxn Oct 24, 2024
60af46a
prompt user to sign in again if signed out when matching
abstxn Oct 24, 2024
d3ee932
Merge branch 'CS3219-AY2425S1:main' into feature/collaboration-service
meowwtama Oct 26, 2024
817d901
Update request param
meowwtama Oct 26, 2024
356b1ff
Install firebase
techjay-c Oct 27, 2024
2cdf9b7
Add frontend component for collaboration code editor page
techjay-c Oct 28, 2024
bca4325
Add profile page functionality to login flow
techjay-c Oct 28, 2024
3424e10
Remove old navbar component and modify new navbar
techjay-c Oct 28, 2024
0232f67
Update usage of variables from local variables to session variables a…
techjay-c Oct 28, 2024
cc67a47
Add About Us page
techjay-c Oct 28, 2024
cdc04d6
Revert to use local storage instead of session storage
techjay-c Oct 28, 2024
a40f7ba
Update typescript error to fix question list fetch bug
techjay-c Oct 28, 2024
a4abe25
Add About Us page ref to nav bar
techjay-c Oct 28, 2024
39e3a42
Add Change Password page and functionality
techjay-c Oct 28, 2024
2e4d595
Add JWT authentication
meowwtama Oct 28, 2024
fea1754
Update nav bar to show match me tab only if user is authenticated
techjay-c Oct 29, 2024
8483d75
Merge pull request #17 from meowwtama/feature/collaboration-service
techjay-c Oct 29, 2024
1cd79d5
Merge branch 'feature/collab-backend' of https://github.com/CS3219-AY…
techjay-c Oct 29, 2024
58debd4
Added add question modal for admin role
ruth-lim Oct 29, 2024
d1f7256
Refresh table upon adding question
ruth-lim Oct 29, 2024
afdf545
Added delete question function
ruth-lim Oct 29, 2024
63be5f5
Enhance dequeue service with status based timer handling for match ev…
techjay-c Oct 29, 2024
5af59c2
Added edit question function
ruth-lim Oct 30, 2024
23bf935
Fix return
meowwtama Oct 30, 2024
879b37c
Merge pull request #18 from CS3219-AY2425S1/feature/collab-env
meowwtama Oct 30, 2024
5ea572e
dequeue timeout is relative to match request time
abstxn Oct 30, 2024
2e3bd38
Merge branch 'feature/collab-env' into feature/profile-page
abstxn Oct 30, 2024
ec07e90
Update questionId in init-question-db to correct type
ruth-lim Oct 30, 2024
535bebc
Insert questionId into payload in backend
ruth-lim Oct 30, 2024
36e2730
Change category to string[]
ruth-lim Oct 30, 2024
dbf84c4
Handle edge cases for question list
ruth-lim Oct 30, 2024
7b015a4
implement basic password change
abstxn Oct 31, 2024
f132745
implement account deletion
abstxn Oct 31, 2024
53f3476
Update CodeEditor frontend to use QuestionSideBar components
techjay-c Oct 31, 2024
a73473c
Change Create Room parameters
meowwtama Oct 31, 2024
17d3235
Change to multiselect for topics
ruth-lim Oct 31, 2024
7a800cf
Change topics to use enum values
ruth-lim Oct 31, 2024
3869fd5
Verify admin status at login
ruth-lim Oct 31, 2024
0ee8014
Integrate Collaboration Service backend
meowwtama Oct 31, 2024
24283a0
set up skeleton for the chat service
alyssaongyx Oct 31, 2024
d8f69d4
secure password change process
abstxn Nov 1, 2024
8a5f384
Dockerize collaboration-service and update collab service to use port…
techjay-c Nov 1, 2024
23b3552
Add logging for room ID
techjay-c Nov 1, 2024
e91caf9
Update Code editor page
techjay-c Nov 1, 2024
2a025a0
implement password reset feature
abstxn Nov 1, 2024
2552a49
Add link redirection to code editor
techjay-c Nov 1, 2024
0dd5004
Fix code editor to take room ID only
techjay-c Nov 1, 2024
65e65ef
update styles of chat
alyssaongyx Nov 1, 2024
079bfe7
Update authenticated routes
techjay-c Nov 1, 2024
6fd4066
Add support for multiple programming languages
techjay-c Nov 1, 2024
fb86685
Merge branch 'feature/profile-page' into feature/collab-env
abstxn Nov 2, 2024
c7b5113
modify room joining logic
abstxn Nov 2, 2024
8f46e55
Create leave room function
techjay-c Nov 2, 2024
fa9e644
Add function for users to leave room and integrate with backend routes
techjay-c Nov 3, 2024
8be5100
Add chakra UI alert dialog component in code editor
techjay-c Nov 3, 2024
223f75f
Update leave room function to reset matching status
techjay-c Nov 3, 2024
18ea480
Update code editor to pull question details from backend route
techjay-c Nov 3, 2024
2e04728
Update manifesto on about us page
techjay-c Nov 4, 2024
bd77aed
Add syntax highlighting using Shikijs
techjay-c Nov 4, 2024
686a86c
Merge branch 'question-service-enhancement' of https://github.com/CS3…
techjay-c Nov 4, 2024
ff7c1d0
Update code editor to sync language template during change in languag…
techjay-c Nov 4, 2024
5e4abd2
Fix username on account button bug
techjay-c Nov 4, 2024
6375941
Update backend code logic for leave room to update room status and ma…
techjay-c Nov 4, 2024
9a9c3b6
Update question model
meowwtama Nov 4, 2024
b0dedb7
Add questionId field to add question
meowwtama Nov 4, 2024
caa6eec
Add duplicate check for title and description
meowwtama Nov 4, 2024
07ca595
Add get question by category
meowwtama Nov 4, 2024
d0a4ece
Add random question assignment
meowwtama Nov 4, 2024
6830252
Add history service
meowwtama Nov 4, 2024
b1c81e6
Update difficulty level of question to show color
techjay-c Nov 4, 2024
88ce6eb
Merge pull request #24 from CS3219-AY2425S1/draft/collab-env
techjay-c Nov 4, 2024
7236b14
Update Time format
meowwtama Nov 5, 2024
3948f80
fix login issue
abstxn Nov 5, 2024
58f986b
fix waiting time not clearing
abstxn Nov 5, 2024
00ca21d
prevent easy and hard matches
abstxn Nov 5, 2024
2c4abeb
Update code editor frontend and backend to support storage of 4 progr…
techjay-c Nov 5, 2024
7b19fda
Merge branch 'feature/collab-env' of https://github.com/CS3219-AY2425…
techjay-c Nov 5, 2024
4488c96
Update question-controller.ts
meowwtama Nov 5, 2024
f764b40
Merge branch 'feature/collab-env' of https://github.com/CS3219-AY2425…
techjay-c Nov 5, 2024
f6bece9
Fix bug for question details page on frontend
techjay-c Nov 5, 2024
1473302
Merge changes for support for multiple languages in firebase
techjay-c Nov 5, 2024
d8b8441
Merge branch 'feature/collab-env' of https://github.com/CS3219-AY2425…
alyssaongyx Nov 6, 2024
8f11359
fix type error when fetching questions by id
abstxn Nov 6, 2024
7ab1b66
Merge branch 'bugfixes' of https://github.com/CS3219-AY2425S1/cs3219-…
techjay-c Nov 6, 2024
cb4b855
define proper startup order for kafka dependents
abstxn Nov 6, 2024
79ded5a
transition modal when leaving room
abstxn Nov 6, 2024
1bd3dcd
toast when partner leaves room
abstxn Nov 6, 2024
592a1f2
display room active status
abstxn Nov 6, 2024
019e83c
integrate chat into collab
alyssaongyx Nov 6, 2024
5216b08
Merge branch 'feature/chat-service' into develop
abstxn Nov 6, 2024
c3dd3f9
Merge branch 'features/ux' into develop
abstxn Nov 6, 2024
92c062c
Update editor page to display question assigned to the user
techjay-c Nov 6, 2024
de3fcc5
show username of partner in chat
abstxn Nov 6, 2024
8bfbadb
add history frontend
alyssaongyx Nov 6, 2024
c21fcba
Merge branch 'feature/collab-env' into develop
abstxn Nov 6, 2024
f470dcc
Merge branch 'feature/history-service' into develop
abstxn Nov 6, 2024
db386b8
viewing old attempt brings back to old room
abstxn Nov 6, 2024
65872b4
redirect to / when leaving old room
abstxn Nov 6, 2024
1814513
Remove home page from navbar and fix bug for preserving editor state …
techjay-c Nov 6, 2024
593e730
Merge branch 'develop' of https://github.com/CS3219-AY2425S1/cs3219-a…
techjay-c Nov 6, 2024
54e1156
Merge pull request #30 from CS3219-AY2425S1/feature/collab-enhancement
techjay-c Nov 6, 2024
9b63af6
add jenkins
alyssaongyx Nov 6, 2024
1089874
loading modal before entering matched room
abstxn Nov 7, 2024
835ae8c
random question pool accounts for difficulties
abstxn Nov 7, 2024
706dd70
frontend will not allow invalid topic/difficulty pairs
abstxn Nov 7, 2024
8c6ca1e
prevent users from sending empty chat messages
abstxn Nov 7, 2024
585bf56
add save status check
abstxn Nov 7, 2024
28f61eb
fix the chat length and remove UTC
alyssaongyx Nov 7, 2024
5197ba6
prevent user from typing empty messages
alyssaongyx Nov 7, 2024
33a8ac1
disable editing if one user leaves
abstxn Nov 7, 2024
31f6037
old rooms will not display chat
abstxn Nov 7, 2024
57bf085
Merge branch 'feature/jenkins' into develop
abstxn Nov 7, 2024
d4b7aa9
show status of other user in the collaboration environment
abstxn Nov 7, 2024
9e6e731
remove redundant run button
abstxn Nov 7, 2024
1a6be29
time is shown in singapore locale
abstxn Nov 7, 2024
e6777a7
fix bug with joining old room changing activity status
abstxn Nov 7, 2024
b4b774c
update post
alyssaongyx Nov 8, 2024
05f4533
add build script
alyssaongyx Nov 9, 2024
227890c
Update firebaseConfig.ts
meowwtama Nov 9, 2024
78cff3c
Remove API keys
meowwtama Nov 9, 2024
92bd549
added branchname
alyssaongyx Nov 9, 2024
0a74820
add option for user to download code
abstxn Nov 9, 2024
102c42f
revert to use scm
alyssaongyx Nov 9, 2024
f97e8da
add console log
alyssaongyx Nov 9, 2024
66aabb5
update console log
alyssaongyx Nov 9, 2024
884ef4b
show room active time and fix time format bug
abstxn Nov 9, 2024
3bfc450
ensure topics and difficulties are always sorted
abstxn Nov 9, 2024
e64cb64
remove typo
alyssaongyx Nov 9, 2024
fe053ed
Update env file configurations
meowwtama Nov 9, 2024
63f569d
Add backend for history category
meowwtama Nov 9, 2024
0eecbec
Merge branch 'features/ux' into develop
abstxn Nov 9, 2024
bbb9f28
update logs
alyssaongyx Nov 9, 2024
e3e0247
update logs
alyssaongyx Nov 9, 2024
af341d2
add docker installation
alyssaongyx Nov 9, 2024
f4771db
add console log to trigger pipeline
alyssaongyx Nov 9, 2024
c8bd758
enforce creation of secure passwords
abstxn Nov 9, 2024
73fbfc8
Merge branch 'feature/secure-password' into develop
abstxn Nov 9, 2024
f6e19f9
update docker tool
alyssaongyx Nov 9, 2024
d4f21f2
update docker tool
alyssaongyx Nov 9, 2024
81abddf
Add time spent in History data
meowwtama Nov 9, 2024
673f732
only fetch waiting time on reload
abstxn Nov 10, 2024
f209460
prevent unnecessary stage changes
abstxn Nov 10, 2024
d2dfd91
add tests for question-service
alyssaongyx Nov 9, 2024
77992e3
add tests for history-service
alyssaongyx Nov 9, 2024
5a0e4d6
update tests
alyssaongyx Nov 9, 2024
b1a6abe
update jenkins
alyssaongyx Nov 10, 2024
bde28a9
store chat messages in local storage
alyssaongyx Nov 10, 2024
965d91c
Merge branch 'feature/matching-algorithm' into develop
abstxn Nov 10, 2024
faab1a6
Update room model to include userLanguage field
techjay-c Nov 13, 2024
cb668e9
Update code editor to implement user confirmation when language switc…
techjay-c Nov 13, 2024
d6a70c1
Fix bug that current user will still receive language toast even if h…
techjay-c Nov 13, 2024
91f6c06
Fix more bugs for code language switching
techjay-c Nov 13, 2024
8e8d67e
Merge branch 'develop' into feature/collab-new-enhance
techjay-c Nov 13, 2024
5dea56f
Merge pull request #36 from CS3219-AY2425S1/feature/collab-new-enhance
techjay-c Nov 13, 2024
7f386b6
Fix duplicate const declaration in code editor file
techjay-c Nov 13, 2024
e681a61
Fix bug for multiple toast messages when code language is spammed
techjay-c Nov 13, 2024
37ef707
Remove unused declarations
techjay-c Nov 13, 2024
c5e5f88
remove 100vh from question side bar to remove overflow and adjusted h…
alyssaongyx Nov 14, 2024
3fba670
Update code editor page
techjay-c Nov 14, 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
120 changes: 120 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
pipeline {
environment {
customImage = ""
}

agent any
tools {
nodejs 'nodejs'
}

stages {
stage('Clone Repository') {
steps {
checkout scm
echo 'Testing'
}
}

stage('Build History Service') {
steps {
dir('history-service') {
sh '''
npm install
npm run build
'''
}
}
}

// stage('Test History Service') {
// steps {
// dir('history-service') {
// sh '''
// npm test
// '''
// }
// }
// }

stage('Build Questions Service') {
steps {
dir('question-service') {
sh '''
npm install
npm run build
'''
}
}
}

stage('Test Questions Service') {
steps {
dir('question-service') {
sh '''
npm test
'''
}
}
}

// Optionally, uncomment to build the frontend
// stage('Build Frontend') {
// steps {
// dir('frontend') {
// sh '''
// npm install
// npm run dev
// '''
// }
// }
// }

// stage('Build History Docker Image') {
// steps {
// dir('history-service') {
// script {
// withDockerRegistry(credentialsId: 'docker-credentials', url: '') {
// customImage = docker.build("alyssaoyx/history-service:${BUILD_NUMBER}")
// }
// }
// }
// }
// }

// stage('Build Questions Docker Image') {
// steps {
// dir('question-service') {
// script {
// customImage = docker.build("alyssaoyx/question-service:${env.BUILD_ID}")
// }
// }
// }
// }

// stage('Push Docker Images to Registry') {
// steps {
// script {
// withCredentials([usernamePassword(credentialsId: 'docker-credentials', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASSWORD')]) {
// sh 'echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin'
// }
// sh "docker push alyssaoyx/history-service:${env.BUILD_ID}"
// sh "docker push alyssaoyx/question-service:${env.BUILD_ID}"
// }
// }
// }
}
// post {
// always {
// echo 'Cleaning up Docker images...'
// sh 'docker rmi alyssaoyx/history-service:${env.BUILD_ID} || true'
// sh 'docker rmi alyssaoyx/question-service:${env.BUILD_ID} || true'
// }
// success {
// echo 'Pipeline completed successfully!'
// }
// failure {
// echo 'Pipeline failed. Please check the logs for errors.'
// }
// }
}
13 changes: 13 additions & 0 deletions chat-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22-alpine

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 4000

CMD ["npm", "run", "dev"]
67 changes: 67 additions & 0 deletions chat-service/middleware/authMiddleware.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var _this = this;
var verifyJWT = function (authorizationHeader) { return __awaiter(_this, void 0, void 0, function () {
var response, data, error_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 3, , 4]);
return [4 /*yield*/, global.fetch("http://user-service:3001/auth/verify-token", {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: "".concat(authorizationHeader),
},
})];
case 1:
response = _a.sent();
return [4 /*yield*/, response.json()];
case 2:
data = _a.sent();
if (data.message !== "Token verified") {
throw new Error("JWT verification failed: ".concat(data.message));
}
return [2 /*return*/, data.data]; // Return user data if verification is successful
case 3:
error_1 = _a.sent();
throw new Error("Failed to verify JWT");
case 4: return [2 /*return*/];
}
});
}); };
module.exports = verifyJWT;
23 changes: 23 additions & 0 deletions chat-service/middleware/authMiddleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const verifyJWT = async (authorizationHeader) => {
try {
const response = await global.fetch(
"http://user-service:3001/auth/verify-token",
{
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `${authorizationHeader}`,
},
}
);
const data = await response.json();
if (data.message !== "Token verified") {
throw new Error(`JWT verification failed: ${data.message}`);
}
return data.data; // Return user data if verification is successful
} catch (error) {
throw new Error("Failed to verify JWT");
}
};

module.exports = verifyJWT;
Loading