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

Main Release - 202409 #146

Closed
wants to merge 293 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
293 commits
Select commit Hold shift + click to select a range
6ba31e9
migrate: drop_subject_professor_course_list
duncan020313 Jul 11, 2023
2edd3e5
migrate: add_fk_subject_course_professors
duncan020313 Jul 12, 2023
646da14
migrate: add_fk_subject_course_subject_lecture
duncan020313 Jul 17, 2023
2a9a31e
Merge: merge with release
LarryKwon Jul 24, 2023
f7c7c0a
migrate: add fk between lecture and department
duncan020313 Jul 24, 2023
4eb2ac6
Merge branch 'release' of github.com:sparcs-kaist/otlplus-server into…
duncan020313 Jul 24, 2023
8a11161
Delete: remove user.serializer
duncan020313 Jul 24, 2023
95ae6fb
refactor: implement types and serializer for courses
LarryKwon Jul 24, 2023
836e701
Fix: change hadling no representative lecture case to 0
duncan020313 Jul 24, 2023
788d157
temp
duncan020313 Jul 24, 2023
f400f6c
migrate: add fk between lecture and department
duncan020313 Jul 24, 2023
380264a
temp
duncan020313 Jul 24, 2023
be73bfb
Add: apply toJson serializer to session/info api
LarryKwon Jul 24, 2023
aa234a0
Migrate: add fk between subject_lecture and subject_professor
duncan020313 Jul 24, 2023
2a6d8dd
Migrate: add fk between subject_lecture and subject_professor
duncan020313 Jul 24, 2023
ad514b5
Add: add new fks in prisma class
duncan020313 Jul 24, 2023
e9d3cad
Add: implement classtime serializer
duncan020313 Jul 24, 2023
4bd9855
Migrate: add fk between review_review and subject_lecture
Jiuuung Jul 24, 2023
02519d5
Add: implement examtime serializer
duncan020313 Jul 24, 2023
d394423
Add: define dto for reponse
duncan020313 Jul 24, 2023
e3c4a0b
Add: implement getLecturesByCourseId
duncan020313 Jul 24, 2023
70fdac1
Add: implement complete of 'session/logout' and 'session'
LarryKwon Jul 24, 2023
a39eff5
Fix: apply ordering
duncan020313 Jul 24, 2023
8c17bf0
Add: define lecture query dto
duncan020313 Jul 25, 2023
bf7d8e0
Add: Implement lecture filter by query
duncan020313 Jul 25, 2023
62660f6
Fix: remove invalid level filter
duncan020313 Jul 25, 2023
0495635
refactor:just for rebase
Jiuuung Jul 24, 2023
6ac28f5
Migrate: add no space columns for lectures
duncan020313 Jul 26, 2023
c4f36ca
tmp
duncan020313 Jul 26, 2023
33a9f40
Migrate: add no space columns for lectures
duncan020313 Jul 26, 2023
c9126f0
Add: implement lecture search feature
duncan020313 Jul 26, 2023
34e498b
Merge branch 'issue/3/course' into issue/5/reviews
LarryKwon Jul 26, 2023
86e28b5
Add: implement get lecture by id
duncan020313 Jul 26, 2023
ef6697c
Add: test complete with session and session/logout
LarryKwon Jul 26, 2023
f35a326
Migrate:add fk between reivew_review and subject_course
Jiuuung Jul 26, 2023
3df345b
Migrate:add fk between reivew_review and subject_course
Jiuuung Jul 26, 2023
5f5bc32
Migrate: add no space columns for lectures
duncan020313 Jul 26, 2023
108a9f6
Migrate:add fk between review_reviewvote and review_review,session_us…
Jiuuung Jul 27, 2023
6680e01
Merge branch 'release' into issue/5/reviews
Jiuuung Jul 28, 2023
9093c9c
Add:implement /api/reviews/ @Get() handler
Jiuuung Jul 28, 2023
965e5c4
Resolve #13, add API /api/courses (#14)
duncan020313 Jul 31, 2023
2f41d8e
Merge branch 'release' into issue/15/course
LarryKwon Jul 31, 2023
217ab51
Merge pull request #19 from sparcs-kaist/issue/15/course
LarryKwon Jul 31, 2023
5720144
Merge branch 'release' into issue/16/course
LarryKwon Jul 31, 2023
a8ac217
Merge pull request #20 from sparcs-kaist/issue/16/course
LarryKwon Jul 31, 2023
9f89764
Merge pull request #24 from sparcs-kaist/issue/21/lecture
LarryKwon Jul 31, 2023
47d7f44
Merge pull request #25 from sparcs-kaist/issue/22/lecture
LarryKwon Jul 31, 2023
e2eab48
Fix:orderByFilter, include course at ReviewsReposiotry
Jiuuung Jul 31, 2023
af89d6c
Merge branch 'release' into issue/5/reviews
LarryKwon Aug 2, 2023
e216b59
Merge pull request #29 from sparcs-kaist/issue/5/reviews
LarryKwon Aug 2, 2023
cd83a30
Merge branch 'release' into issue/2/session
LarryKwon Aug 2, 2023
6791b26
Add: apply toJsonLecture and toJsonReview to session/info
LarryKwon Aug 2, 2023
7f90b0a
Merge pull request #11 from sparcs-kaist/issue/2/session
LarryKwon Aug 2, 2023
bcefd43
Add: test complete
LarryKwon Aug 2, 2023
b7a7e7f
Fix: resolve lecture serializer bugs
duncan020313 Aug 2, 2023
7e35741
Add: test complete
Jiuuung Aug 2, 2023
ba31cf6
Add: Test Complete
LarryKwon Aug 2, 2023
902b80e
Add: Type Conversion
LarryKwon Aug 2, 2023
2725d4a
Migrate: add default to is_deleted, like, speech, load, grade of revi…
Jiuuung Aug 14, 2023
21bfbcd
Add: test complete
Jiuuung Aug 14, 2023
a724dea
Add: test complete
Jiuuung Aug 14, 2023
45e3077
Refactor: rename class name and remove prisma-class generator from sc…
LarryKwon Aug 21, 2023
a235dcc
Refactor: rename function
LarryKwon Aug 21, 2023
ac1bb70
Refactor: rename patchReviewDto
LarryKwon Aug 21, 2023
507d2ae
Refactor: rename dtos in reviews.request.dto.ts
LarryKwon Aug 21, 2023
41c050c
Issue/34/users (#35)
Jiuuung Aug 21, 2023
4e6ff57
Move: review request validator to decorator folder
Jiuuung Aug 22, 2023
7f780ec
Resolve: typo in session/info
LarryKwon Aug 23, 2023
3d04b94
Refactor: function name
Jiuuung Aug 23, 2023
c351ee8
Merge branch 'release' into issue/30/reviews
Jiuuung Aug 23, 2023
d0b0923
Merge pull request #31 from sparcs-kaist/issue/30/reviews
Jiuuung Aug 23, 2023
5c40adc
Squashed commit of the following:
LarryKwon Aug 24, 2023
c40e8cc
Feat: add get lecture review api
Jiuuung Aug 24, 2023
e434575
Merge branch 'release' into issue/23/lecture_review(recent)
Jiuuung Aug 24, 2023
5b9646a
Fix:add Return Type
Jiuuung Aug 24, 2023
5e18ad7
Add: implement getReviewByCourseId (#40)
duncan020313 Sep 6, 2023
d1099f3
Add: @Public decorators to controller
Jiuuung Sep 6, 2023
9dbf202
Merge branch 'release' into issue/23/lecture_review(recent)
Jiuuung Sep 6, 2023
4121b63
Fix: conflict
Jiuuung Sep 6, 2023
18cb5b0
Fix: not formatted files
ddungiii Sep 11, 2023
8c12668
Merge branch 'main' into fix/formatting
ddungiii Sep 11, 2023
492dbfa
Add: release branch to the target branch of github ci
ddungiii Sep 11, 2023
74a2ba4
Add: include all files for formatting target and apply it
ddungiii Sep 11, 2023
084328b
Add: strict true
ddungiii Sep 11, 2023
0c3fdda
Fix: strict error in dto of sso
ddungiii Sep 13, 2023
4831114
Fix: strict error in serializer of professor
ddungiii Sep 13, 2023
90ac52e
fix: add ! to fix ts(2564)
JeukHwang Sep 16, 2023
a5eb9eb
fix: unwrap function without writing type
JeukHwang Sep 16, 2023
159eeee
fix: handle when course is null
JeukHwang Sep 16, 2023
69485ce
refactor: change util functions
JeukHwang Sep 16, 2023
fba8feb
Fix: strict error in auth module
ddungiii Sep 18, 2023
55bd2dc
Fix: strict error in jwt
ddungiii Sep 18, 2023
4a6a20e
Fix: strict error in review
ddungiii Sep 18, 2023
dabf43b
Fix: strict error in department
ddungiii Sep 18, 2023
aeba0bd
Fix: strict error in user
ddungiii Sep 19, 2023
3534774
Fix: apply review
ddungiii Sep 19, 2023
68f63eb
Merge pull request #45 from sparcs-kaist/fix/strict-error-ddungiii
ddungiii Sep 19, 2023
8560144
Merge fix/strict-error into fix/strict-error-jeuk
JeukHwang Sep 20, 2023
459c9dc
fix: assume default value
JeukHwang Sep 21, 2023
5c1ff37
fix: remove unused param
JeukHwang Sep 21, 2023
e7a34f1
fix: make output type safer
JeukHwang Sep 21, 2023
6c06c1d
fix: make prisma function throwable
JeukHwang Sep 21, 2023
c80ffa7
fix: change param type of function
JeukHwang Sep 21, 2023
191c833
fix: resolve type error
JeukHwang Sep 21, 2023
5aecf41
refactor: make logic easier
JeukHwang Sep 21, 2023
b4416c8
fix: replace class with interface
JeukHwang Sep 24, 2023
1e2f031
refactor, fix: enhance type checking for groupBy
JeukHwang Sep 24, 2023
12dc96b
fix: replace unintended == into ===
JeukHwang Sep 26, 2023
a526eee
fix: enhance naming, type checking of groupBy
JeukHwang Sep 26, 2023
78fb8af
fix: error from return type change in groupBy
JeukHwang Sep 26, 2023
2ce72a8
Merge pull request #46 from sparcs-kaist/fix/strict-error-jeuk
ddungiii Sep 26, 2023
3592d0f
Merge pull request #39 from sparcs-kaist/issue/23/lecture_review(recent)
ddungiii Sep 26, 2023
7628077
Merge branch 'release' into fix/formatting
ddungiii Sep 26, 2023
f0eaab7
Merge pull request #42 from sparcs-kaist/fix/formatting
ddungiii Sep 26, 2023
7b7f0fc
Merge branch 'release' into fix/strict-error
ddungiii Sep 26, 2023
ebc52c4
Merge pull request #43 from sparcs-kaist/fix/strict-error
ddungiii Sep 26, 2023
aec4691
chore: fix docker compose volume directory
ddungiii Oct 31, 2023
c2dc588
Merge branch 'release' into dev
ddungiii Nov 7, 2023
82429d9
fix: wrong directory path
ddungiii Nov 7, 2023
89f2e3c
feat: Add status api
ddungiii Nov 7, 2023
fec0346
chore: Add dev to target branch for ci
ddungiii Nov 7, 2023
4c0f903
fix: duplicated fields in schema prisma
ddungiii Nov 7, 2023
6dc8cfb
feat: implement timetable reorder
JeukHwang Nov 7, 2023
df1aaa4
feat: fix status message
ddungiii Nov 21, 2023
52b8844
Merge pull request #48 from sparcs-kaist/feat/status
ddungiii Nov 21, 2023
dd370bc
refactor: use jsdoc for todo comment
JeukHwang Nov 21, 2023
06f3170
refactor: reorder return, optimize db request
JeukHwang Nov 21, 2023
be87283
refactor: add space bar for readability
JeukHwang Nov 21, 2023
7fb2f2c
Merge branch 'dev' into feat-timetable-reorder
JeukHwang Nov 21, 2023
bcfa9b6
Merge pull request #49 from sparcs-kaist/feat-timetable-reorder
JeukHwang Nov 21, 2023
1f49835
chore: add prisma generate on ci
ddungiii Nov 21, 2023
e13a517
chore: fix prisma-generate command
ddungiii Nov 21, 2023
c231497
chore: remove ci branch on target branches
ddungiii Nov 21, 2023
29139b3
chore: rename generating step name
ddungiii Nov 21, 2023
b54240c
Merge pull request #52 from sparcs-kaist/ci/prisma-generate
ddungiii Nov 21, 2023
9ca3806
refactor: prisma scripts
ddungiii Jan 19, 2024
7caffb6
fix: cors origin port
ddungiii Jan 19, 2024
851bb5b
fix: db init script
ddungiii Jan 19, 2024
ce0287f
refactor: add data migrations in prisma migration script
ddungiii Jan 19, 2024
759e483
fix: generate script in ci
ddungiii Jan 20, 2024
e8177a0
Merge pull request #63 from sparcs-kaist/refactor/migrations
ddungiii Jan 20, 2024
871c8d2
chore: Add cross-env (#64)
doxylee Jan 20, 2024
3a99193
fix: a bug that orderFilter return empty filters (#65)
ddungiii Jan 20, 2024
ae3dd77
feat: /api/users/:id/wishlist/add-lecture API
doxylee Jan 24, 2024
3248310
Merge branch 'dev' into feat/add-wishlist
doxylee Jan 24, 2024
a73aec7
refactor: Rename LectureMedium -> LectureExtended
doxylee Jan 24, 2024
a6fb2ff
fix: isLectureDetails subject_examtime도 확인
doxylee Jan 31, 2024
965f067
fix: rename repository method lectureExistsInWishlist -> getLectureIn…
doxylee Jan 31, 2024
10c9166
refactor: Rename wishlistLectures -> wishlistWithLectures
doxylee Jan 31, 2024
692eeee
refactor: toJsonLecture에서 error case 위쪽으로 빼기
doxylee Jan 31, 2024
498329c
fix: Handle case where wishlist is not found after update
doxylee Jan 31, 2024
42883f1
refactor: Rename repository method
doxylee Jan 31, 2024
e315a8d
fix: getlectures API
doxylee Jan 31, 2024
84d0c7c
fix: Wrong group filter condition
doxylee Jan 31, 2024
26b2d36
fix: module definition
doxylee Jan 31, 2024
63a9ce3
fix: wishlist must use LectureDetails instead of LectureExtended
doxylee Jan 31, 2024
e3f3e78
feat: getWishlist API
doxylee Jan 31, 2024
a429fce
feat: Remove wishlist lecture API
doxylee Jan 31, 2024
57c9edc
refactor: remove request, query logs (#69)
ddungiii Feb 1, 2024
1bfd8af
Merge pull request #71 from sparcs-kaist/feat/wishlist-rest
doxylee Feb 2, 2024
c0774c2
Merge pull request #68 from sparcs-kaist/feat/add-wishlist
doxylee Feb 2, 2024
6f6811d
refactor: wishlist remove API에서도 add DTO 사용하던 부분 수정 (#72)
doxylee Feb 14, 2024
a73cda6
feat: Add get feed API (#66)
ddungiii Feb 14, 2024
b168064
feat: department-options, favorite-departments API (#73)
doxylee Feb 15, 2024
be9cf4d
Feat/autocomplete (#75)
doxylee Feb 21, 2024
6ac0dc3
fix: directory typo (#79)
ddungiii Feb 28, 2024
be4c5b1
feat: add get notices (#74)
ddungiii Feb 28, 2024
22f5581
chore(node): specify node.js v18 using nvm (#80)
inhibitor1217 Feb 28, 2024
9291fcc
feat: read course (#77)
ddungiii Feb 28, 2024
411d424
Update README.md
ddungiii Mar 1, 2024
be17a1f
Issue/55/planner (#62)
duncan020313 Mar 6, 2024
dae130c
refactor: repository dependency injection (#81)
ddungiii Mar 6, 2024
1c61d3b
feat: add rates API (#51)
ddungiii Mar 6, 2024
1be7a33
refactor: get courseuser (#78)
ddungiii Mar 6, 2024
26a168d
fix: taken lecture does not exist (#90)
ddungiii Mar 7, 2024
2c1c80c
add: share controller & service
pbc1017 Mar 13, 2024
956c23c
add: create image with title
pbc1017 Mar 13, 2024
2c1a68b
add: add professor, classroom in Tile
pbc1017 Mar 13, 2024
30aaf4f
Feat/api get lecture reviews (#84)
doxylee Mar 13, 2024
9e8adc3
refactor: separate module timetable, semester
pbc1017 Mar 13, 2024
eccbe67
fix: draw tile with only 3 lines text
pbc1017 Mar 20, 2024
74beb2d
fix: change enter text position in tile
pbc1017 Mar 20, 2024
9aeb573
fix: change line space in tile
pbc1017 Mar 20, 2024
d967251
fix: change line space in tile
pbc1017 Mar 20, 2024
7adcb5c
feat: Add arbitrary item to planner (#93)
doxylee Mar 24, 2024
5438f03
fix: apply pr modifications
pbc1017 Mar 27, 2024
ed3c692
Implement remove planner item operation (#83)
inhibitor1217 Mar 27, 2024
18039e5
Implement fetching related reviews of a lecture (#82)
inhibitor1217 Mar 27, 2024
a962b29
fix: devide createTimetableImage method
pbc1017 Mar 27, 2024
014b5e0
fix: move interfaces into file
pbc1017 Mar 27, 2024
1e31d6b
Merge pull request #92 from sparcs-kaist/issue/91/share-timetable-image
pbc1017 Mar 27, 2024
836ab57
feat:add future item (#96)
Jiuuung Mar 31, 2024
83a6df5
Implement reorder planner orderings (#95)
inhibitor1217 Mar 31, 2024
35b3ff0
Issue/87/liked reviews (#88)
LarryKwon Mar 31, 2024
48dac47
Issue/89/planners update item (#97)
LarryKwon Mar 31, 2024
a65d9a4
Issue/67/Reviews like (#98)
Jiuuung Apr 2, 2024
485419d
Revert "Issue/67/Reviews like (#98)" (#100)
LarryKwon Apr 2, 2024
af8daa6
Reviews/like (#101)
LarryKwon Apr 2, 2024
b323c95
feat: share timetable ical
pbc1017 Apr 24, 2024
25726b3
fix: adjust timezone of event
pbc1017 Apr 24, 2024
ba7850a
fix: delete annotation and console log
pbc1017 Apr 24, 2024
7031d00
fix: add getUserLecturesByYearSemester and fix timetable at mytimetab…
pbc1017 Apr 24, 2024
43e771f
fix: remove sso swap
pbc1017 Apr 24, 2024
7cbc6ac
Fix: Resolve error on add-future-item (#103)
LarryKwon May 1, 2024
163b794
Merge branch 'dev' into share/ical
LarryKwon May 1, 2024
0cad993
fix: add 'user' parameter (#111)
Jiuuung May 1, 2024
447526a
Fix: Resolve error on termFilter (#105)
LarryKwon May 1, 2024
6afa936
Merge pull request #112 from sparcs-kaist/109-fix-share-timetable-api…
pbc1017 May 1, 2024
395e319
fix: merge conflict to dev
pbc1017 May 1, 2024
af14626
Refactor/match convention (#117)
doxylee Jul 19, 2024
02e5b72
Fix: EPlanner reference error (#118)
doxylee Jul 20, 2024
835d660
Merge branch 'dev' into share/ical
pbc1017 Jul 30, 2024
bcb6866
Merge pull request #108 from sparcs-kaist/share/ical
pbc1017 Jul 30, 2024
39f8417
114 impl prisma signal middleware (#115)
Jiuuung Jul 31, 2024
1f9c364
Refactor/interface convention (#120)
doxylee Aug 3, 2024
bcb4dc7
Add: implement Auth Chain (#123)
LarryKwon Aug 14, 2024
8dbc514
Refactor n+1 (#130)
pbc1017 Aug 19, 2024
3d2a08b
Issue/119/transaction (#121)
LarryKwon Aug 20, 2024
068782f
add cors config on dev env
Aug 21, 2024
685bb0e
add force option to docker-compose
Aug 21, 2024
3b068c6
change the cors setting
Aug 21, 2024
85a1070
revert port
Aug 21, 2024
dcc3dd1
resolve package.json dependency, and update prisma 4 to 5 (#132)
LarryKwon Aug 21, 2024
6441c47
128 prisma migration 정리 (#129)
LarryKwon Aug 21, 2024
0befbd5
DockerFile을 제작 및 share.service의 file path 조정 (#133)
LarryKwon Aug 22, 2024
f765f32
fix the error in slack https://sparcs.slack.com/archives/C07JKGU9MCG/…
LarryKwon Aug 22, 2024
5d263eb
Add: implement local-sso-swap (#107)
LarryKwon Aug 22, 2024
bcdc861
reflect QA
LarryKwon Aug 22, 2024
adc6697
reflect all qa in BE QA list
LarryKwon Aug 22, 2024
91251aa
change the port
Aug 22, 2024
3be6f1c
add CD in dev env
Aug 22, 2024
0c1a35b
add CD in dev env
Aug 22, 2024
340a798
change env var for cd
Aug 22, 2024
c83d8a8
add passphrase for key
Aug 22, 2024
97fe6e5
chore the workflow
Aug 22, 2024
23c9d57
reduce the taken-lecture api response time
LarryKwon Aug 26, 2024
3ec1ce9
comment out the prisima config about logging the sql
LarryKwon Sep 13, 2024
994cf5b
Issue/136/planner update delete (#138)
LarryKwon Sep 13, 2024
fd4aec5
add cors seeting for production
LarryKwon Sep 13, 2024
9fc34b2
remove console.log
Sep 13, 2024
5d5e4c0
resolve domain error when using sso
Sep 13, 2024
7fcb38d
try to resolve app error but fail
Sep 13, 2024
87665d5
resolve app error
LarryKwon Sep 14, 2024
f5f1998
add ignoremethods option into csrf
LarryKwon Sep 14, 2024
c2bd624
add delete cascade option to planners table
LarryKwon Sep 14, 2024
4cd1d20
add localhost to preferred url
LarryKwon Sep 15, 2024
2dbd500
fix: search filter issue (#140)
useruseruse Sep 19, 2024
32fc1c2
revert Commit 4cd1d20
LarryKwon Oct 27, 2024
d1fc362
fix: sync baseline with prod database (#141)
doxylee Nov 13, 2024
6b6e922
chore: remove db url log (#143)
doxylee Nov 18, 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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*Dockerfile*
node_modules
dist
volumes
27 changes: 27 additions & 0 deletions .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: dev branch auto ci process script

on: # 아래 job을 실행시킬 상황
push:
branches: [dev]

jobs:
deploy:
name: deploy
runs-on: ubuntu-latest # 실행될 인스턴스 OS와 버전

steps:
- name: excuting remote ssh commands
uses: appleboy/ssh-action@v0.1.6 # ssh 접속하는 오픈소스
with:
host: ${{ secrets.REMOTE_IP_DEV }} # 인스턴스 IP
username: ${{ secrets.REMOTE_USER_DEV }} # 우분투 아이디
key: ${{ secrets.REMOTE_PRIVATE_KEY_DEV }} # ec2 instance pem key
port: ${{ secrets.REMOTE_SSH_PORT_DEV }} # 접속포트
passphrase: ${{ secrets.REMOTE_PASSPHRASE_DEV }}
script: | # 실행할 스크립트
cd otlplus-nest-server
git pull origin dev
sudo docker stop otlplus-server-nest-dev
sudo docker rm otlplus-server-nest-dev
sudo docker rmi otlplus-server-nest-dev
sudo ./deploy.sh -e dev
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [main]
branches: [main, dev, release]
pull_request:
branches: [main]
branches: [main, dev, release]

env:
NODE_VERSION: 18
Expand All @@ -23,7 +23,7 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
run: npm ci --force
- name: Check format
run: npm run format:check

Expand All @@ -40,7 +40,7 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
run: npm ci --force
- name: Check lint
run: npm run lint:check

Expand All @@ -57,8 +57,10 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
run: npm ci --force
- name: Copy env file
run: cp ./env/.env.example ./env/.env.local
- name: Generate PrismaClient
run: npm run client:generate
- name: Build
run: npm run build
28 changes: 28 additions & 0 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Code Review

permissions:
contents: read
pull-requests: write

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
gpt-review:
if: ${{ contains(github.event.*.labels.*.name, 'gpt review') }} # Optional; to run only when a label is attached
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# Optional
LANGUAGE: Korean
OPENAI_API_ENDPOINT: https://api.openai.com/v1
MODEL: gpt-4o-mini # https://platform.openai.com/docs/models
PROMPT: # example: Please check if there are any confusions or irregularities in the following code diff:
top_p: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-top_p
temperature: 1 # https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature
max_tokens: 10000
MAX_PATCH_LENGTH: 10000 # if the patch/diff length is large than MAX_PATCH_LENGTH, will be ignored and won't review. By default, with no MAX_PATCH_LENGTH set, there is also no limit for the patch/diff length.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.17.0
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
}
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OTL Plus Server

[![CI](https://github.com/sparcs-kaist/otlplus-server/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sparcs-kaist/otlplus-server/actions/workflows/ci.yml)
[![CI](https://github.com/sparcs-kaist/otlplus-server/actions/workflows/ci.yml/badge.svg?branch=dev)](https://github.com/sparcs-kaist/otlplus-server/actions/workflows/ci.yml)

## How to run

Expand All @@ -26,6 +26,30 @@ sudo docker compose up

또는 로컬에서 MySQL 5.7을 설치하여 연결할 수 있습니다.

### Node.js 설치 및 버전 관리

Node.js v18 을 설치합니다.

버전 체크

```bash
node -v # v18.17.0
npm -v # v9.x.x
```

(Tip) [nvm](https://github.com/nvm-sh/nvm) 설치 후, nvm을 이용하여 로컬 개발 환경의 node.js 버전을 설정하는 것을 권장합니다!

```bash
nvm install 18
nvm use 18
```

아래 명령어를 사용하면 `.nvmrc` 설정 파일에 따라 자동으로 버전이 변경됩니다.

```bash
nvm use # uses v18
```

### NestJS 서버 실행

```sh
Expand Down
46 changes: 46 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

usage() {
echo "Usage: $0 -e value"
echo " -e: 현재 배포 환경을 입력하세요. (prod, dev, local)"
}

NODE_ENV=""

while getopts "e:" opt; do
case $opt in
e)
NODE_ENV=$OPTARG
echo "NODE_ENV: $NODE_ENV"
if [[ "$NODE_ENV" = "prod" ]]; then
COMPOSE_FILE="docker/docker-compose.prod.yml"
elif [[ "$NODE_ENV" = "dev" ]]; then
COMPOSE_FILE="docker/docker-compose.dev.yml"
elif [[ "$NODE_ENV" = "local" ]]; then
COMPOSE_FILE="docker/docker-compose.local.yml"
else
echo "Invalid environment: $NODE_ENV" 1>&2
usage
exit 1
fi

if [[ ! -f "$COMPOSE_FILE" ]]; then
echo "Error: Compose file does not exist: $COMPOSE_FILE" 1>&2
exit 1
fi

docker-compose -f "$COMPOSE_FILE" up -d
;;
\?)
echo "Invalid option: -$OPTARG" 1>&2
usage
exit 1
;;
esac
done

if [ -z "$NODE_ENV" ]; then
echo "Error: Environment option is required."
usage
exit 1
fi
18 changes: 12 additions & 6 deletions docker/Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM node:18

ENV NODE_ENV=dev
FROM node:18 AS build

RUN mkdir -p /var/www/otlplus-server
WORKDIR /var/www/otlplus-server
Expand All @@ -9,8 +7,16 @@ COPY package*.json ./
RUN npm install

COPY . .
RUN npm run prisma-generate
RUN npm run client:generate
RUN npm run build

EXPOSE 3000
CMD [ "npm", "run", "start:dev" ]
FROM node:18-slim AS server
RUN apt-get update -y && apt-get install -y openssl

COPY --from=build /var/www/otlplus-server/ /var/www/otlplus-server/

WORKDIR /var/www/otlplus-server

RUN npm prune --production

EXPOSE 8000
4 changes: 2 additions & 2 deletions docker-compose.yml → docker/docker-compose-db-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ version: '3.4'
services:
db:
container_name: otlplus-server-db
image: mysql:5.7
image: mysql:8.0.36
restart: on-failure
ports:
- '${OTLPLUS_DB_PORT:-43306}:3306'
environment:
- MYSQL_ROOT_HOSTS=%
- MYSQL_ROOT_HOSTS=admin
- MYSQL_ROOT_PASSWORD=${OTLPLUS_DB_PASSWORD:-password}
- MYSQL_DATABASE=otlplus
- TZ=Asia/Seoul
Expand Down
33 changes: 10 additions & 23 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
version: '3.4'

services:
db:
container_name: otlplus-server-db
platform: linux/amd64
image: mysql:5.7
restart: on-failure
ports:
- "43306:3306"
environment:
- MYSQL_ROOT_HOSTS=%
- MYSQL_ROOT_PASSWORD=${OTLPLUS_DB_PASSWORD:-password}
- MYSQL_DATABASE=otlplus
- TZ=Asia/Seoul
volumes:
- ../volumes/db:/var/lib/mysql
- ../volumes/dump:/dump
command: |
--sql_mode=NO_ENGINE_SUBSTITUTION --default_storage_engine=InnoDB
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
back:
depends_on:
- db
container_name: otlplus-server
container_name: otlplus-server-nest-dev
platform: linux/amd64
env_file:
- ../env/.env.dev
environment:
- NODE_ENV=dev
- DOCKER_DEPLOY=true
build:
context: ..
dockerfile: ./docker/Dockerfile.server
image: otlplus-server-nest-dev
restart: always
tty: true
ports:
- "43000:3000"
- '8080:8000'
volumes:
- "/etc/timezone:/etc/timezone:ro"
- '/etc/timezone:/etc/timezone:ro'
working_dir: /var/www/otlplus-server
command: node dist/src/bootstrap/bootstrap.js
26 changes: 26 additions & 0 deletions docker/docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.4'

services:
back:
container_name: otlplus-server-nest-local
platform: linux/amd64
env_file:
- ../env/.env.local
environment:
- NODE_ENV=local
- DOCKER_DEPLOY=true
build:
context: ..
dockerfile: ./docker/Dockerfile.server
image: otlplus-server-nest-local
restart: always
tty: true
ports:
- '58000:8000'
expose:
- '8000'
volumes:
- '/etc/timezone:/etc/timezone:ro'
network_mode: 'host'
working_dir: /var/www/otlplus-server
command: node dist/src/bootstrap/bootstrap.js
23 changes: 23 additions & 0 deletions docker/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.4'

services:
back:
container_name: otlplus-server-nest-prod
platform: linux/amd64
env_file:
- ../env/.env.prod
environment:
- NODE_ENV=prod
- DOCKER_DEPLOY=true
build:
context: ..
dockerfile: ./docker/Dockerfile.server
image: otlplus-server-nest-prod
restart: always
tty: true
ports:
- '58000:8000'
volumes:
- '/etc/timezone:/etc/timezone:ro'
working_dir: /var/www/otlplus-server
command: node dist/src/bootstrap/bootstrap.js
Loading