Skip to content

OWN-SIZE/Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TEAM OWNSIZE

1

πŸ”” μ„œλΉ„μŠ€λͺ… : μ˜¨μ‚¬μ΄μ¦ˆ

πŸ”” μ„œλΉ„μŠ€ ν•œμ€„μ†Œκ°œ : 쉽고 λ˜‘λ˜‘ν•œ λ‚˜μ˜ μ‡Όν•‘ λ„μš°λ―Έ, μ˜¨μ‚¬μ΄μ¦ˆ

πŸ”” μ„œλΉ„μŠ€ κ°€μΉ˜μ œμ•ˆ :

  • λ‹¨μˆœν•œ / Simple : λͺ‡ 번의 클릭만으둜 μ‚¬μ΄μ¦ˆλ₯Ό μΆ”μ²œλ°›κ³  λ‚˜μ˜ 옷μž₯에 μ €μž₯ν•΄μš”
  • κ°œμΈν™”λœ / Personalize : μ˜€λ‘œμ§€ λ‚˜λ§Œμ˜ κΈ°μ€€μœΌλ‘œ μ˜·μ„ μΆ”μ²œλ°›κ³  λΆ„λ₯˜ν•΄μš”
  • λ˜‘λ˜‘ν•œ / Smart : μ΅μŠ€ν…μ…˜μ„ 톡해 보닀 λ˜‘λ˜‘ν•˜κ²Œ μ‡Όν•‘ν•΄μš”

πŸ”” μ„œλΉ„μŠ€ λ¬Έμ œμ •μ˜ :

  • μ‚¬μ΄μ¦ˆ μ‹€νŒ¨λ‘œ 인해 λ°œμƒν•˜κ²Œ 될 ν™˜λΆˆ, κ΅ν™˜, λ°˜μ†‘μ— λŒ€ν•œ 슀트레슀
  • μ •ν™•ν•œ μ‚¬μ΄μ¦ˆλ₯Ό κ³ λ₯΄κ³ μž λ‹€μ–‘ν•œ 정보λ₯Ό μˆ˜μ§‘ν•˜λŠ” κ³Όμ • 속 λ²ˆκ±°λ‘œμ›€

πŸ”” μ„œλΉ„μŠ€ νƒ€κ²Ÿμ •μ˜ :

  • νŒ¨μ…˜μ— 관심이 λ§Žμ•„ μ˜¨λΌμΈμ—μ„œ λ‹€μ–‘ν•œ 의λ₯˜ 및 관련정보λ₯Ό 찾아보며 ꡬ맀λ₯Ό κ²°μ •ν•˜λŠ” 고객
  • μ˜¨λΌμΈμ—μ„œμ˜ μ‚¬μ΄μ¦ˆ μ‹€νŒ¨ κ²½ν—˜μœΌλ‘œ 인해 μ˜€ν”„λΌμΈ μ‡Όν•‘μœΌλ‘œ μ „ν™˜ν•œ 고객

πŸƒ Used πŸƒ


Node.js Express PostgreSQL Prisma AWS
Prettier ESLint


πŸ‘₯ Contributors

κΉ€λ™μž¬ μ‘°ν•˜μ–€
ehdwoKIM yanh2

κΈ°λŠ₯ μ„€λͺ…

18 19 20 21 22 24 26 27 29 30


πŸ’» API

κΈ°λŠ₯λͺ… μ—”λ“œν¬μΈνŠΈ λ‹΄λ‹Ή μ™„λ£Œ
νšŒμ›κ°€μž… 및 둜그인 [POST] /auth/login μ‘°ν•˜μ–€ βœ…
전체 옷μž₯ 쑰회 [GET] /allCloset κΉ€λ™μž¬ βœ…
전체 옷μž₯ 의λ₯˜ 정보 μˆ˜μ • [PUT] /allCloset/:productId κΉ€λ™μž¬ βœ…
전체 옷μž₯ 의λ₯˜ μ‚­μ œ [DELETE] /allCloset/:productId κΉ€λ™μž¬ βœ…
ν¬ν•¨λœ μΉ΄ν…Œκ³ λ¦¬ id 쑰회 [GET] /allCloset/:productId κΉ€λ™μž¬ βœ…
μΉ΄ν…Œκ³ λ¦¬μ— 의λ₯˜ μΆ”κ°€ [POST] /allCloset/toCategory κΉ€λ™μž¬ βœ…
μΉ΄ν…Œκ³ λ¦¬ 전체 쑰회 [GET] /category κΉ€λ™μž¬ βœ…
μΉ΄ν…Œκ³ λ¦¬ 생성 [POST] /category/createCategory κΉ€λ™μž¬ βœ…
μΉ΄ν…Œκ³ λ¦¬ μ‚­μ œ [DELETE] /category/:categoryId κΉ€λ™μž¬ βœ…
μΉ΄ν…Œκ³ λ¦¬ μˆ˜μ • [PUT] /category/:categoryId κΉ€λ™μž¬ βœ…
μΉ΄ν…Œκ³ λ¦¬ 상세 쑰회 [GET] /category/:categoryId κΉ€λ™μž¬ βœ…
μΉ΄ν…Œκ³ λ¦¬ λ‚΄ 의λ₯˜ ν•€ κ³ μ •/ν•΄μ œ [PUT] /category/:categoryId/:productId κΉ€λ™μž¬ βœ…
μΉ΄ν…Œκ³ λ¦¬ λ‚΄ 의λ₯˜ μ‚­μ œ [DELETE] /category/:categoryId/:inClothId κΉ€λ™μž¬ βœ…
λ§ˆμ΄μ‚¬μ΄μ¦ˆ 쑰회 [GET] /mysize μ‘°ν•˜μ–€ βœ…
λ‚΄ μƒμ˜ μ‚¬μ΄μ¦ˆ 정보 μž…λ ₯ [POST] /mysize/topSize μ‘°ν•˜μ–€ βœ…
λ‚΄ ν•˜μ˜ μ‚¬μ΄μ¦ˆ 정보 μž…λ ₯ [POST] /mysize/bottomSize μ‘°ν•˜μ–€ βœ…
λ§ˆμ΄νŽ˜μ΄μ§€ 쑰회 [GET] /mypage μ‘°ν•˜μ–€ βœ…
μ‚¬μ΄μ¦ˆ μΆ”μ²œ 기둝 쑰회 [GET] /mypage/history μ‘°ν•˜μ–€ βœ…
전체 옷μž₯에 μ €μž₯ [POST] /extesion/toAllCloset κΉ€λ™μž¬ βœ…
ν¬λ‘€λ§ν•œ μ‚¬μ΄μ¦ˆν‘œ μ €μž₯ [POST] /extesion/saveCrawling κΉ€λ™μž¬ βœ…
μ‚¬μ΄μ¦ˆ μΆ”μ²œ κ²°κ³Ό μ €μž₯ [POST] /extension/saveBest κΉ€λ™μž¬ βœ…
비ꡐ μ‚¬μ΄μ¦ˆ μˆ˜λ™ μž…λ ₯ [POST] /extension/inputSize κΉ€λ™μž¬ βœ…

ERD

AllCloset


πŸ§‘β€πŸ’» Code Convention

λ³€μˆ˜λͺ…
  1. Camel Case μ‚¬μš©
  2. ν•¨μˆ˜μ˜ 경우 동사+λͺ…사 μ‚¬μš© ( ex) getUser() )
  3. μ•½μ–΄λŠ” λ˜λ„λ‘ μ‚¬μš©ν•˜μ§€ μ•ŠμŒ
주석
  1. ν•œ 쀄 주석 μ‚¬μš© //
  2. ν•¨μˆ˜ 주석
/**
* @route
* @desc
* @access
**/
getUser()

이 μ™Έ ESLint 라이브러리 문법을 λ”°λ₯Έλ‹€.


πŸŽ‹ Branch Convention

Branch 이름 μš©λ„
main 초기 μ„ΈνŒ…
develop 배포 branch (api 둜직 κ΅¬ν˜„ μ™„λ£Œ)
feature/#이슈번호 μ΄μŠˆλ³„ api 둜직 κ΅¬ν˜„
  • feature -> development : Pull Request (μ½”λ“œ 리뷰 없이 merge λΆˆκ°€)

⬆️ Commit Convention

[브랜치 이름] κΈ°λŠ₯ (λ˜λŠ” 변경사항) κ°„λž΅ μ„€λͺ… (70자)

- 보좩 μ„€λͺ…이 ν•„μš”ν•œ 경우
- Head에 ν•œμΉΈμ„ λ„μ–΄μ„œ μž‘μ„±

issue tracker: 이슈 번호 (option)

πŸ“‚ Folder Constructor

3-Layer Architecture 기반

πŸ“ src
|_ πŸ“ constants
|_ πŸ“ controller
|_ πŸ“ interfaces
|_ πŸ“ middlewares
|_ πŸ“ modules
|_ πŸ“ router
|_ πŸ“ service
|_ πŸ“ test
|_ index.ts

schema.prisma

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model User {
  id            Int             @id(map: "user_pk") @unique(map: "user_id_uindex") @default(autoincrement())
  name          String?         @db.VarChar(10)
  email         String          @unique @db.VarChar(50)
  userImage     String?         @db.VarChar(500)
  token         String?         @db.VarChar(500)
  AllCloset     AllCloset[]
  AllSizeBottom AllSizeBottom[]
  AllSizeTop    AllSizeTop[]
  Category      Category[]
  Recommend     Recommend[]
}

model AllCloset {
  id                 Int                  @id(map: "Archive_pkey") @unique(map: "Archive_id_key") @default(autoincrement())
  userId             Int                  @default(autoincrement())
  image              String?              @db.VarChar(500)
  productName        String?              @db.VarChar(36)
  size               String?              @db.VarChar(10)
  memo               String?              @db.VarChar(50)
  isRecommend        Boolean?
  isPin              Boolean              @default(false)
  mallName           String?              @db.VarChar(50)
  productUrl         String?              @db.VarChar(500)
  faviconUrl         String?              @db.VarChar(500)
  createdAt          String?              @db.VarChar(20)
  User               User                 @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "allcloset_user_id_fk")
  AllCloset_Category AllCloset_Category[]
}

model AllSizeBottom {
  id              Int      @id @unique @default(autoincrement())
  size            String?  @db.VarChar(10)
  bottomLength    Int?
  waist           Int?
  thigh           Int?
  rise            Int?
  hem             Int?
  isWidthOfBottom Boolean?
  isManual        Boolean?
  topOrBottom     Int?
  manualInputNum  Int?
  bottomItemId    Int?
  userId          Int      @default(autoincrement())
  User            User     @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "allsizebottom_user_id_fk")
}

model AllSizeTop {
  id             Int      @id @unique @default(autoincrement())
  size           String?  @db.VarChar(10)
  topLength      Int?
  shoulder       Int?
  chest          Int?
  isWidthOfTop   Boolean?
  isManual       Boolean?
  topOrBottom    Int?
  manualInputNum Int?
  topItemId      Int?
  userId         Int      @default(autoincrement())
  User           User     @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "allsizetop_user_id_fk")
}

model MySize {
  id              Int      @id @unique @default(autoincrement())
  userId          Int      @unique @default(autoincrement())
  topLength       Int?
  shoulder        Int?
  chest           Int?
  isWidthOfTop    Boolean?
  bottomLength    Int?
  waist           Int?
  thigh           Int?
  rise            Int?
  hem             Int?
  isWidthOfBottom Boolean?
}

model Category {
  id                 Int                  @id @unique @default(autoincrement())
  categoryName       String?              @db.VarChar(20)
  isPinCategory      Boolean?
  image              String[]             @db.VarChar
  userId             Int                  @default(autoincrement())
  AllCloset_Category AllCloset_Category[]
  User               User                 @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "category_user_id_fk")
}

model AllCloset_Category {
  id         Int       @id @unique @default(autoincrement())
  productId  Int       @default(autoincrement())
  categoryId Int       @default(autoincrement())
  isInPin    Boolean?
  AllCloset  AllCloset @relation(fields: [productId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "allcloset_category_allcloset_id_fk")
  Category   Category  @relation(fields: [categoryId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "allcloset_category_category_id_fk")
}

model Recommend {
  id            Int     @id @unique @default(autoincrement())
  userId        Int     @default(autoincrement())
  url           String? @db.VarChar(200)
  recommendSize String? @db.VarChar(10)
  topItemId     Int?
  bottomItemId  Int?
  User          User    @relation(fields: [userId], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "recommend_user_id_fk")
}


πŸ”Ά package.json (dependencies module)

{
  "name": "Server",
  "version": "1.0.0",
  "main": "index.js",
  "repository": "https://github.com/OWN-SIZE/Server.git",
  "author": "ehdwoKIM <kinbell19@gmail.com>",
  "license": "MIT",
  "scripts": {
    "dev": "nodemon",
    "build": "tsc && node dist",
    "db:pull": "npx prisma db pull",
    "db:push": "npx prisma db push",
    "generate": "npx prisma generate"
  },
  "dependencies": {
    "@prisma/client": "^4.6.1",
    "bcryptjs": "^2.4.3",
    "express": "^4.18.2",
    "express-validator": "^6.14.2",
    "prisma": "^4.6.1",
    "typescript": "^4.9.3"
  },
  "devDependencies": {
    "@types/bcryptjs": "^2.4.2",
    "@types/express": "^4.17.14",
    "@types/express-validator": "^3.0.0",
    "@types/node": "^18.11.9",
    "nodemon": "^2.0.20",
    "ts-node": "^10.9.1"
  }    
}

πŸ“Œ Server Architecture

  • 개발 ν™˜κ²½ : Typescript, Express(Node.js)
  • λ°μ΄ν„°λ² μ΄μŠ€ : PostgreSQL, AWS S3
  • μ„œλ²„ ν™˜κ²½ : AWS EC2, PM2

Releases

No releases published

Packages

No packages published