Giter VIP home page Giter VIP logo

news-feed-service's Introduction

Class Notice News Feeds

Table of Contents

Overview

이 저장소에는 학교 소식 뉴스피드 백엔드 API를 구현하였습니다.

  • Framework
    • nestjs + typescript
  • ORM
    • typeorm
  • DB
    • Mysql, SQLite(Only Test)
    • Redis
  • OAuth 2.0
    • Jwt

Architecture

Twitter의 System Design을 참고하여 뉴스 피드 시스템을 설계하였습니다.

관리자가 소식을 작성하면 해당 페이지를 구독 중인 유저와 소식을 Cache Database에 비동기로 맵핑하여 저장하고 뉴스 피드를 복잡한 쿼리 조회 과정을 거치지 않고 빠르게 사용자에게 제공하도록 설계하였습니다.

맵핑 데이터를 저장하기 위해 Cache Database를 사용한 이유는 만약 페이지를 구독 중인 유저가 늘어났을 때 insert를 처리하는 속도가 RDBMS보다 Cache DB가 성능적으로 빠르고 그에 따른 부하를 줄이기 위해 Redis를 선택하였습니다.

Pre-Requisites

Setup and Installation

Installation

Install the required npm packages with:

$ npm install

Building

# Build once
$ npm run build

# Clean the dist folder
$ npm run prebuild

Running Tests

Unit tests are written using the Jest framework. To run tests, execute:

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Running Locally

# create mysql, redis container for development environment
$ docker-compose up -d 

# development
$ npm run start

# watch mode
$ npm run start:dev

API Document

news-feed-service's People

Contributors

coderhglee avatar renovate-bot avatar

Watchers

 avatar

news-feed-service's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update dependency class-transformer to ^0.5.0
  • fix(deps): update dependency typeorm to ^0.3.0
  • chore(deps): update dependency @nestjs/cli to v9
  • chore(deps): update dependency @types/node to v18
  • chore(deps): update dependency eslint to v8
  • chore(deps): update dependency eslint-plugin-prettier to v4
  • chore(deps): update dependency jest-mock-extended to v3
  • chore(deps): update dependency ts-loader to v9
  • chore(deps): update dependency ts-node to v10
  • chore(deps): update dependency tsconfig-paths to v4
  • chore(deps): update jest monorepo to v29 (major) (@types/jest, jest, ts-jest)
  • chore(deps): update mysql docker tag to v8
  • chore(deps): update typescript-eslint monorepo to v5 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency @nestjs/config to v2
  • fix(deps): update dependency @nestjs/jwt to v10
  • fix(deps): update dependency @nestjs/swagger to v6
  • fix(deps): update dependency @nestjs/typeorm to v9
  • fix(deps): update dependency ioredis-mock to v8
  • fix(deps): update dependency redis to v4 (redis, @types/redis)
  • fix(deps): update dependency rimraf to v4
  • fix(deps): update dependency rxjs to v7
  • fix(deps): update nest monorepo to v9 (major) (@nestjs/common, @nestjs/microservices, @nestjs/passport, @nestjs/platform-express, @nestjs/schematics, @nestjs/testing)
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
  • mysql 5.7
npm
package.json
  • @nestjs/common ^7.6.15
  • @nestjs/config ^0.6.3
  • @nestjs/core ^7.6.15
  • @nestjs/jwt ^7.2.0
  • @nestjs/mapped-types *
  • @nestjs/microservices ^7.6.17
  • @nestjs/passport ^7.1.5
  • @nestjs/platform-express ^7.6.15
  • @nestjs/swagger ^4.8.0
  • @nestjs/typeorm ^7.1.5
  • bcrypt ^5.0.1
  • class-transformer ^0.4.0
  • class-validator ^0.13.1
  • ioredis-mock ^5.5.6
  • mysql ^2.18.1
  • passport ^0.4.1
  • passport-jwt ^4.0.0
  • passport-local ^1.0.0
  • redis ^3.1.2
  • reflect-metadata ^0.1.13
  • rimraf ^3.0.2
  • rxjs ^6.6.6
  • sqlite3 ^5.0.2
  • swagger-ui-express ^4.1.6
  • typeorm ^0.2.32
  • @nestjs/cli ^7.6.0
  • @nestjs/schematics ^7.3.0
  • @nestjs/testing ^7.6.15
  • @types/bcrypt ^5.0.0
  • @types/express ^4.17.11
  • @types/ioredis ^4.26.4
  • @types/jest ^26.0.22
  • @types/node ^14.14.36
  • @types/passport-jwt ^3.0.5
  • @types/passport-local ^1.0.33
  • @types/redis ^2.8.28
  • @types/supertest ^2.0.10
  • @typescript-eslint/eslint-plugin ^4.19.0
  • @typescript-eslint/parser ^4.19.0
  • eslint ^7.22.0
  • eslint-config-prettier ^8.1.0
  • eslint-plugin-prettier ^3.3.1
  • jest ^26.6.3
  • jest-mock-extended ^1.0.14
  • prettier ^2.2.1
  • redis-mock ^0.56.3
  • supertest ^6.1.3
  • ts-jest ^26.5.4
  • ts-loader ^8.0.18
  • ts-node ^9.1.1
  • tsconfig-paths ^3.9.0
  • typescript ^4.2.3

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.