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

merge #341

Merged
merged 79 commits into from
Aug 28, 2024
Merged

merge #341

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
3b81428
fix(#212): 버그 픽스
tnpfldyd Dec 12, 2023
7b786bd
Merge pull request #268 from tnpfldyd/BE-fix/profile-space
Conut-1 Dec 12, 2023
144dbca
fix(#212): 방에서 안나가지는 버그 수정
tnpfldyd Dec 12, 2023
2a45b11
fix(#212): refresh token 저장 방식 변경 및 스페이스 나가기 오류 제거
tnpfldyd Dec 12, 2023
d951825
fix(#212): refresh token 삭제 로직 변경
tnpfldyd Dec 12, 2023
3602c19
Merge pull request #271 from tnpfldyd/BE-fix/profile-space
Conut-1 Dec 12, 2023
1bce760
fix(#212): 스페이스 나갔다 다시 들어올 경우 대비 하여 코드 수정
tnpfldyd Dec 12, 2023
43e11fd
Merge pull request #276 from tnpfldyd/BE-fix/api
Conut-1 Dec 12, 2023
4f5dc1a
fix: 보드 이름으로 루트 노드 내용 생성
Conut-1 Dec 12, 2023
27149e0
Merge pull request #277 from boostcampwm2023/BE-fix/board-name-to-roo…
Conut-1 Dec 12, 2023
8131c8f
fix(#212): 불필요 코드 삭제
tnpfldyd Dec 13, 2023
569fa7b
fix(#212): 불필요 코드 삭제 및 private 적용
tnpfldyd Dec 13, 2023
9a34473
fix: 보드 이름 중복 확인 안하기
Conut-1 Dec 13, 2023
2685d0d
fix(#212): 함수 바뀐 부분 추가
tnpfldyd Dec 13, 2023
f76a5b7
Merge pull request #289 from boostcampwm2023/BE-fix/delete-board-name…
tnpfldyd Dec 13, 2023
4dc84ee
Merge pull request #288 from tnpfldyd/BE-fix/api-server
Conut-1 Dec 13, 2023
3b28189
feat: Node 테스트 추가
Conut-1 Dec 13, 2023
6643c94
feat: 보드 이름 최대 길이 추가
Conut-1 Dec 13, 2023
50ab58c
Merge pull request #298 from boostcampwm2023/BE-feature/board-name-le…
tnpfldyd Dec 13, 2023
dfeaf00
fix(#212): 최대 글자 제한을 위한 스키마 조정
tnpfldyd Dec 13, 2023
7e60c8b
feat: Clock 테스트 추가
Conut-1 Dec 13, 2023
9c63760
fix(#212): 명확한 이름을 위한 변경
tnpfldyd Dec 13, 2023
c276211
fix(#212): 최대 길이 추가
tnpfldyd Dec 13, 2023
6510215
feat: CrdtTree 테스트 추가
Conut-1 Dec 13, 2023
8270104
Merge pull request #299 from tnpfldyd/BE-fix/name-length
Conut-1 Dec 13, 2023
c51c54c
Merge pull request #300 from boostcampwm2023/BE-feature/crdt-test
tnpfldyd Dec 13, 2023
51b2c30
feat(#232): 조상 노드 판별
Conut-1 Dec 13, 2023
8b47b87
feat(#232): 트리 순환 막기
Conut-1 Dec 13, 2023
9d1f94e
test(#232): 조상 판별 함수 테스트 작성
Conut-1 Dec 13, 2023
aeed977
test(#232): 순환 테스트
Conut-1 Dec 13, 2023
d0da543
Merge pull request #303 from boostcampwm2023/BE-feature/prevent-cycle
tnpfldyd Dec 14, 2023
885b085
chore(#321): NodesJS 메모리 할당량 늘리기
Conut-1 Feb 24, 2024
51f0423
chore(#321): BE-deploy 수정
Conut-1 Feb 24, 2024
b8e4799
chore(#321): sudo 추가
Conut-1 Feb 24, 2024
0591f2b
test
Conut-1 Feb 24, 2024
9b4316e
chore(#321): sudo 추가
Conut-1 Feb 24, 2024
aee0a39
fix: PrismaServiceMongoDB 제거
Conut-1 Apr 30, 2024
59f49cf
fix: mongodb 스키마 제거
Conut-1 Apr 30, 2024
7d005fe
refactor: 불필요한 코드 삭제
Conut-1 Apr 30, 2024
d8b3831
fix: User 모델 수정
Conut-1 Apr 30, 2024
843a1a0
fix: UsersService 수정
Conut-1 Apr 30, 2024
c5e04fa
refactor: User 모델 관련 동작 controller로 이동
Conut-1 Apr 30, 2024
91157a7
fix: Profile 모델 수정
Conut-1 May 4, 2024
d49f9e9
fix: Profile_space, Space 모델 수정
Conut-1 May 9, 2024
1d9f8e5
fix: Profile controller, service 수정
Conut-1 May 10, 2024
b8c91e8
fix: Space, Profile_space 모델 controller, service 수정
Conut-1 May 11, 2024
e94882c
fix: RefreshToken, InviteCode 모델 수정
Conut-1 May 11, 2024
0b32d3f
fix: InviteCode controller, service 수정
Conut-1 May 13, 2024
4e63368
fix: RefreshToken 모델 수정
Conut-1 May 13, 2024
37cc0d0
feat: RefreshToken service 추가
Conut-1 May 13, 2024
7ae23c5
remove: 불필요한 코드 제거
Conut-1 May 13, 2024
a88e0d2
chore: .gitignore 수정
Conut-1 May 13, 2024
3c62c58
chore: git action 수정
Conut-1 May 20, 2024
07834f5
Merge pull request #335 from boostcampwm2023/BE-fix/delete-tmp-db
Conut-1 May 20, 2024
c73a804
fix: prisma migrate를 entrypoint로 이동
Conut-1 May 20, 2024
e7ad17d
Merge pull request #337 from boostcampwm2023/BE-fix/delete-tmp-db
Conut-1 May 20, 2024
3fd8d00
chore: entrypoint.sh 권한 수정
Conut-1 May 20, 2024
815e26c
Merge pull request #338 from boostcampwm2023/BE-fix/delete-tmp-db
Conut-1 May 20, 2024
37ac62d
refactor: 접근자, 반환 타입 수정
Conut-1 May 23, 2024
5e9b77d
chore: jest-mock-extended 추가
Conut-1 May 23, 2024
14db25c
feat: UsersService 테스트 작성
Conut-1 May 23, 2024
68416ea
feat: ProfilesService 테스트 작성
Conut-1 May 25, 2024
a95cdab
remove: PrismaService 테스트 삭제
Conut-1 May 25, 2024
fd6859c
remove: UploadService 테스트 삭제
Conut-1 May 25, 2024
9276162
refactor: import 경로, ProfilesModule 설정 변경
Conut-1 May 25, 2024
fa0758c
feat: ProfilesController 테스트 작성
Conut-1 May 27, 2024
d67aed6
feat: RefreshTokensService 테스트 작성
Conut-1 May 27, 2024
aed1546
feat: AuthService 테스트 작성
Conut-1 May 27, 2024
3583954
feat: AuthController 테스트 작성
Conut-1 May 28, 2024
f4f0183
feat: SpacesService 테스트 작성
Conut-1 May 28, 2024
4d7fa0e
feat: SpacesController 테스트 작성
Conut-1 May 28, 2024
76efcfe
feat: BoardsService 테스트 작성
Conut-1 May 30, 2024
aeea145
feat: BoardsController 테스트 작성
Conut-1 May 31, 2024
cd890b7
fix: crdt 타입 수정
Conut-1 May 31, 2024
84c3893
fix: import 경로 수정
Conut-1 May 31, 2024
4d7a1c6
Merge pull request #339 from boostcampwm2023/BE-feature/unit-test
Conut-1 Jun 18, 2024
cb5d880
chore: prisma migrate deploy로 변경
Conut-1 Aug 28, 2024
316170e
chore: 배포 자동화 브랜치 변경
Conut-1 Aug 28, 2024
b163cc3
Merge pull request #340 from boostcampwm2023/BE-chore/deploy
Conut-1 Aug 28, 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
18 changes: 9 additions & 9 deletions .github/workflows/BE-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: BE-deploy
on:
push:
branches:
- "BE-develop"
- "release"
paths:
- "nestjs-BE/**"
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -29,7 +31,6 @@ jobs:
echo "BASE_IMAGE_URL=$BASE_IMAGE_URL" >> ./nestjs-BE/server/.env
echo "BUCKET_NAME=$BUCKET_NAME" >> ./nestjs-BE/server/.env
echo "APP_ICON_URL=$APP_ICON_URL" >> ./nestjs-BE/server/.env
echo "CSV_FOLDER=$CSV_FOLDER" >> ./nestjs-BE/server/.env
docker build -t ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync ./nestjs-BE/server
docker push ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync:latest
env:
Expand All @@ -47,7 +48,6 @@ jobs:
BASE_IMAGE_URL: ${{ secrets.BASE_IMAGE_URL }}
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
APP_ICON_URL: ${{ secrets.APP_ICON_URL }}
CSV_FOLDER: ${{ secrets.CSV_FOLDER }}

deploy:
needs: build
Expand All @@ -61,12 +61,12 @@ jobs:
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.REMOTE_SSH_KEY }}
script: |
echo ${{ secrets.PACKAGE_ACCESS_TOKEN }} | docker login ghcr.io -u ${{ secrets.PACKAGE_USERNAME }} --password-stdin
docker pull ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync
docker stop mindsync_server || true
docker rm mindsync_server || true
docker run -d \
echo ${{ secrets.PACKAGE_ACCESS_TOKEN }} | sudo docker login ghcr.io -u ${{ secrets.PACKAGE_USERNAME }} --password-stdin
sudo docker pull ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync
sudo docker stop mindsync_server || true
sudo docker rm mindsync_server || true
sudo docker run -d \
--name mindsync_server \
-p ${{ secrets.SERVER_PORT }}:${{ secrets.CONTAINER_PORT }} \
-v temporary-volume:${{ secrets.CSV_FOLDER }} \
--net mybridge \
ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync
3 changes: 1 addition & 2 deletions nestjs-BE/server/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
'max-depth': ['error', 3],
'no-magic-numbers': ['error', { ignore: [-1, 0, 1] }],
'curly': ['error', 'multi-line', 'consistent'],
'max-params': ['error', 3],
curly: ['error', 'multi-line', 'consistent'],
},
};
4 changes: 0 additions & 4 deletions nestjs-BE/server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,3 @@ lerna-debug.log*

# Environment Variable File
.env

# csv, prisma
/operations
/prisma/generated
10 changes: 5 additions & 5 deletions nestjs-BE/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ FROM node:20.4.0-alpine

WORKDIR /server

ENV NODE_OPTIONS="--max-old-space-size=2048"

COPY package.json package-lock.json ./

RUN npm ci

COPY ./ ./

RUN npx prisma generate --schema=./prisma/mysql.schema.prisma

RUN npx prisma generate --schema=./prisma/mongodb.schema.prisma

EXPOSE 3000

CMD ["npm", "start"]
RUN chmod +x ./entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]
3 changes: 3 additions & 0 deletions nestjs-BE/server/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
npx prisma migrate deploy
npm start
28 changes: 28 additions & 0 deletions nestjs-BE/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nestjs-BE/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"jest-mock-extended": "^3.0.7",
"prettier": "^3.0.0",
"prisma": "^5.6.0",
"source-map-support": "^0.5.21",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ CREATE TABLE `USER_TB` (
-- CreateTable
CREATE TABLE `REFRESH_TOKEN_TB` (
`uuid` VARCHAR(32) NOT NULL,
`token` VARCHAR(191) NOT NULL,
`expiry_date` DATETIME(3) NOT NULL,
`user_id` VARCHAR(191) NOT NULL,

UNIQUE INDEX `REFRESH_TOKEN_TB_token_key`(`token`),
PRIMARY KEY (`uuid`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Expand Down Expand Up @@ -44,7 +42,7 @@ CREATE TABLE `PROFILE_SPACE_TB` (
`space_uuid` VARCHAR(32) NOT NULL,
`profile_uuid` VARCHAR(32) NOT NULL,

PRIMARY KEY (`space_uuid`, `profile_uuid`)
UNIQUE INDEX `PROFILE_SPACE_TB_space_uuid_profile_uuid_key`(`space_uuid`, `profile_uuid`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Warnings:

- You are about to alter the column `nickname` on the `PROFILE_TB` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `VarChar(20)`.
- You are about to alter the column `name` on the `SPACE_TB` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `VarChar(20)`.

*/
-- AlterTable
ALTER TABLE `PROFILE_TB` MODIFY `nickname` VARCHAR(20) NOT NULL;

-- AlterTable
ALTER TABLE `SPACE_TB` MODIFY `name` VARCHAR(20) NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- RenameIndex
ALTER TABLE `USER_TB` RENAME INDEX `USER_TB_email_provider_key` TO `User_email_provider_key`;

-- RenameTable
ALTER TABLE `USER_TB` RENAME `User`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- DropForeignKey
ALTER TABLE `PROFILE_TB` DROP FOREIGN KEY `PROFILE_TB_user_id_fkey`;

-- RenameIndex
ALTER TABLE `PROFILE_TB` RENAME INDEX `PROFILE_TB_user_id_key` TO `Profile_user_id_key`;

-- RenameTable
ALTER TABLE `PROFILE_TB` RENAME `Profile`;

-- AddForeignKey
ALTER TABLE `Profile` ADD CONSTRAINT `Profile_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `User`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- DropForeignKey
ALTER TABLE `INVITE_CODE_TB` DROP FOREIGN KEY `INVITE_CODE_TB_space_uuid_fkey`;

-- DropForeignKey
ALTER TABLE `PROFILE_SPACE_TB` DROP FOREIGN KEY `PROFILE_SPACE_TB_profile_uuid_fkey`;

-- DropForeignKey
ALTER TABLE `PROFILE_SPACE_TB` DROP FOREIGN KEY `PROFILE_SPACE_TB_space_uuid_fkey`;

-- RenameIndex
ALTER TABLE `PROFILE_SPACE_TB` RENAME INDEX `PROFILE_SPACE_TB_space_uuid_profile_uuid_key` TO `Profile_space_space_uuid_profile_uuid_key`;

-- RenameTable
ALTER TABLE `PROFILE_SPACE_TB` RENAME `Profile_space`;

-- RenameTable
ALTER TABLE `SPACE_TB` RENAME `Space`;

-- AddForeignKey
ALTER TABLE `Profile_space` ADD CONSTRAINT `Profile_space_space_uuid_fkey` FOREIGN KEY (`space_uuid`) REFERENCES `Space`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Profile_space` ADD CONSTRAINT `Profile_space_profile_uuid_fkey` FOREIGN KEY (`profile_uuid`) REFERENCES `Profile`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `INVITE_CODE_TB` ADD CONSTRAINT `INVITE_CODE_TB_space_uuid_fkey` FOREIGN KEY (`space_uuid`) REFERENCES `Space`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- DropForeignKey
ALTER TABLE `INVITE_CODE_TB` DROP FOREIGN KEY `INVITE_CODE_TB_space_uuid_fkey`;

-- DropForeignKey
ALTER TABLE `REFRESH_TOKEN_TB` DROP FOREIGN KEY `REFRESH_TOKEN_TB_user_id_fkey`;

-- RenameIndex
ALTER TABLE `INVITE_CODE_TB` RENAME INDEX `INVITE_CODE_TB_invite_code_key` TO `InviteCode_invite_code_key`;

-- RenameTable
ALTER TABLE `INVITE_CODE_TB` RENAME `InviteCode`;

-- RenameTable
ALTER TABLE `REFRESH_TOKEN_TB` RENAME `RefreshToken`;

-- AddForeignKey
ALTER TABLE `RefreshToken` ADD CONSTRAINT `RefreshToken_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `User`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `InviteCode` ADD CONSTRAINT `InviteCode_space_uuid_fkey` FOREIGN KEY (`space_uuid`) REFERENCES `Space`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Warnings:

- The primary key for the `RefreshToken` table will be changed. If it partially fails, the table could be left without primary key constraint.
- Added the required column `id` to the `RefreshToken` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE `RefreshToken` DROP PRIMARY KEY,
ADD COLUMN `id` INTEGER NOT NULL AUTO_INCREMENT,
RENAME COLUMN `uuid` TO `token`,
ADD PRIMARY KEY (`id`);

ALTER TABLE `RefreshToken` MODIFY `token` VARCHAR(210) NOT NULL;

-- CreateIndex
CREATE INDEX `RefreshToken_token_idx` ON `RefreshToken`(`token`);
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
Warnings:

- A unique constraint covering the columns `[token]` on the table `RefreshToken` will be added. If there are existing duplicate values, this will fail.

*/
-- DropIndex
DROP INDEX `RefreshToken_token_idx` ON `RefreshToken`;

-- CreateIndex
CREATE UNIQUE INDEX `RefreshToken_token_key` ON `RefreshToken`(`token`);
14 changes: 0 additions & 14 deletions nestjs-BE/server/prisma/mongodb.schema.prisma

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,60 +1,59 @@
generator client {
provider = "prisma-client-js"
output = "./generated/mysql"
}

datasource db {
provider = "mysql"
url = env("MYSQL_DATABASE_URL")
}

model USER_TB {
model User {
uuid String @id @db.VarChar(32)
email String
provider String
profiles PROFILE_TB[]
refresh_tokens REFRESH_TOKEN_TB[]
profiles Profile[]
refresh_tokens RefreshToken[]
@@unique([email, provider])
}

model REFRESH_TOKEN_TB {
uuid String @id @db.VarChar(32)
token String @unique
model RefreshToken {
id Int @id @default(autoincrement())
token String @db.VarChar(210)
expiry_date DateTime
user_id String
user USER_TB @relation(fields: [user_id], references: [uuid], onDelete: Cascade)
user User @relation(fields: [user_id], references: [uuid], onDelete: Cascade)
@@unique([token])
}

model PROFILE_TB {
model Profile {
uuid String @id @db.VarChar(32)
user_id String @unique @db.VarChar(32)
image String
nickname String
user USER_TB @relation(fields: [user_id], references: [uuid], onDelete: Cascade)
spaces PROFILE_SPACE_TB[]
nickname String @db.VarChar(20)
user User @relation(fields: [user_id], references: [uuid], onDelete: Cascade)
spaces Profile_space[]
}

model SPACE_TB {
model Space {
uuid String @id @db.VarChar(32)
name String
name String @db.VarChar(20)
icon String
profiles PROFILE_SPACE_TB[]
invite_codes INVITE_CODE_TB[]
profiles Profile_space[]
invite_codes InviteCode[]
}

model PROFILE_SPACE_TB {
model Profile_space {
space_uuid String @db.VarChar(32)
profile_uuid String @db.VarChar(32)
space SPACE_TB @relation(fields: [space_uuid], references: [uuid], onDelete: Cascade)
profile PROFILE_TB @relation(fields: [profile_uuid], references: [uuid], onDelete: Cascade)
space Space @relation(fields: [space_uuid], references: [uuid], onDelete: Cascade)
profile Profile @relation(fields: [profile_uuid], references: [uuid], onDelete: Cascade)
@@unique([space_uuid, profile_uuid])
}

model INVITE_CODE_TB {
model InviteCode {
uuid String @id @db.VarChar(32)
invite_code String @unique @db.VarChar(10)
space_uuid String @db.VarChar(32)
expiry_date DateTime
space SPACE_TB @relation(fields: [space_uuid], references: [uuid], onDelete: Cascade)
space Space @relation(fields: [space_uuid], references: [uuid], onDelete: Cascade)
}

2 changes: 0 additions & 2 deletions nestjs-BE/server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { AppService } from './app.service';
import { AuthModule } from './auth/auth.module';
import { UsersModule } from './users/users.module';
import { PrismaModule } from './prisma/prisma.module';
import { TemporaryDatabaseModule } from './temporary-database/temporary-database.module';
import { ProfilesModule } from './profiles/profiles.module';
import { SpacesModule } from './spaces/spaces.module';
import { BoardsModule } from './boards/boards.module';
Expand All @@ -21,7 +20,6 @@ import customEnv from './config/env';
AuthModule,
UsersModule,
PrismaModule,
TemporaryDatabaseModule,
ScheduleModule.forRoot(),
ProfilesModule,
SpacesModule,
Expand Down
Loading
Loading