-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ feat(module openapi-scrapper 추가): module로 개발 시작 * 🚚 chore: backend packege 의존성 업데이트 * ✨ feat: backend/stock-price 추가 * 🚚 chore: yarn.lock 업데이트 * ✨ feat(korea-stock-info.*.ts): 한국 주식 데이터를 파싱하고, 가져오는 것을 제작함 * 🚚 chore: deploy 추가, front, backend dockerfile 추가 * commit after merge * 🚚 chore: yarn.lock, package.json ISSUES CLOSED: unzipper, axios 설치 * 🚚 chore: yarn.lock, workflows 업데이트 - dev,fe,be 모두 작동 * 🚚 chore: type unzipper 추가 * 🚚 chore: path 문제 해결 - build -\> dist, packages/fronted/dist =\> dist * 🚚 chore: server password * 🚚 chore: tsconfig.buildjson output dir 추가 * 📦️ ci: frontend dockerfile 수정 * ✨ feat: 구글 로그인 페이지 이동 관련 swagger 설정 * ✨ feat: 구글 로그인 성공시 리다이렉트 엔드포인트 구현 * ✨ feat: 구글 oauth 서버로부터 access token 획득 * ♻️ refactor: request 관련 타입 수정 * ✨ feat: 구글 oauth 로그인 성공 후 사용자 정보를 획득 * ✨ feat(module openapi-scrapper 추가): module로 개발 시작 * ✨ feat: backend/stock-price 추가 * ✨ feat(korea-stock-info.*.ts): 한국 주식 데이터를 파싱하고, 가져오는 것을 제작함 * 🐛 fix: 리뷰 반영 - env, 중복코드 제거, .vscode 삭제 / dto 사용 확대 * 🚚 chore: backend package prod 위치 변경 * 📦️ ci: package.json 수정 - ..좋은 방법은 아니지만.. * 📦️ ci: packages.json 중복 삭제 * 🐛 fix: 충돌로 발생한 문제 해결 * 🚚 chore: deploy.yml backend 부터 만들게 설정 * 🚚 chore: deploy docker-down 추가 * 📦️ ci: 편-안하게 ssh로 변경, pull request 작동 삭제 * 📦️ ci: front, backend action 다르게 설정. * 📦️ ci: 이름 변경 --------- Co-authored-by: kimminsu <[email protected]>
- Loading branch information
1 parent
91fed6d
commit e5a3de4
Showing
28 changed files
with
590 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Deploy Backend in Monorepo | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev-be | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
docker: | ||
image: docker:20.10.7 | ||
options: --privileged | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache Yarn dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
**/node_modules | ||
~/.yarn-cache | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Build backend | ||
run: | | ||
yarn workspace backend build | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and push backend Docker image | ||
run: | | ||
docker build -t ${{ secrets.DOCKER_USERNAME }}/backend:latest -f packages/backend/Dockerfile . | ||
docker push ${{ secrets.DOCKER_USERNAME }}/backend:latest | ||
- name: Deploy to server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SERVER_HOST }} | ||
username: ${{ secrets.SERVER_USER }} | ||
key: ${{ secrets.SERVER_SSH_KEY}} | ||
port: ${{ secrets.SERVER_PORT }} | ||
script: | | ||
docker pull ${{ secrets.DOCKER_USERNAME }}/backend:latest | ||
docker-compose down | ||
docker-compose up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Deploy Frontend in Monorepo | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev-fe | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
docker: | ||
image: docker:20.10.7 | ||
options: --privileged | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache Yarn dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
**/node_modules | ||
~/.yarn-cache | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Build frontend | ||
run: | | ||
yarn workspace frontend build | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and push backend Docker image | ||
run: | | ||
docker build -t ${{ secrets.DOCKER_USERNAME }}/backend:latest -f packages/backend/Dockerfile . | ||
docker push ${{ secrets.DOCKER_USERNAME }}/backend:latest | ||
- name: Deploy to server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SERVER_HOST }} | ||
username: ${{ secrets.SERVER_USER }} | ||
key: ${{ secrets.SERVER_SSH_KEY}} | ||
port: ${{ secrets.SERVER_PORT }} | ||
script: | | ||
docker pull ${{ secrets.DOCKER_USERNAME }}/frontend:latest | ||
docker-compose down | ||
docker-compose up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM node:20-alpine | ||
WORKDIR /packages | ||
COPY . . | ||
RUN yarn install --frozen-lockfile | ||
RUN yarn workspace backend build | ||
EXPOSE 3000 | ||
CMD ["yarn", "workspace", "backend", "start:prod"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/backend/src/openapi-scraper/korea-stock-info/dto/master-download.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { IsString } from "class-validator"; | ||
|
||
export class MasterDownloadDto { | ||
@IsString() | ||
baseDir!: string; | ||
|
||
@IsString() | ||
target: string; | ||
|
||
constructor(baseDir: string, target: string) { | ||
this.baseDir = baseDir; | ||
this.target = target; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
packages/backend/src/openapi-scraper/korea-stock-info/dto/master-split.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { IsArray } from 'class-validator'; | ||
|
||
export class MasterSplit { | ||
@IsArray() | ||
shortCode: [number, number]; | ||
|
||
@IsArray() | ||
standardCode: [number, number]; | ||
|
||
@IsArray() | ||
koreanName: [number, number]; | ||
|
||
@IsArray() | ||
groupCode: [number, number]; | ||
|
||
@IsArray() | ||
marketCapSize: [number, number]; | ||
|
||
constructor( | ||
shortCode: [number, number], | ||
standardCode: [number, number], | ||
koreanName: [number, number], | ||
groupCode: [number, number], | ||
marketCapSize: [number, number], | ||
) { | ||
this.shortCode = shortCode; | ||
this.standardCode = standardCode; | ||
this.koreanName = koreanName; | ||
this.groupCode = groupCode; | ||
this.marketCapSize = marketCapSize; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/backend/src/openapi-scraper/korea-stock-info/entities/stock.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm'; | ||
|
||
//TODO : entity update require | ||
@Entity() | ||
export class Master { | ||
@PrimaryGeneratedColumn({ type: 'int', unsigned: true }) | ||
id?: number; | ||
|
||
@Column() | ||
shortCode?: string; | ||
|
||
@Column() | ||
standardCode?: string; | ||
|
||
@Column() | ||
koreanName?: string; | ||
|
||
@Column() | ||
groupCode?: string; | ||
|
||
@Column() | ||
marketCapSize?: string; | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/backend/src/openapi-scraper/korea-stock-info/korea-stock-info.controller.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { KoreaStockInfoController } from './korea-stock-info.controller'; | ||
|
||
describe('KoreaStockInfoController', () => { | ||
let controller: KoreaStockInfoController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [KoreaStockInfoController], | ||
}).compile(); | ||
|
||
controller = module.get<KoreaStockInfoController>(KoreaStockInfoController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
4 changes: 4 additions & 0 deletions
4
packages/backend/src/openapi-scraper/korea-stock-info/korea-stock-info.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Controller } from '@nestjs/common'; | ||
|
||
@Controller('korea-stock-info') | ||
export class KoreaStockInfoController {} |
Oops, something went wrong.