A forum API developed with NestJS, applying Clean Architecture and Domain-Driven Design (DDD) concepts.
This project is a RESTful API for a forum platform. It was built with the goal of studying and applying robust and scalable software architecture patterns, such as Clean Architecture, to separate system responsibilities, and Domain-Driven Design, to model the software around the business domain.
The following are the main technologies and libraries used in the API's development:
- Main Framework: NestJS
- Language: TypeScript
- ORM: Prisma
- Testing: Vitest
- Containerization: Docker
Follow the steps below to set up and run the project in your local environment.
- Node.js (version specified in the
.nvmrcfile) - Docker and Docker Compose
- A package manager like NPM or Yarn
-
Clone the repository:
git clone <your-repository-url> cd <repository-name>
-
Install dependencies:
npm install
-
Set up environment variables:
- Copy the
.env.examplefile to a new file named.env. - Fill in the variables in the
.envfile with your configurations (database, secrets, etc.).
cp .env.example .env
- Copy the
-
Start the database with Docker:
- Make sure Docker is running on your machine.
docker-compose up -d
-
Run Prisma migrations:
- This command will create the tables in the database based on your schema.
npx prisma migrate dev
-
Start the application in development mode:
npm run start:dev
After these steps, the API will be running and ready to receive requests.
To run the application's tests, use the following command:
npm run test