Skip to content

Commit fd8f11d

Browse files
committed
feat(readme): Add README
1 parent 174f1fe commit fd8f11d

File tree

3 files changed

+84
-10
lines changed

3 files changed

+84
-10
lines changed

README:md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# NestJS API gRPC Example
2+
3+
<p align="center">
4+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
5+
</p>
6+
7+
8+
<p align="center">
9+
<a href="https://github.com/Adrianmjim/nestjs-api-grpc-example/workflows/CI/badge.svg"><img src="https://github.com/Adrianmjim/nestjs-api-grpc-example/workflows/CI/badge.svg" /></a>
10+
<a href="https://codecov.io/gh/Adrianmjim/nestjs-api-grpc-example" >
11+
<img src="https://codecov.io/gh/Adrianmjim/nestjs-api-grpc-example/graph/badge.svg?token=QZT9E52RPJ"/>
12+
</a>
13+
<a href="https://codeclimate.com/github/Adrianmjim/nestjs-api-grpc-example/maintainability"><img src="https://api.codeclimate.com/v1/badges/001ca441a785966ce8be/maintainability" /></a>
14+
</p>
15+
16+
## Description
17+
18+
gRPC API pet project built on top of NestJS using DDD, CQRS, MikroORM and PostgreSQL
19+
20+
## Requirements:
21+
22+
1. Install [NodeJS](https://nodejs.org) and [pnpm](https://pnpm.io)
23+
24+
2. Install dependencies
25+
26+
```bash
27+
pnpm install
28+
```
29+
30+
3. Add an .env file based on .env.example
31+
32+
## Database
33+
34+
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.
35+
36+
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:
37+
38+
```bash
39+
npx mikro-orm migration:up
40+
```
41+
42+
## Usage:
43+
44+
You can start the app in development mode:
45+
46+
```bash
47+
pnpm start:dev
48+
```
49+
50+
Or in production mode:
51+
52+
1. First, You need to build code:
53+
54+
```bash
55+
pnpm build
56+
```
57+
58+
2. Then, You can start app:
59+
60+
```bash
61+
pnpm start:prod
62+
```
63+
64+
To run the current repository using Docker Compose, follow these steps:
65+
66+
1. Build images
67+
68+
```bash
69+
docker compose build
70+
```
71+
72+
2. Run services
73+
74+
```bash
75+
docker compose up
76+
```
77+
78+
## Test
79+
80+
You can run test of this project:
81+
```bash
82+
pnpm test
83+
```

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ services:
2424
depends_on:
2525
- database
2626
ports:
27-
- 5001:5000
28-
- 3000:3000
27+
- 5000:5000
2928
- 9228:9228
3029
- 9229:9229

package.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,10 @@
1717
"start:dev": "TZ=$npm_package_config_TZ tsc-watch -p tsconfig.build.json --onSuccess \"node --inspect=0.0.0.0:9229 dist/main.js\"",
1818
"start:prod": "TZ=$npm_package_config_TZ node dist/main.js",
1919
"test": "TZ=$npm_package_config_TZ jest",
20-
"test:ci": "npm run test -- --collectCoverage --ci --reporters=default --reporters=jest-junit --coverageReporters=cobertura --coverageReporters=text",
21-
"test:ci:diff": "npm run test -- --collectCoverage --ci --reporters=default --reporters=jest-junit --coverageReporters=cobertura --coverageReporters=text --changedSince=origin/$MR_TARGET_BRANCH",
2220
"test:debug": "TZ=$npm_package_config_TZ node --inspect-brk node_modules/jest/bin/jest.js --runInBand",
2321
"test:coverage": "npm test -- --coverage",
2422
"test:main": "TZ=$npm_package_config_TZ jest --changedSince=origin/main",
2523
"test:previous": "TZ=$npm_package_config_TZ jest --changedSince=HEAD~1",
26-
"test:js:ci": "npm run test:js -- --ci",
27-
"test:js:ci:coverage": "npm run test:js:ci -- --coverage",
28-
"test:js:coverage": "npm run test:js -- --coverage",
29-
"test:js": "npm test -- --config=jest.js.config.json",
30-
"test:unit": "TZ=$npm_package_config_TZ jest --selectProjects Unit",
31-
"test:unit:js": "npm run test:js -- --selectProjects Unit",
3224
"prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\"",
3325
"mikro-orm:migration:create": "npx mikro-orm migration:create"
3426
},

0 commit comments

Comments
 (0)