Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jmorbegoso/wish-list-api

Backend API built with NestJS using Domain-Driven Design and Clean Architecture.
https://github.com/jmorbegoso/wish-list-api

access-token authentication clean-architecture ddd docker jest mikroorm mongodb nestjs refresh-token repository-pattern swagger unit-of-work-pattern

Last synced: 2 days ago
JSON representation

Backend API built with NestJS using Domain-Driven Design and Clean Architecture.

Awesome Lists containing this project

README

        

Wish List API ๐ŸŒŸ


Backend REST API built with NestJS and following the principles of Domain-Driven Design and Clean Architecture



TypeScript badge
NestJS badge
MongoDB badge
Yarn badge
Jest badge
Docker badge

Wish List API is a backend REST API where you can publish your wishes, share them, and keep them on track, recording the progress you make, until you fulfill them.

## โœจ Features

- Built with TypeScript.
- Domain-Driven Design (DDD):
- Value Objects.
- Entities.
- Aggregates.
- Clean Architecture:
- Domain Layer.
- Application Layer.
- Infrastructure Layer.
- Design Patterns:
- [Repository Pattern](https://blog.jmorbegoso.com/post/repository-pattern/).
- [Unit of Work](https://blog.jmorbegoso.com/post/unit-of-work-pattern/).
- [Static Factory Method Pattern](https://blog.jmorbegoso.com/post/static-factory-method-pattern/).
- Command Query Responsibility Segregation (CQRS).
- ๐Ÿ“บ Presentation:
- NestJS.
- ๐Ÿ“š Persistence:
- MikroORM.
- MongoDB.
- ๐Ÿ‘ค Authentication:
- [Passport.js](http://www.passportjs.org/).
- JWT Access Tokens.
- Refresh Tokens.
- Refresh Tokens rotation.
- Refresh Tokens auto-revocation.
- ๐Ÿ›ก๏ธ Authorization:
- User Roles.
- Resource Ownership.
- ๐Ÿงช Testing:
- Jest.
- Supertest (e2e).
- Coverage Report: 70%.
- ๐Ÿ“ Documentation:
- [Swagger for NestJS](https://github.com/nestjs/swagger/).

## โŒš Prerequisites

To run this Backend API make sure you have installed all of the following prerequisites on your machine:

- Node.js.
- TypeScript.
- Yarn.
- Docker.

## ๐Ÿ’ป Install

```bash
# Environment Variables
cp '.env.example' '.env' # Development
cp '.env.example' '.test.env' # Tests

# Install dependencies
yarn

# Run MongoDB database in Docker ๐Ÿ‹
docker-compose up # Development
docker-compose -f docker-compose.e2e.yml --env-file ./.test.env up # Tests
```

## ๐Ÿš€ Running

```bash
# Run in development mode
yarn start

# Run in watch mode (development)
yarn start:dev

# Run in production mode
yarn start:prod
```

## ๐Ÿงช Tests

```bash
# Run tests
yarn test

# Run test coverage
yarn test:cov

# Run tests end to end
yarn test:e2e
```

## ๐Ÿง‘โ€๐Ÿ’ป Author

**JMOrbegoso**

- Website: [jmorbegoso.com](https://www.jmorbegoso.com)
- Twitter: [@JMOrbegosoDev](https://twitter.com/JMOrbegosoDev/)
- Github: [@JMOrbegoso](https://github.com/JMOrbegoso/)
- LinkedIn: [@jmorbegosodev](https://www.linkedin.com/in/jmorbegosodev/)