Skip to content

luiz504/05-ig22node-nest-clean

Repository files navigation

Ignite Forum

Welcome to Ignite Forum! This is a forum API designed to enhance my backend skills and practice various design patterns, concepts, and implementations such as DDD, SOLID, and Clean Code. It is built using the NestJS framework, powered by NodeJS and TypeScript, and utilizes PostgreSQL for data persistence and Redis for caching and Cloudflare R2 (Aws APi) to store images.

Api Documentation

With the server running access: Open Documentation

note: Under construction...

Requirements and instructions

To get started, follow these steps:

  1. Set up Docker:

    Make sure you have Docker Engine or Docker Desktop installed.

    Run the following command to configure the Database Containers:

        docker compose up -D
  2. Install Dependencies:

         npm install
  3. Run Prisma Migrations:

Depending on your environment (Dev, Prod, or Test), run the appropriate Prisma migration command:

  • Dev:

        npx prisma migrate dev
  • Prod/Test:

        npx prisma migrate deploy
  1. Set up Environment Variables:

    Create a .env file based on .env.example Generate necessary keys using the instructions provided in the RSA256 Secrets Generation Commands section below. AWS and CloudFlare environments are required too.

  2. Firing up the Server: Start the server based on your environment:

  • Dev:

        npm run start:dev
  • Prod:

        npm run build
        npm run start:prod

Prisma Commands

Here are some useful Prisma commands for managing your database:

    npx prisma init
    npx prisma migrate dev
    npx prisma studio

RSA256 secrets Generation Commands

To generate RSA256 keys for encryption, follow these commands:

  • Private Generate RSA
    openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048

Transform to base64

    openssl base64 -A -in private_key.pem -out private_key_base64.txt
  • Public Generate RSA
    openssl rsa -pubout -in private_key.pem -out public_key.pem

Transform to base64

    openssl base64 -A -in public_key.pem -out public_key_base64.txt

About

This repository holds an forum App made following the bootcamp Ignite from Rocketseat.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published