/chapter-backend

Primary LanguageTypeScriptMIT LicenseMIT

CHAPTER - social network for book-lovers

Description

Team-pet-project named CHAPTER. This is a web app - social network for book-lovers.

People can create post with caption and image to our service and share them with their followers. They can also view, comment and like posts shared by their friends on Chapter. Anyone can create an account by registering an email address or via Google and selecting a username. Then registered users can create bookshelf with their favorite books and share their opinion about the book.

You are in repository of backend part of the project. It is based on NestJS REST API boilerplate.

Deploy of backend part is on Heroku, frontend part is on AWS, database is on Vercel

Table of Contents

Features

  • Database (typeorm).
  • Seeding.
  • Config Service (@nestjs/config).
  • Mailing (nodemailer).
  • Sign in and sign up via email.
  • Social sign in (Google).
  • Create, edit, delete, restore account.
  • Follow, unfollow friends.
  • Create, edit, delete own bookshelf.
  • Create, delete, edit post (image, title, caption).
  • Create, delete, edit comments, answer on someone comment (text).
  • Like, unlike post or comment.
  • Get feed.
  • Admin and User roles.
  • Swagger.
  • Docker.
  • CI (Github Actions).

Quick run

git clone --depth 1 https://github.com/brocoders/nestjs-boilerplate.git my-app
cd my-app/
cp env-example .env
docker compose up -d

For check status run

docker compose logs

Comfortable development

git clone --depth 1 https://github.com/brocoders/nestjs-boilerplate.git my-app
cd my-app/
cp env-example .env

Change DATABASE_HOST=postgres to DATABASE_HOST=localhost

Change MAIL_HOST=maildev to MAIL_HOST=localhost

Run additional container:

docker compose up -d postgres adminer maildev
npm install

npm run migration:run

npm run seed:run

npm run start:dev

Links

Database utils

Generate migration

npm run migration:generate -- src/database/migrations/CreateNameTable

Run migration

npm run migration:run

Revert migration

npm run migration:revert

Drop all tables in database

npm run schema:drop

Run seed

npm run seed:run

Backend team