https://github.com/adrianmjim/nestjs-api-grpc-example
gRPC API pet project built on top of NestJS using DDD, CQRS, MikroORM and PostgreSQL
https://github.com/adrianmjim/nestjs-api-grpc-example
cqrs ddd ddd-architecture grpc grpc-server mikroorm nestjs nestsjs nodejs postgresql
Last synced: 21 days ago
JSON representation
gRPC API pet project built on top of NestJS using DDD, CQRS, MikroORM and PostgreSQL
- Host: GitHub
- URL: https://github.com/adrianmjim/nestjs-api-grpc-example
- Owner: adrianmjim
- Created: 2023-10-09T18:42:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-03T14:13:44.000Z (29 days ago)
- Last Synced: 2026-03-03T18:29:43.609Z (28 days ago)
- Topics: cqrs, ddd, ddd-architecture, grpc, grpc-server, mikroorm, nestjs, nestsjs, nodejs, postgresql
- Language: TypeScript
- Homepage:
- Size: 119 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NestJS API gRPC Example
## Description
gRPC API pet project built on top of NestJS using DDD, CQRS, MikroORM and PostgreSQL
## Requirements:
1. Install [NodeJS](https://nodejs.org) and [pnpm](https://pnpm.io)
2. Install dependencies
```bash
pnpm install
```
3. Add an .env file based on .env.example
## Database
We need a PostgreSQL instance to run the project. It's necessary to configure the environment variables for this database in the .env file. This project can also be launched with Docker Compose, which already includes the required database instance.
This repository uses [MikroORM](https://mikro-orm.io) and its [migration system](https://mikro-orm.io/docs/migrations). To apply the migrations, you need to run the following command:
```bash
npx mikro-orm migration:up
```
## Usage:
You can start the app in development mode:
```bash
pnpm start:dev
```
Or in production mode:
1. First, You need to build code:
```bash
pnpm build
```
2. Then, You can start app:
```bash
pnpm start:prod
```
To run the current repository using Docker Compose, follow these steps:
1. Build images
```bash
docker compose build
```
2. Run services
```bash
docker compose up
```
## Test
You can run test of this project:
```bash
pnpm test
```