Giter Site home page Giter Site logo

codelytv / typescript-ddd-example Goto Github PK

View Code? Open in Web Editor NEW
1.2K 35.0 207.0 2.17 MB

🔷🎯 TypeScript DDD Example: Complete project applying Hexagonal Architecture and Domain-Driven Design patterns

Home Page: https://pro.codely.tv/library/ddd-typescript/375662/about/

TypeScript 95.32% JavaScript 0.41% Gherkin 2.48% Dockerfile 0.04% Makefile 0.44% HTML 0.82% CSS 0.47%
ddd typescript cqrs ddd-architecture ddd-example ddd-cqrs dddesign hexagonal-architecture javascript codely

typescript-ddd-example's Introduction

Codely logo

🐘🎯 Hexagonal Architecture, DDD & CQRS in Typescript

codely.tv CodelyTV Courses

Example of a Typescript application following Domain-Driven Design (DDD), Command Query Responsibility Segregation (CQRS) and Event-Driven Architecture (EDA) principles keeping the code as simple as possible.

🔀 Related utilities and resources

☝️ Learning resources

🔷 TypeScript skeletons

🌈 TypeScript Domain-Driven Design repositories

🎯 Other languages Domain-Driven Design repositories

typescript-ddd-example's People

Contributors

aartiles avatar alemarcha avatar aliondev avatar chemitaxis avatar coal182 avatar davidmatas avatar dependabot-preview[bot] avatar fortiz2305 avatar ivanportillo avatar javiercane avatar rsaladocid avatar santakadev avatar simonppg avatar vilasmaciel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

typescript-ddd-example's Issues

[Question] - Error de dependencia circular en application service con commandBus

Tengo un commandBus en el controller y además necesito un commandBus en el aplication service para poder lanzar un caso de uso de otro módulo dentro del mismo context, pero al añadir ese segundo commandBus me salta el error: RangeError: Maximum call stack size exceeded

No estoy muy familiarizado con la inyección de dependencias y no sabría como solucionar este problema de dependencia circular,
¿Hay alguna forma de solucionarlo?

Muchas gracias.

Middleware question

Hi,

How can put a middleware in a route? I tried several times, but I have not been able to achieve it.

Thanks !

Update typeorm

Hello,

it seems the typeorm version you are using is deprecated

image

Could you update it to the latest version?

Absolute Imports 🤔

What is the reason for not using absolute imports?.

I ask, because I do not know if using this functionality has counterproductions in terms of performances or some other.

Problemas con dependency-injection cuando se compilar para producción

Este error viene dado cuando desde cualquier fichero de ruta se hace el import container from '.. /config/dependency-injection'

/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/node_modules/node-dependency-injection/dist/lib/Loader/YamlFileLoader.js:73
throw new _ServiceFileNotFoundException"default";
^

Error
at new ServiceFileNotFoundException (/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/node_modules/node-dependency-injection/dist/lib/Exception/ServiceFileNotFoundException.js:45:19)
at YamlFileLoader.load (/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/node_modules/node-dependency-injection/dist/lib/Loader/YamlFileLoader.js:73:15)
at Object. (/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/dist/src/apps/mmc/config/dependency-injection/index.js:7:8)
at Module._compile (internal/modules/cjs/loader.js:1151:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1040:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/dist/src/apps/mmc/routes/authRoute.js:6:32) {
name: 'ServiceFileNotFoundException'
}
`

Make Template

Should be great have the template option for this project.

Thanks !

Just a small question

I have a question regarding the responsability of incrementing the total in CousesCounter, Shouldn't this be on domain layer?

like tell the CoursesCounter to increment and let it to deside if this needs to be done or not, sounds to me like a bussines logic, but I could be wrong.

https://github.com/CodelyTV/typescript-ddd-skeleton/blob/8b9775292d60498d79ca39ea95213cda9db6cf93/src/Contexts/Mooc/CoursesCounter/application/Increment/CoursesCounterIncrementer.ts#L13-L14

Is this someth

Is there a course of this?

Hola amigos, de codely, quiero aprender DDD o arquitectura exgonal, empece aprender typescript, hay un curso de esto?

Should the controller expect Domain Errors from the command bus?

You have this at the CoursePutController.ts#L20:

    try {
      await this.commandBus.dispatch(createCourseCommand);
    } catch (error) {
      if (error instanceof CourseAlreadyExists) {
        res.status(httpStatus.BAD_REQUEST).send(error.message);
      } else {
        res.status(httpStatus.INTERNAL_SERVER_ERROR).json(error);
      }
    }

Right now this works because we are using an InMemoryCommandBus implementation. But, if we change the CommandBus implementation to one where we cannot expect the execution of the code (for example if we store this command in Kafka for later consumption), the implementation of this controller wouldn't work at all (because the use case will never get executed in this request, and it will never throw).

Is this true? Thanks!

Domain entities constructor should be private

Hi, good job with the project. I believe that domain entities should have a private constructor. Right now we are able to create instances from those classes by static methods which are correct but we are also able to do it by calling new - in that way domain events would not be published.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.