mfatima5bc / forum-backend-app-nest-clean

Ignite nest project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Forum backend project

Hi!
This project is a backend for a forum platform. Think about the actors in a school forum. In this case, we have users, which can be students or instructors who can create a topic and the students can write an answer and answer comments. A professor can select an answer as the best answer for that topic, and both topics or answers can have attachments in his content.

Another important point about this project is the notification module. So when a question has a new answer or comments the author should be notified. And when an answer is selected as best the author also should be notified.

the strategy

  • The authentication is jwt.
  • For notification, I use a partner named pubSub.
  • To list question endpoint was decided to use cache strategy.

the stack

  • nodejs
  • typescript
  • nestjs
  • docker
  • vite
  • zod
  • prisma
  • postgres
  • Cloudflare R2
  • redis

Start this project

first download this repo:

git clone git@github.com:mfatima5bc/05-nest-clean.git

install the dependences:

npm i

configure you R2 bucket and enviroments variables, based on .env.example

TODO

run tests

npm run test

Generate migrations

npx prisma generate

start the services with docker If you'r running this on wsl and you docker is instaled on windows, comment the compose line # network_mode: host

docker compose up --build -d

Rum migrations

npx prisma migrate dev # deploy

You can use the client.http to try the api endpoints, just download REST Cliente vscode extension

Enjoy!

About

Ignite nest project


Languages

Language:TypeScript 99.9%Language:Dockerfile 0.1%