codestates / codestates/Bobpago

[๐Ÿ“šDev Log] ๋ฐ•์„ฑํ›ˆ / 2021-09-15

Open
#66 1 comment 0 reactions 1 assignee Claimed by @tjdgns5272 View on GitHub
dev log
Dominant language
TypeScript
Stars
5
Forks
3
PR merge metrics
No merged PRs in 30d

Description

### ์˜ค๋Š˜์€ ์–ด๋–ป๊ฒŒ ํ”„๋กœ์ ํŠธ์— ๊ธฐ์—ฌํ–ˆ๋‚˜์š”?

- NestJS ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์ด์šฉํ•˜์—ฌ ํ•„์š”ํ•œ module, controller, service๋ฅผ ์„ค์น˜ํ•˜์—ฌ ๊ตฌ์„ฑํ–ˆ๋‹ค.
- ์ž‘์„ฑํ–ˆ๋˜ ์Šคํ‚ค๋งˆ ๋ชจ๋ธ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ฐ ํ…Œ์ด๋ธ”์— ํ•ด๋‹นํ•˜๋Š” Entity๋ฅผ ํ˜•์„ฑํ–ˆ๋‹ค.
- TypeOrm์—์„œ ์ง€์›ํ•˜๋Š” ๋ฐ์ฝ”๋ ˆ์ดํ„ฐ๋กœ 1:N, 1:1 ๊ด€๊ณ„ํ˜•์„ฑ์„ ์„ค์ •ํ–ˆ๋‹ค. (FK)

### ์˜ค๋Š˜์˜ ํ”„๋กœ์ ํŠธ์—์„œ ํž˜๋“  ์ ์€ ๋ฌด์—‡์ธ๊ฐ€์š”?

- FK์ง€์ •ํ• ๋•Œ 1:N ๊ด€๊ณ„ ๋ฐ์ฝ”๋ ˆ์ดํ„ฐ ์ž‘์„ฑํ•˜๋Š” ๋ถ€๋ถ„์ด ์กฐ๊ธˆ ํ—ท๊ฐˆ๋ ธ๋‹ค.
```ts
// recipe.entity.ts
@ManyToOne(() => User, (user) => user.recipes)
user: User;
```
```ts
// user.entity.ts
@OneToMany(() => Recipe, (recipe) => recipe.user)
recipes: Recipe[];
```

### ๋‚ด์ผ์€ ํ”„๋กœ์ ํŠธ์— ๊ธฐ์—ฌํ•˜๊ธฐ ์œ„ํ•ด ๋ฌด์—‡์„ ํ•ด์•ผ ํ•˜๋‚˜์š”?

- [ ] ํšŒ์›๊ฐ€์ž… api ์ž‘์„ฑ
- [ ] class-validator๋ฅผ ์ด์šฉํ•œ create-user DTO์„ค์ •
- [ ] S3 ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ ๊ณต๋ถ€

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.