adonocolor / Musicians-Blog

Nest.js Blog Application with OAuth 2.0 Authentication

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maxim Ivanov M33081

logo Link

Description

This website represents musician blog

logo

Domain Model

ERD

  • Users - The administrators and readers
  • Posts - Pages and posts
  • Comments - Comments on each post
  • Categories - Topic categories

User

  • id - Primary key.
  • username - User's username. Should be unique in order to prevent duplicates.
  • firstName - 1/2 of user's full name.
  • lastName - 1/2 of user's full name.
  • password - User's password.
  • role - User's role. Can be ADMIN or USER.

User's Relations

@OneToMany(type => Post, post => post.user)
posts: Post[];

Post

  • id - Primary key.
  • commentsId - Foreign key. Id's of belonging comments.
  • userId - Foreign key. Id of the post creator.
  • postContent - Post contents.
  • postUrl - The URL of the post.
  • postTitle - Heading of the post.
  • postDate - Date of post creation.
  • postModified - Date of the last post modification.

Post's Relations

  @ManyToOne(type => User, user => user.posts)
  user: User;

  @ManyToOne(type => Comment, comment => comment.post)
  comments: Comment[];

Category

  • id - Primary key.
  • categoryName - Name of the category.
  • categoryUrl - The URL of the category.

Posts to Categories

There's also a "post_categories_category" Join Table, which attaches Categories to Posts in src/post/entities/post.entity.ts.

  @ManyToMany(() => Category)
  @JoinTable()
  categories: Category[];

About

Nest.js Blog Application with OAuth 2.0 Authentication


Languages

Language:TypeScript 60.9%Language:JavaScript 15.0%Language:Handlebars 14.1%Language:CSS 9.9%