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

refactor: 좌표타입 geometry으로 변경 및 기반작업 #457

Merged
merged 61 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ffa55d4
refactor: update cron task names and add key-based filtering in getCr…
daechan-jo Sep 13, 2024
1ec8215
Merge branch 'refs/heads/main' into devlop
daechan-jo Sep 13, 2024
5d69992
refactor: update cron task names and add key-based filtering in getCr…
daechan-jo Sep 13, 2024
3e4d3e1
Merge branch 'refs/heads/main' into devlop
daechan-jo Sep 13, 2024
37dabdd
feat: store database implementation
daechan-jo Sep 22, 2024
52cc21e
feat: theme crud
daechan-jo Sep 22, 2024
7266274
feat: item crud
daechan-jo Sep 22, 2024
fa1820b
feat: view and purchase themes
daechan-jo Sep 24, 2024
47d78f7
feat: view and purchase items
daechan-jo Sep 24, 2024
90a8543
feat: activate themes and items
daechan-jo Sep 25, 2024
4c56926
feat: Add layout information to user basic information and modify cac…
daechan-jo Sep 25, 2024
b97c1d1
Merge branch 'refs/heads/main' into devlop
daechan-jo Sep 25, 2024
b6ca049
doc: swagger update
daechan-jo Sep 25, 2024
13bd3b9
doc: swagger update
daechan-jo Sep 25, 2024
e8480d2
doc: swagger update
daechan-jo Sep 25, 2024
efcb945
fix: problem with published posts not being viewed properly due to pa…
daechan-jo Sep 27, 2024
7590068
Merge branch 'refs/heads/main' into devlop
daechan-jo Sep 27, 2024
c6f2853
test: Added console log to resolve issues that occur when using rt
daechan-jo Oct 1, 2024
88e35a8
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 1, 2024
a6cc1dc
test: Added console log to resolve issues that occur when using rt
daechan-jo Oct 1, 2024
248d4d1
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 1, 2024
b2a3df2
feat: middleware is added to add request request identifier for testing.
daechan-jo Oct 1, 2024
505c401
feat: middleware is added to add request request identifier for testing.
daechan-jo Oct 1, 2024
de561e5
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 1, 2024
f4f55c5
fix: replace app.enableCors with express cors middleware for custom h…
daechan-jo Oct 2, 2024
adee23c
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 2, 2024
e47c450
fix: replace app.enableCors with express cors middleware for custom h…
daechan-jo Oct 2, 2024
a23dc5e
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 2, 2024
2dfa285
fix: add X-Access-Token to Access-Control-Expose-Headers
daechan-jo Oct 2, 2024
2f1e61b
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 2, 2024
c6bb957
feat: Add basic theme creation logic
daechan-jo Oct 4, 2024
ccc39d1
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 4, 2024
3867ee2
refactor: guard refactoring and improving duplicate handling logic
daechan-jo Oct 7, 2024
d2207e1
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 7, 2024
5fa2731
fix: remove tag limit
daechan-jo Oct 8, 2024
2d6b0a1
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 8, 2024
344fc4b
refactor: item and theme purchase logic by applying Redis distributed…
daechan-jo Oct 11, 2024
3c718e0
refactor: Add retry logic to method
daechan-jo Oct 11, 2024
d2465ad
refactor: Added name duplication check logic when saving and updating…
daechan-jo Oct 11, 2024
161a2fa
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 11, 2024
6e7872b
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 11, 2024
75fb598
fix: 키워드 타입 검사 추가
daechan-jo Oct 14, 2024
d5fe165
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 14, 2024
30de966
fix: 키워드 타입 검사 추가
daechan-jo Oct 14, 2024
eeabb97
chore: Update dependency package versions to latest
daechan-jo Oct 14, 2024
1131de1
chore: 의존성 패키지 업데이트
daechan-jo Oct 14, 2024
8ed1672
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 14, 2024
e2e38ef
chore: 의존성 패키지 업데이트
daechan-jo Oct 14, 2024
961ea6d
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 14, 2024
010158e
chore: 의존성 패키지 업데이트
daechan-jo Oct 14, 2024
bbf13c5
chore: eslint updated
daechan-jo Oct 14, 2024
bee5b9d
fix: redis connection settings in redlock
daechan-jo Oct 14, 2024
d4c1f44
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 14, 2024
73084ac
fix: 에세이 조회 분산락에 지수 백오프 적용
daechan-jo Oct 18, 2024
428f374
doc: edit readme
daechan-jo Oct 19, 2024
1d0fc52
chore: edit eslint config
daechan-jo Oct 22, 2024
07d4d38
fix: 땅에 묻기 기능 추가로 인한 기존 로직 변경
daechan-jo Oct 22, 2024
9273238
fix: 땅에묻기 필수 좌표 분기 추가
daechan-jo Oct 23, 2024
3159da8
refactor: geometry 타입 변경 밑작업
daechan-jo Oct 23, 2024
aa7cad2
Merge branch 'refs/heads/main' into devlop
daechan-jo Oct 23, 2024
7f16514
fix: 에세이 작성시 위도,경도 데이터 geometry로 변환
daechan-jo Oct 24, 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
82 changes: 8 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,78 +73,7 @@ npm install

## 환경 변수 설정
서버를 실행하기 전에 환경 변수를 설정해야 합니다. 환경변수는 루트 경로에 `.env`파일에 설정하거나 시스템 환경 변수로 설정할 수 있습니다.
민감한 데이터의 경우 팀 채널을 확인해주세요.
```bash

SERVER_PORT=3000
SWAGGER=true
ROOT_EMAIL=
ROOT_PASSWORD=
ROOT_NAME=
TZ=Asia/Seoul
ENV=dev
SEED=true
DEFAULT_PROFILE_IMG=https://cdn.linkedoutapp.com/service/profile_icon_01.png


#DB
DB_SSL=true
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_NAME=
DB_PORT=

#Redis
REDIS_HOST=
REDIS_PORT=

#JWT
JWT_SECRET=
JWT_ACCESS_SECRET=
JWT_REFRESH_SECRET=
CUSTOM_TOKEN=

#Redirect
WEB_REGISTER_REDIRECT=http://localhost:8888/web/login
WEB_CHANGE_EMAIL_REDIRECT=https://linkedoutapp.com
WEB_PASSWORD_RESET_REDIRECT=https://linkedoutapp.com

#Email
EMAIL_SERVICE=gmail
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_SECURE=flase
EMAIL_USER=
EMAIL_PASSWORD=

#Oauth
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CLIENT_CALLBACK=https://linkedoutapp.com/api/auth/google/callback

KAKAO_CLIENT_ID=
KAKAO_CLIENT_CALLBACK=https://linkedoutapp.com/api/auth/kakao

NAVER_CLIENT_ID=
NAVER_CLIENT_SECRET=
NAVER_CLIENT_CALLBACK=https://linkedoutapp.com/api/auth/naver/callback

APPLE_CLIENT_ID=
APPLE_TEAM_ID=
APPLE_CALLBACK_URL=https://linkedoutapp.com/api/auth/apple/callback
APPLE_PRIVATE_KEY=

#AWS
AWS_REGION=
AWS_S3_ACCESS_KEY=
AWS_S3_SECRET_ACCESS_KEY=
AWS_S3_BUCKET_NAME=
AWS_CLOUD_FRONT=
AWS_S3_PRIVATE_BUCKET_NAME=
SERVICE_ACCOUNT_KEY_FILE=

```
팀 채널을 확인해주세요.

***
<br>
Expand All @@ -155,14 +84,14 @@ SERVICE_ACCOUNT_KEY_FILE=
### 1. PostgreSQL 컨테이너 실행
- 다음 명령어를 사용하여 PostgreSQL 컨테이너를 실행하세요. 각 항목의 설정을 환경변수에 등록해야하는걸 잊지마세요.
```bash
docker run --name -e POSTGRES_USER=your_db_user -e POSTGRES_PASSWORD=your_db_password -e POSTGRES_DB=your_db_name -p 5432:5432 -d postgres:13
docker run --name your_container_name -e POSTGRES_USER=your_db_user -e POSTGRES_PASSWORD=your_db_password -e POSTGRES_DB=your_db_name -p 5432:5432 -d postgres:13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update PostgreSQL container to include PostGIS extension.

Given the migration to PostGIS for coordinate storage, the PostgreSQL container needs the PostGIS extension. Update the command to use the PostGIS-enabled image:

-docker run --name your_container_name -e POSTGRES_USER=your_db_user -e POSTGRES_PASSWORD=your_db_password -e POSTGRES_DB=your_db_name -p 5432:5432 -d postgres:13
+docker run --name your_container_name -e POSTGRES_USER=your_db_user -e POSTGRES_PASSWORD=your_db_password -e POSTGRES_DB=your_db_name -p 5432:5432 -d postgis/postgis:13-3.3
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
docker run --name your_container_name -e POSTGRES_USER=your_db_user -e POSTGRES_PASSWORD=your_db_password -e POSTGRES_DB=your_db_name -p 5432:5432 -d postgres:13
docker run --name your_container_name -e POSTGRES_USER=your_db_user -e POSTGRES_PASSWORD=your_db_password -e POSTGRES_DB=your_db_name -p 5432:5432 -d postgis/postgis:13-3.3

```
- 혹은 Docker desktop 의 GUI를 사용해 컨테이너를 생성/실행 할 수 있습니다.

### 3. Redis 컨테이너 실행
- Redis 컨테이너는 비교적 간단하게 실행할 수 있습니다.
```bash
docker run --name my-redis -p 6379:6379 -d redis:6
docker run --name your_container_name -p 6379:6379 -d redis:6
```
- 혹은 Docker desktop 의 GUI를 사용해 컨테이너를 생성/실행 할 수 있습니다.

Expand All @@ -175,6 +104,11 @@ docker run --name my-redis -p 6379:6379 -d redis:6
## 서버 실행
- 다음 명령어로 서버를 실행합니다.
- 서버 초기화에 실패할 경우 백엔드 개발자에게 문의해주세요.
- 마이그레이션에서 특정 부분이 누락되는것을 확인했습니다. 다음 경로에서 옵션을 변경해 서버를 실행하세요.
<br>
`/src/config/typeorm.config.ts`
`synchronize: true`

```bash
npm run start:dev
```
8 changes: 5 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const { configs } = require('@typescript-eslint/eslint-plugin');
const typescriptParser = require('@typescript-eslint/parser');

module.exports = [
{
files: ['**/*.ts'],
Expand All @@ -14,16 +17,15 @@ module.exports = [
'generate-migration.js',
],
languageOptions: {
parser: '@typescript-eslint/parser',
parser: typescriptParser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
globals: {},
},
Comment on lines +20 to 26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider extracting parser options for better maintainability.

While the parser change is good, the configuration could be more maintainable by extracting the TypeScript-specific options.

Consider refactoring to:

+const tsParserOptions = {
+  project: './tsconfig.json',
+  tsconfigRootDir: __dirname,
+  sourceType: 'module',
+};

 languageOptions: {
   parser: typescriptParser,
-  parserOptions: {
-    project: './tsconfig.json',
-    tsconfigRootDir: __dirname,
-    sourceType: 'module',
-  },
+  parserOptions: tsParserOptions,
 },

Committable suggestion was skipped due to low confidence.

plugins: {
'@typescript-eslint': require('@typescript-eslint/eslint-plugin'),
'@typescript-eslint': configs.recommended,
prettier: require('eslint-plugin-prettier'),
},
Comment on lines +28 to 30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider consistent plugin import pattern.

While the TypeScript plugin now uses imported configs, there's an inconsistency in how plugins are configured (imported configs vs. direct requires).

Consider applying the same pattern to all plugins:

+const prettierPlugin = require('eslint-plugin-prettier');

 plugins: {
   '@typescript-eslint': configs.recommended,
-  prettier: require('eslint-plugin-prettier'),
+  prettier: prettierPlugin,
 },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'@typescript-eslint': configs.recommended,
prettier: require('eslint-plugin-prettier'),
},
const prettierPlugin = require('eslint-plugin-prettier');
'@typescript-eslint': configs.recommended,
prettier: prettierPlugin,
},

rules: {
Expand Down
115 changes: 68 additions & 47 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"@types/supertest": "^6.0.2",
"@types/useragent": "^2.3.4",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",
"@typescript-eslint/eslint-plugin": "^8.10.0",
"@typescript-eslint/parser": "^8.10.0",
"babel-jest": "^29.7.0",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
2 changes: 2 additions & 0 deletions src/common/types/enum.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export enum EssayStatus {
PRIVATE = 'private',
PUBLISHED = 'published',
LINKEDOUT = 'linkedout',
BURIED = 'buried',
}

export enum ActionType {
Expand All @@ -61,6 +62,7 @@ export enum ActionType {
export enum ReviewQueueType {
LINKEDOUT = 'linkedout',
PUBLISHED = 'published',
BURIED = 'buried',
}

export enum ServerStatus {
Expand Down
Loading
Loading