https://github.com/AlexGalhardo/farm-nestjs-api
A simple NestJS REST CRUD API using PostgreSQL, PrismaORM, Zod, Docker, Pino Logger, Swagger OpenAPI Documentation, Unit and Integrations Tests using Jest
https://github.com/AlexGalhardo/farm-nestjs-api
api crud docker integration-testing nestjs postgresql prisma rest-api typescript unit-test zod
Last synced: 6 months ago
JSON representation
A simple NestJS REST CRUD API using PostgreSQL, PrismaORM, Zod, Docker, Pino Logger, Swagger OpenAPI Documentation, Unit and Integrations Tests using Jest
- Host: GitHub
- URL: https://github.com/AlexGalhardo/farm-nestjs-api
- Owner: AlexGalhardo
- License: mit
- Created: 2025-06-04T16:48:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-04T05:44:21.000Z (12 months ago)
- Last Synced: 2025-07-25T16:55:33.639Z (11 months ago)
- Topics: api, crud, docker, integration-testing, nestjs, postgresql, prisma, rest-api, typescript, unit-test, zod
- Language: TypeScript
- Homepage: https://farm-nestjs-api.alexgalhardo.com
- Size: 399 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Farm NestJS API
## Technologies
- [NodeJS v22](https://nodejs.org/en)
- [NestJS v11](https://nestjs.com/)
- [PrismaORM](https://www.prisma.io/)
- [Docker](https://docs.docker.com/)
- [PostgreSQL](https://www.postgresql.org/)
## Prerequisites
- Node v22 and NPM v11
```bash
nvm install 22.9.0
nvm use 22.9.0
npm install -g npm@11.4.2
```
## Local Development Setup using Docker
1. Clone repository
```bash
git clone git@github.com:AlexGalhardo/farm-nestjs-api.git
```
2. Enter repository
```bash
cd farm-nestjs-api/
```
3. Install dependencies
```bash
npm install
```
4. Setup your environment variables
```bash
cp .env.example .env
```
5. UP Docker with Postgres & API
```bash
sudo chmod +x setup.sh && ./setup.sh
```
6. The Server API will start Inside docker connecting to your local machine at:
## Prisma Studio (DataBase GUI)
- To Start Prisma Studio:
```bash
npm run prisma:studio
```
## Build
a. Creating build
```bash
npm run build
```
b. Testing build server locally
```bash
npm run start
```
## API Requests and Docs
- You can see and use the HTTP Requests references inside folder [rest-client/](rest-client/)
- OpenAPI Documentation (using Swagger)
- Local:
## Tests
a. Run all unit mocked tests
```bash
npm run test
```

b. Run all end to end tests
```bash
npm run test:e2e
```

## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) June 2025-present, [Alex Galhardo](https://github.com/AlexGalhardo)