Clean Architecture in TypeScript

preview_player
Показать описание
DISCLAIMER:
I left out a lot of details in this video because its goal is to lay down a skeleton. When you get started with CA let your decisions be driven by the requirements and you will figure out all those details on your own.

Starter Template:

Live Example Repository:

Dependency Injection and Dependency Inversion Principle:

Data Transfer Objects and Layers

0:00: Intro
0:17 : What do you need to know ?
0:30 : Before we get started
1:40 : Agenda
2:08 : Dependency Inversion Principle (DIP)
4:40 : Interface Adapter
6:25 : The Modern Take
10:45 : Main Component
Рекомендации по теме
Комментарии
Автор

I would recommend to keep express types out of controllers for the sake of clean architecture. In theory, the controllers should not depend on utilities such as express. A way to do this would be implementing an interceptor to convert express requests to relevant stuff such as URL parameters, request body, queries, and authorization headers (or any other headers) so that if you decide not to use express in the future, you can only edit the ApiServer class and be done with it.

echorises
Автор

This is one of the best technical YouTube videos I've ever seen. You cited sources, covered the facts and then separately expounded on your opinion followed by an actual live-coded example beyond "products, " "orders" and "customers." Very well done, you've earned my subscription.

AndrewElgert
Автор

I've been studying CA for the last month and am finally at the point of implementing it. This video is tremendously helpful. +1 Sub.

realjrbauer
Автор

Keep these videos going man, they are great. Can't really find recent content like this elsewhere. Wouldn't mind paying for a full course either with a production level project.

KrisGergov
Автор

Such a brilliant video. THANK YOU. Finally was able to implement CA step by step with no issues other than package versions.

harutyunyanmarieta
Автор

I would love to see another tutorial where you build vertical slice architecture from scratch. Either way, this was great and you got a subscription from me. Thank you

MikeyUchiha
Автор

0:0: Intro
0:17 : What do you need to know ?
0:30 : Before we get started
1:40 : Agenda
2:08 : Dependency Inversion Principle (DIP)
4:40 : Interface Adapter
6:25 : The Modern Take
10:45 : Main Component

FeyroozeCode
Автор

Nice one, man! I liked at the end where you get to see everything all linked up. Clean Arch is so good for finally forcing you to think about the abstractions you're creating instead of just writing code 'till stuff works. Would love to see a composition or DI container video as a follow up - curious how you prefer to link things together for flexibility.

thekhalilstemmler
Автор

Nice work man. It was very clear and clean explain. Thanks for good content.

codersindonesia
Автор

Keep the great work, it was one of the best explanation so far on youtube

computertech
Автор

Awesome video! You captured so much knowledge into a 1 hour video.

georgemilev
Автор

Putting the type of the variable into its name (e.g. starting interface identifiers with an "I") is called the Hungarian notation and it has been mostly discouraged for quite a long time. Even Uncle Bob writes about it in his "Clean Code".

acrosstundras
Автор

Thank you for the great video. I'm interested in your opinion on the thought that adding a new logbook looks like a business action and should be included to the domain model. In this case we could have corresponding Domain Service or LogbookStorage Aggregate which uses repository and thus repository interface migrates to the domain layer. The more or less complex domain logic should have access to the repository anyway.

EugeneFreiman
Автор

Thank you Donny, just want to ask, how would you combine multiple use cases? that is the problem I'm having rn huhu

lawliet.fortyfour
Автор

Yeah, pretty cool video! Thanks!
What if you need to use "use cases" in several places though? Or when a second "use case" depends on the result which we receive from the first "use case"?
For example: I need to send an invite after placing the order, or just send an invite and create a user immediately.
Creating user - it is "use case" (you can create a user as an admin, or as a user who comes to the website)
Sending invite - use case
Placing an order - "use case"

illiaosmanov
Автор

yoo very helpful video!
btw can i ask what theme and font are you using ?

gg.cipt
Автор

Hi Donny,
Thanks a lot for sharing such valuable insights. Your content is a goldmine of knowledge, and I can't wait to apply these learnings. Keep up the fantastic work! 👏👍
Question : I need to integrate a 3rd-party service like Stripe and also utilize some AWS services. Could you please guide me on how to align these requirements with the project structure you have suggested here.

Thanks

naveenfernando
Автор

Hi Donny thank you for creating this video it was very useful,

I had question or something to clarify, with. if I had to communicate with other services by hit their endpoint where i should put the execution of it? in my understanding it will be on the infrastructure layer CMIIW

thanks

DilapangaTeknologiPerkasa
Автор

how would you structure the app if say a usecase needs to get interact with another entitiy? say user and logbook and you want in the get user to also get their logbooks?
would that be getUserWithLogbooksUsecase and that usecase is allowed to cross from the user folder and import say getLogbooks from the logbook folder?
if so what is allowed to cross and be imported from others? usecases ? domain entities ? domain entity DTOs ?

Oblivianos
Автор

Damn this is difficult as a junior dev :((, but thanks :D.

Do you have any suggestions/resources so someone with less context to polish on these concepts?

gadgetboyplaysmc