Skip to content

Commit

Permalink
refactor: 좌표타입 geometry으로 변경 및 기반작업 (#457)
Browse files Browse the repository at this point in the history
* refactor: update cron task names and add key-based filtering in getCronLogs

- getCronLogs 메소드에 key 파라미터를 추가하여 taskName을 기준으로 필터링 가능하도록 수정
- Cron 작업의 로그 태스크 이름을 간결하게 변경

* refactor: update cron task names and add key-based filtering in getCronLogs

- getCronLogs 메소드에 key 파라미터를 추가하여 taskName을 기준으로 필터링 가능하도록 수정
- Cron 작업의 로그 태스크 이름을 간결하게 변경

* feat: store database implementation

* feat: theme crud

* feat: item crud

* feat: view and purchase themes

* feat: view and purchase items

* feat: activate themes and items

* feat: Add layout information to user basic information and modify caching

* doc: swagger update

* doc: swagger update

* doc: swagger update

* fix: problem with published posts not being viewed properly due to paging issues

* test: Added console log to resolve issues that occur when using rt

* test: Added console log to resolve issues that occur when using rt

* feat: middleware is added to add request request identifier for testing.

* feat: middleware is added to add request request identifier for testing.

* fix: replace app.enableCors with express cors middleware for custom headers

* fix: replace app.enableCors with express cors middleware for custom headers

* fix: add X-Access-Token to Access-Control-Expose-Headers

* feat: Add basic theme creation logic

* refactor: guard refactoring and improving duplicate handling logic

* fix: remove tag limit

* refactor: item and theme purchase logic by applying Redis distributed locks and transactions

* refactor: Add retry logic to method

* refactor: Added name duplication check logic when saving and updating stories

* fix: 키워드 타입 검사 추가

* fix: 키워드 타입 검사 추가

* chore: Update dependency package versions to latest

* chore: 의존성 패키지 업데이트

* chore: 의존성 패키지 업데이트

* chore: 의존성 패키지 업데이트

* chore: eslint updated

* fix: redis connection settings in redlock

* fix: 에세이 조회 분산락에 지수 백오프 적용

* doc: edit readme

* chore: edit eslint config

* fix: 땅에 묻기 기능 추가로 인한 기존 로직 변경

* fix: 땅에묻기 필수 좌표 분기 추가

* refactor: geometry 타입 변경 밑작업

* fix: 에세이 작성시 위도,경도 데이터 geometry로 변환
  • Loading branch information
daechan-jo authored Oct 25, 2024
1 parent 67d39f8 commit 3b381e3
Show file tree
Hide file tree
Showing 27 changed files with 332 additions and 208 deletions.
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
```
- 혹은 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: {},
},
plugins: {
'@typescript-eslint': require('@typescript-eslint/eslint-plugin'),
'@typescript-eslint': configs.recommended,
prettier: require('eslint-plugin-prettier'),
},
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

0 comments on commit 3b381e3

Please sign in to comment.