Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Organizational blog made with NestJS, GraphQL and Mikro-ORM.

License

Notifications You must be signed in to change notification settings

tugascript/nestjs-blog

Repository files navigation

NestJS GraphQL Blog Back-End

Description

The back-end of my personal blog made with NestJS & GraphQL.

Architecture

This project is divided into three main entities/classes:

  • Users: the users of the blog, which are divided into admins, publishers and normal users.
  • Posts: the posts of the blog.
  • Series: the series of a given group of blog posts.
  • Comments: the comments, or user interaction with the blog posts.

The posts are related to the series by a many-to-many-to-many relationship, with tags as an intermediate table. It follows a team blog approach were there can be multiple publishers and admins, so it's perfect for a team as well as a single individual. In terms of table relationships apart from some exceptions they are loaded by dataloaders, even the paginated relationships.

Installation

$ yarn install

Database Migrations

# creation
$ yarn migrate:create
# update
$ yarn migrate:update

Running the app

# production mode
$ yarn start

# watch mode
$ yarn start:dev

# debug mode
$ yarn start:debug

Unit Testing

BEFORE EACH TEST (Individual or All):

  • Check if NODE_ENV is not production
  • Remove the current test.db
  • Create a new test.db
# remove test.db
$ rm test.db
# create a new test.db
$ yarn migrate:create

All tests:

# unit tests
$ yarn run test  --detectOpenHandles

Individual test:

# unit tests
$ yarn run test service-name.service.spec.ts --detectOpenHandles

License

This project is GNU GPLv3 licensed.

About

Organizational blog made with NestJS, GraphQL and Mikro-ORM.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages