Skip to content

HoBom-s/hbtb-back-v2

Repository files navigation

HoBom Tech Blog BackEnd

호봄 프로젝트는 '하고 싶은 개발'을 원없이 하기 위해 시작되었습니다.
호봄 테크 블로그는 우리의 개발 여정을 기록하고 공유하기 위한 서비스 입니다: https://hbtb.vercel.app

HoBom project is named after our initial, has begun to freely do all the development we want regardless of companies' technical limitation.
Hobom Tech Blog is kind of an archive where we can record the content of our wildest dreams: https://hbtb.vercel.app


문제 해결(TroubleShooting)


아키텍쳐

_hbtb_architecture


기술 스택(Tech Stack)

NodeJs Express TypeScript TypeORM MySQL
AWS-RDS AWS-S3 Redis PM2

  • WAS distribution on CLOUDTYPE free-tier
  • DB distribution on AWS-RDS free-tier
  • Image WAS distribution on Koyeb free-tier
    ※ 호봄 프로젝트 확장을 위해 이미지 서버 별도 구축
    ※ Built a sepearate image server for the sake of HoBom service expansion

시작하기(Getting started)

Of course, .env in private.

# Git clone
git clone https://github.com/HoBom-s/hbtb-back-v2.git

# start
npm install
npm run dev

Swagger(API docs)

API 파악을 위해 간소화된 Swagger를 제공합니다: HBTB-API-v2

Please check simplified api docs on HBTB-API-v2.


기능(Features)

1. Users

  • User basic CRUD, signup, login, logout
  • JWT authentication, authorization with authValidateMiddleware (Access token, Refresh token)
  • Upload profile image using multer and s3 (with image server).

2. Articles

  • Article basic CRUD, search, pagination
  • Upload thumbnail using multer and s3 (with image server).
  • Relations(Join) with Tags and Users entity using TypeORM.

3. Tags

  • 게시글 태그: 키워드 서칭 등에 사용
    Articles' tags for keyword searching.
  • Tag basic CRUD

4. Categories

  • 카테고리: 페이지 헤더 및 푸터에 삽입 될 메뉴 카테고리
    Menus to be placed on page header and footer.
  • Category basic CRUD

Middleware

  1. auth.middleware : Authorization and authentication based on JWT(Access, Refresh token)
  2. param.middleware : Request params validation using Joi schema
  3. body.middleware : Request body validation using Joi schema
  4. cache.middleware : Caching articles and tags using Redis
  5. error.middleware : Using customized error middleware

Logging

Redis

  • Caching patterns: Look Aside + Write Around
    (more about this on above TroubleShooting note)