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.
With the server running access: Open Documentation
note: Under construction...
To get started, follow these steps:
-
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
-
Install Dependencies:
npm install
-
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
-
Set up Environment Variables:
Create a
.env
file based on.env.example
Generate necessary keys using the instructions provided in theRSA256 Secrets Generation Commands
section below. AWS and CloudFlare environments are required too. -
Firing up the Server: Start the server based on your environment:
-
Dev:
npm run start:dev
-
Prod:
npm run build npm run start:prod
Here are some useful Prisma commands for managing your database:
npx prisma init
npx prisma migrate dev
npx prisma studio
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