Skip to content

SeRodrigalvarez/Clean-architecture-personal-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Clean Architecture Personal Project

Important

Please, note that this repository is work in progress

Description

This project started as NoFakes Code Challenge with Nest using Hexagonal Architecture and SOLID Principles. I decided to use it as personal project to apply CQRS to the existing code base (still WIP).

One interesting detail to notice in this project: As typescript type exception catching is lacking (instanceof is needed to treat different types of exceptions), I decided to experiment with golang style error handling. You will find that try-catch is only used in infraestructure layer to treat persistence thrown exception while result objects are used in the rest of the code.

Branches

Hexagonal Architecture: 00-hexagonal-architecture

CQRS: 01-cqrs

Installation

$ npm install
# run once to install husky if you are going to commit something 
$ npm prepare

Database

# start mongodb database 
$ docker compose up

The web interface can be accessed at http://localhost:8081/

Running the app

MongoDB environment variables must be set in the .env. Use .env.example as template.

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

No-Fakes.postman_collection.json contains all the REST requests.

Test (WIP)

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published