diff --git a/.DS_Store b/.DS_Store index e59836faa6..07e52b32e0 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/backend/.DS_Store b/backend/.DS_Store index a55e11b45d..9830e0ea42 100644 Binary files a/backend/.DS_Store and b/backend/.DS_Store differ diff --git a/backend/question-service/backend/.env.example b/backend/question-service/.env.example similarity index 100% rename from backend/question-service/backend/.env.example rename to backend/question-service/.env.example diff --git a/backend/question-service/backend/.gitignore b/backend/question-service/.gitignore similarity index 100% rename from backend/question-service/backend/.gitignore rename to backend/question-service/.gitignore diff --git a/backend/question-service/backend/Dockerfile b/backend/question-service/Dockerfile similarity index 100% rename from backend/question-service/backend/Dockerfile rename to backend/question-service/Dockerfile diff --git a/backend/question-service/README.md b/backend/question-service/README.md index 5ddee1cbf1..3e20e8bc70 100644 --- a/backend/question-service/README.md +++ b/backend/question-service/README.md @@ -1,8 +1 @@ -[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/bzPrOe11) -# CS3219 Project (PeerPrep) - AY2425S1 -## Group: Gxx - -### Note: -- You can choose to develop individual microservices within separate folders within this repository **OR** use individual repositories (all public) for each microservice. -- In the latter scenario, you should enable sub-modules on this GitHub classroom repository to manage the development/deployment **AND** add your mentor to the individual repositories as a collaborator. -- The teaching team should be given access to the repositories as we may require viewing the history of the repository in case of any disputes or disagreements. +Backend services \ No newline at end of file diff --git a/backend/question-service/backend/.DS_Store b/backend/question-service/backend/.DS_Store deleted file mode 100644 index 1cad5fea00..0000000000 Binary files a/backend/question-service/backend/.DS_Store and /dev/null differ diff --git a/backend/question-service/backend/README.md b/backend/question-service/backend/README.md deleted file mode 100644 index 3e20e8bc70..0000000000 --- a/backend/question-service/backend/README.md +++ /dev/null @@ -1 +0,0 @@ -Backend services \ No newline at end of file diff --git a/backend/question-service/backend/package-lock.json b/backend/question-service/backend/package-lock.json deleted file mode 100644 index 4872a56f98..0000000000 --- a/backend/question-service/backend/package-lock.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "name": "backend", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "dotenv": "^16.4.5", - "mongodb": "^6.9.0" - } - }, - "node_modules/@mongodb-js/saslprep": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", - "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", - "dependencies": { - "sparse-bitfield": "^3.0.3" - } - }, - "node_modules/@types/webidl-conversions": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", - "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==" - }, - "node_modules/@types/whatwg-url": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", - "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", - "dependencies": { - "@types/webidl-conversions": "*" - } - }, - "node_modules/bson": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", - "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==", - "engines": { - "node": ">=16.20.1" - } - }, - "node_modules/dotenv": { - "version": "16.4.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", - "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/memory-pager": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" - }, - "node_modules/mongodb": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.9.0.tgz", - "integrity": "sha512-UMopBVx1LmEUbW/QE0Hw18u583PEDVQmUmVzzBRH0o/xtE9DBRA5ZYLOjpLIa03i8FXjzvQECJcqoMvCXftTUA==", - "dependencies": { - "@mongodb-js/saslprep": "^1.1.5", - "bson": "^6.7.0", - "mongodb-connection-string-url": "^3.0.0" - }, - "engines": { - "node": ">=16.20.1" - }, - "peerDependencies": { - "@aws-sdk/credential-providers": "^3.188.0", - "@mongodb-js/zstd": "^1.1.0", - "gcp-metadata": "^5.2.0", - "kerberos": "^2.0.1", - "mongodb-client-encryption": ">=6.0.0 <7", - "snappy": "^7.2.2", - "socks": "^2.7.1" - }, - "peerDependenciesMeta": { - "@aws-sdk/credential-providers": { - "optional": true - }, - "@mongodb-js/zstd": { - "optional": true - }, - "gcp-metadata": { - "optional": true - }, - "kerberos": { - "optional": true - }, - "mongodb-client-encryption": { - "optional": true - }, - "snappy": { - "optional": true - }, - "socks": { - "optional": true - } - } - }, - "node_modules/mongodb-connection-string-url": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", - "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", - "dependencies": { - "@types/whatwg-url": "^11.0.2", - "whatwg-url": "^13.0.0" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/sparse-bitfield": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", - "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", - "dependencies": { - "memory-pager": "^1.0.2" - } - }, - "node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "dependencies": { - "punycode": "^2.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-url": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", - "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", - "dependencies": { - "tr46": "^4.1.1", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=16" - } - } - } -} diff --git a/backend/question-service/backend/cmd/main.go b/backend/question-service/cmd/main.go similarity index 93% rename from backend/question-service/backend/cmd/main.go rename to backend/question-service/cmd/main.go index af51f0891b..c23c4215aa 100644 --- a/backend/question-service/backend/cmd/main.go +++ b/backend/question-service/cmd/main.go @@ -7,8 +7,8 @@ import ( "os" "time" - "backend/internal/controllers" - "backend/internal/routes" + "question-service/internal/controllers" + "question-service/internal/routes" "github.com/gorilla/mux" "github.com/gorilla/handlers" diff --git a/backend/question-service/backend/config/db.go b/backend/question-service/config/db.go similarity index 100% rename from backend/question-service/backend/config/db.go rename to backend/question-service/config/db.go diff --git a/backend/question-service/backend/go.mod b/backend/question-service/go.mod similarity index 96% rename from backend/question-service/backend/go.mod rename to backend/question-service/go.mod index 10ca83cef9..cfb8fefa45 100644 --- a/backend/question-service/backend/go.mod +++ b/backend/question-service/go.mod @@ -1,4 +1,4 @@ -module backend +module question-service go 1.23 diff --git a/backend/question-service/backend/go.sum b/backend/question-service/go.sum similarity index 96% rename from backend/question-service/backend/go.sum rename to backend/question-service/go.sum index cfd3aa6caf..d9d7464cb5 100644 --- a/backend/question-service/backend/go.sum +++ b/backend/question-service/go.sum @@ -1,12 +1,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= diff --git a/backend/question-service/backend/internal/controllers/createQuestion.go b/backend/question-service/internal/controllers/createQuestion.go similarity index 98% rename from backend/question-service/backend/internal/controllers/createQuestion.go rename to backend/question-service/internal/controllers/createQuestion.go index 169161c75c..ed8585e583 100644 --- a/backend/question-service/backend/internal/controllers/createQuestion.go +++ b/backend/question-service/internal/controllers/createQuestion.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "backend/internal/models" + "question-service/internal/models" "github.com/google/uuid" "go.mongodb.org/mongo-driver/bson" diff --git a/backend/question-service/backend/internal/controllers/deleteQuestion.go b/backend/question-service/internal/controllers/deleteQuestion.go similarity index 100% rename from backend/question-service/backend/internal/controllers/deleteQuestion.go rename to backend/question-service/internal/controllers/deleteQuestion.go diff --git a/backend/question-service/backend/internal/controllers/getAllQuestion.go b/backend/question-service/internal/controllers/getAllQuestion.go similarity index 98% rename from backend/question-service/backend/internal/controllers/getAllQuestion.go rename to backend/question-service/internal/controllers/getAllQuestion.go index d33ff93edb..f8dc46f517 100644 --- a/backend/question-service/backend/internal/controllers/getAllQuestion.go +++ b/backend/question-service/internal/controllers/getAllQuestion.go @@ -6,7 +6,7 @@ import ( "log" "net/http" "strconv" - "backend/internal/models" + "question-service/internal/models" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo/options" diff --git a/backend/question-service/backend/internal/controllers/getQuestionById.go b/backend/question-service/internal/controllers/getQuestionById.go similarity index 97% rename from backend/question-service/backend/internal/controllers/getQuestionById.go rename to backend/question-service/internal/controllers/getQuestionById.go index d0ce5f0c73..e568f8c677 100644 --- a/backend/question-service/backend/internal/controllers/getQuestionById.go +++ b/backend/question-service/internal/controllers/getQuestionById.go @@ -5,7 +5,7 @@ import ( "encoding/json" "log" "net/http" - "backend/internal/models" + "question-service/internal/models" "github.com/google/uuid" "github.com/gorilla/mux" diff --git a/backend/question-service/backend/internal/controllers/updateQuestion.go b/backend/question-service/internal/controllers/updateQuestion.go similarity index 100% rename from backend/question-service/backend/internal/controllers/updateQuestion.go rename to backend/question-service/internal/controllers/updateQuestion.go diff --git a/backend/question-service/backend/internal/models/questionModel.go b/backend/question-service/internal/models/questionModel.go similarity index 100% rename from backend/question-service/backend/internal/models/questionModel.go rename to backend/question-service/internal/models/questionModel.go diff --git a/backend/question-service/backend/internal/routes/questionRoutes.go b/backend/question-service/internal/routes/questionRoutes.go similarity index 93% rename from backend/question-service/backend/internal/routes/questionRoutes.go rename to backend/question-service/internal/routes/questionRoutes.go index e966002389..21acb621c0 100644 --- a/backend/question-service/backend/internal/routes/questionRoutes.go +++ b/backend/question-service/internal/routes/questionRoutes.go @@ -1,7 +1,7 @@ package routes import ( - "backend/internal/controllers" + "question-service/internal/controllers" "github.com/gorilla/mux" ) diff --git a/backend/question-service/package-lock.json b/backend/question-service/package-lock.json index 1b3cefbd15..4872a56f98 100644 --- a/backend/question-service/package-lock.json +++ b/backend/question-service/package-lock.json @@ -1,6 +1,159 @@ -{ - "name": "cs3219-ay2425s1-project-g47", - "lockfileVersion": 3, - "requires": true, - "packages": {} -} +{ + "name": "backend", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "dotenv": "^16.4.5", + "mongodb": "^6.9.0" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", + "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==" + }, + "node_modules/@types/whatwg-url": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", + "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/bson": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", + "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==", + "engines": { + "node": ">=16.20.1" + } + }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" + }, + "node_modules/mongodb": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.9.0.tgz", + "integrity": "sha512-UMopBVx1LmEUbW/QE0Hw18u583PEDVQmUmVzzBRH0o/xtE9DBRA5ZYLOjpLIa03i8FXjzvQECJcqoMvCXftTUA==", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.7.0", + "mongodb-connection-string-url": "^3.0.0" + }, + "engines": { + "node": ">=16.20.1" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.1.0", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.2", + "socks": "^2.7.1" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + }, + "socks": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", + "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=16" + } + } + } +} diff --git a/backend/question-service/backend/package.json b/backend/question-service/package.json similarity index 100% rename from backend/question-service/backend/package.json rename to backend/question-service/package.json diff --git a/docker-compose.yaml b/docker-compose.yaml index cb61116ffc..7fc7e7b3d7 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,3 @@ -version: '3' - services: frontend: build: @@ -9,12 +7,31 @@ services: environment: - NODE_ENV=production depends_on: - - backend + - user-service + - question-service + networks: + - app-network - backend: + user-service: build: - context: ./backend + context: ./backend/user-service ports: - - "5050:5050" + - "3001:3001" environment: - NODE_ENV=production + networks: + - app-network + + question-service: + build: + context: ./backend/question-service + ports: + - "5050:5050" + environment: + - NODE_ENV=production + networks: + - app-network + +networks: + app-network: + driver: bridge diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json index d3067d4cf7..7a3a6f3155 100644 --- a/frontend/.eslintrc.json +++ b/frontend/.eslintrc.json @@ -11,7 +11,14 @@ "plugin:react-hooks/recommended", "plugin:jsx-a11y/recommended" ], - "plugins": ["react", "unused-imports", "import", "@typescript-eslint", "jsx-a11y", "prettier"], + "plugins": [ + "react", + "unused-imports", + "import", + "@typescript-eslint", + "jsx-a11y", + "prettier" + ], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { @@ -33,7 +40,12 @@ "react-hooks/exhaustive-deps": "off", "jsx-a11y/click-events-have-key-events": "warn", "jsx-a11y/interactive-supports-focus": "warn", - "prettier/prettier": "warn", + "prettier/prettier": [ + "warn", + { + "endOfLine": "auto" + } + ], "no-unused-vars": "off", "unused-imports/no-unused-vars": "off", "unused-imports/no-unused-imports": "warn", @@ -80,8 +92,8 @@ ], "padding-line-between-statements": [ "warn", - {"blankLine": "always", "prev": "*", "next": "return"}, - {"blankLine": "always", "prev": ["const", "let", "var"], "next": "*"}, + { "blankLine": "always", "prev": "*", "next": "return" }, + { "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" }, { "blankLine": "any", "prev": ["const", "let", "var"], diff --git a/frontend/README.md b/frontend/README.md index b2608dc2f0..cd661f7d3a 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,6 +1,7 @@ # PeerPrep G47 Frontend ## How to set up frontend after cloning the repository + ### Install dependencies Using `npm`: diff --git a/frontend/components/questions/ActionButtons.tsx b/frontend/components/questions/ActionButtons.tsx index 71ea39eb4d..6e4c43c7fe 100644 --- a/frontend/components/questions/ActionButtons.tsx +++ b/frontend/components/questions/ActionButtons.tsx @@ -4,9 +4,9 @@ import { ModalHeader, ModalBody, ModalFooter, - Button, useDisclosure, -} from "@nextui-org/react"; +} from "@nextui-org/modal"; +import { Button } from "@nextui-org/button"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/frontend/package.json b/frontend/package.json index 39d0323e5c..cbdf661264 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,60 +1,61 @@ { - "name": "next-pages-template", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "next dev --turbo", - "build": "next build", - "start": "next build && next start", - "lint": "eslint . --ext .ts,.tsx -c .eslintrc.json --fix" - }, - "dependencies": { - "@nextui-org/button": "2.0.38", - "@nextui-org/code": "2.0.33", - "@nextui-org/input": "2.2.5", - "@nextui-org/kbd": "2.0.34", - "@nextui-org/link": "2.0.35", - "@nextui-org/listbox": "2.1.27", - "@nextui-org/navbar": "2.0.37", - "@nextui-org/pagination": "^2.0.36", - "@nextui-org/react": "^2.4.8", - "@nextui-org/select": "^2.2.7", - "@nextui-org/snippet": "2.0.43", - "@nextui-org/switch": "2.0.34", - "@nextui-org/system": "2.2.6", - "@nextui-org/table": "^2.0.40", - "@nextui-org/theme": "2.2.11", - "@react-aria/visually-hidden": "3.8.12", - "@tanstack/react-query": "^5.56.2", - "axios": "^1.7.7", - "clsx": "2.1.1", - "framer-motion": "~11.1.1", - "intl-messageformat": "^10.5.0", - "next": "14.2.4", - "next-themes": "^0.2.1", - "react": "18.3.1", - "react-dom": "18.3.1" - }, - "devDependencies": { - "@types/node": "20.5.7", - "@types/react": "18.3.3", - "@types/react-dom": "18.3.0", - "@typescript-eslint/eslint-plugin": "7.2.0", - "@typescript-eslint/parser": "7.2.0", - "autoprefixer": "10.4.19", - "concurrently": "^9.0.1", - "eslint": "^8.57.0", - "eslint-config-prettier": "^8.2.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-react": "^7.23.2", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-unused-imports": "^3.2.0", - "postcss": "8.4.38", - "tailwind-variants": "0.1.20", - "tailwindcss": "3.4.3", - "typescript": "5.0.4" - } + "name": "next-pages-template", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev --turbo", + "build": "next build", + "start": "next build && next start", + "lint": "eslint . --ext .ts,.tsx -c .eslintrc.json --fix" + }, + "dependencies": { + "@nextui-org/button": "2.0.38", + "@nextui-org/card": "^2.0.34", + "@nextui-org/code": "2.0.33", + "@nextui-org/input": "2.2.5", + "@nextui-org/kbd": "2.0.34", + "@nextui-org/link": "2.0.35", + "@nextui-org/listbox": "2.1.27", + "@nextui-org/modal": "^2.0.41", + "@nextui-org/navbar": "2.0.37", + "@nextui-org/pagination": "^2.0.36", + "@nextui-org/select": "^2.2.7", + "@nextui-org/snippet": "2.0.43", + "@nextui-org/switch": "2.0.34", + "@nextui-org/system": "2.2.6", + "@nextui-org/table": "^2.0.40", + "@nextui-org/theme": "2.2.11", + "@react-aria/visually-hidden": "3.8.12", + "@tanstack/react-query": "^5.56.2", + "axios": "^1.7.7", + "clsx": "2.1.1", + "framer-motion": "~11.1.1", + "intl-messageformat": "^10.5.0", + "next": "14.2.4", + "next-themes": "^0.2.1", + "react": "18.3.1", + "react-dom": "18.3.1" + }, + "devDependencies": { + "@types/node": "20.5.7", + "@types/react": "18.3.3", + "@types/react-dom": "18.3.0", + "@typescript-eslint/eslint-plugin": "7.2.0", + "@typescript-eslint/parser": "7.2.0", + "autoprefixer": "10.4.19", + "concurrently": "^9.0.1", + "eslint": "^8.57.0", + "eslint-config-prettier": "^8.2.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jsx-a11y": "^6.4.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-react": "^7.23.2", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-unused-imports": "^3.2.0", + "postcss": "8.4.38", + "tailwind-variants": "0.1.20", + "tailwindcss": "3.4.3", + "typescript": "5.0.4" + } } diff --git a/frontend/postcss.config.js b/frontend/postcss.config.js index 33ad091d26..12a703d900 100644 --- a/frontend/postcss.config.js +++ b/frontend/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +};