Coder Social home page Coder Social logo

codelytv / typescript-ddd-example Goto Github PK

View Code? Open in Web Editor NEW
1.3K 35.0 209.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 People

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

Update typeorm

Hello,

it seems the typeorm version you are using is deprecated

image

Could you update it to the latest version?

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!

Is there a course of this?

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

[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.

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'
}
`

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

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.

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 !

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.

Make Template

Should be great have the template option for this project.

Thanks !

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.