Shadowing Practice: Every NestJS Concept Explained in 9 Minutes - Learn English Speaking with Video

Bir pratik modu seçin

Her mod tam ekran bir pratik odası açar.

87 cümleler
Cümleler çok kısa veya çok uzun ise, ayarlamak için Düzenle'ye tıklayın.
1
I know exactly which button to press on my microwave to heat up my food, but if it breaks, I wouldn't be able to fix it.
2
So the same goes for programming.
3
So have you ever wondered how some people seem to always know how to fix the code, where to find the relevant information, and how to best implement new features?
4
They don't actually know everything.
5
They just understand the key concepts and principles that allow them to navigate any piece of code they encounter.
6
And after countless hours of going through the NestJS documentation, I've condensed the entire framework into 10 core concepts.
7
And by the end of this video, I'm fairly confident that you too will be able to understand any NestJS code you encounter.
8
The first concept is not often talked about, but it's actually a key to understand what NestJS is and what you can build with it.
9
So there is a misconception that NestJS is only for building APIs.
10
but in fact, there are three types of applications you can build with Nest.
11
You can create HTTP server using the Nest Factory Create and request endpoints and effectively create APIs and web servers.
12
But you can also create microservices applications using Nest Factory Create Microservice.
13
And microservices are very similar to HTTP servers, except that they can use different transport protocol such as TCP or NAT, and they can communicate via an internal network.
14
And last but not least, you can also create standalone applications using Nest Factory Create Application Context.
15
And a standalone application is just an application that doesn't have network listener.
16
So they are great for creating scheduled tasks or creating CLI tools even if you want.
17
But they all have one thing in common.
18
They need a root module.
19
So let's talk about modules now.
20
Modules are the building blocks of a Nest application.
21
So you can picture a Nest app as a graph made of modules.
22
And at the top, you always have a root module, and that root module can use other modules, and those modules can themselves use other modules and so on.
23
For example, you could have an application with a product module, an order module that uses a cart and payment module, and they could all be using a shared configuration module.
24
In terms of the implementation, a module is a class that is annotated with a module decorator.
25
And you absolutely need to understand the concept of decorators because they are everywhere in NestJS.
26
Decorators can be a bit strange to start with, but once you understand what they are, it all clicks and you can do really powerful things.
27
So a decorator is a special kind of function and it can be attached to methods, classes, properties, and it modifies their behavior and it can even add metadata.
28
Think of decorators as wearing accessories or suits that give you extra power.
29
For example, you can take an empty naked class and dress it with a fancy shiny module decorator suit.
30
And that means that it can be used by other classes that are wearing the same shiny module decorator suit.
31
To create the application module graph, you define relationship between modules by passing an object property to the module decorators.
32
And you define the related modules in the import property.
33
And once you have modules, you can add controllers inside them.
34
Controllers are classes that are annotated with the controller decorator.
35
So let's say that they are wearing a blue jacket.
36
So a controller is simply in charge of receiving incoming requests and returning a response.
37
So you can define a root path in the controller decorator, and you add methods to handle the incoming request.
38
and those methods can be annotated with a HTTP verb and those decorators can take a sub root as parameter.
39
So the main role of the controller is to receive requests and return response.
40
Anything else is delegated to other classes.
41
Most of the code that you will be writing in Nest is within providers.
42
So a provider is simply a class that can be injected in other classes as dependency.
43
So let's take a user service class as an example.
44
So you annotate that class with the injectable decorator to indicate that it's a provider.
45
Then you declare it as a provider in the user's module.
46
And now you can inject it in the controller via the constructor so you can think of providers as
47
freelance workers and nest.js is an agency that places those freelance workers wherever they are needed and congratulations you've
48
used dependency injection and the singleton pattern now let me show you how to take full control of the request handling flow starting wheel middlewares.
49
When you want to take a plane, you don't just park on the tarmac and enter the plane.
50
So you have to go to check in your luggage, then you go through security, then you might even go through border control, then you show your boarding pass, and finally you get on the plane.
51
So just like a plane passenger, you can make a request go through several stages before it's handed over to the method handler.
52
So for example, you could use middleware to log every incoming requests.
53
But don't start adding middlewares everywhere because I'll show you in the next concept that Nest comes with built-in features for common request flow management.
54
Guards are a critical part of the request lifecycle in NestJS.
55
So they work more or less like security check at an airport and their primary purpose is to determine whether the request will be handled by the root handler based on specific conditions like roles, permissions, or any custom logic.
56
So they They have access to the execution context, and that allows them to inspect some details about the request.
57
For example, an authentication guard can check if the user is authenticated and authorized to access a requested resource.
58
And if the guard returns true, then the request passes through.
59
And if it returns false, then the request is denied, and we'd send an error response to the client, for example.
60
After the guard, you can add interceptors to your application.
61
So they run before and after the root handler.
62
So they give you full control over the request response cycle.
63
So interceptors implement the nest interceptor interface and they can perform tasks like logging or caching.
64
For example, an interceptor can log request details or map the response and input data format.
65
The next stop before getting to the handler is pipes.
66
So that's where you can validate and transform the data that is handed to the handler to ensure that it meets certain criteria or is in the correct format.
67
So pipes are classes that implement the pipe transform interface and they are annotated with the injectable decorator.
68
So for instance, a pipe can validate the data sent in the request to ensure that it conforms with the expected format or the expected type or certain constraints.
69
It's up to you to implement whatever validation rules you want.
70
But if the data is invalid, then the pipe can throw an exception, preventing the root handler from executing.
71
Additionally, pipes can transform the data into a more suitable format for processing.
72
For example, a pipe can convert a string input into integer or parse dates from string representations.
73
So built-in pipes like validation pipe, parsing pipe, and parse UUID offer some common validation and transformation.
74
but you can also create custom pipes to handle specific requirements.
75
If at any point during the request handling, there is an unhandled error, Nest.js would return a 500 internal error by default.
76
But you can manually throw standard HTTP exceptions as well and be a bit more descriptive.
77
And you can even customize error handling through exception filters.
78
Exception filters are classes that implement the exception filter interface and they are decorated with the catch decorator.
79
They can catch exceptions thrown by any part of the request handling process, including guards, interceptors, pipes, or root handlers, of course.
80
But when an exception is caught, the filter determines how to handle it and what response to send.
81
For example, you can have like a global exception filter that can catch all exceptions, log the error details and return a standard error response to the client.
82
So this ensures that the client receives consistent error messages and that sensitive information is not exposed.
83
And that will make front-end developers very happy as well.
84
So exception filters provide a centralized way of handling errors and maintain the stability and security of your application.
85
Everything that I've just shown you needs to be applied if you want these concepts to stick.
86
You can watch this next video and apply those concepts, and you can follow along as I build a podcast API from scratch.
87
And in that video, I'll also show you how to test your app.

Uygulamayı İndir

Akıcı konuşmak için ihtiyacınız olan her şey

AI TelaffuzHer cümleyi puanla
IPA AlıştırmasıHer sesi ustalaştır
Kelime BilgisiKelime bankanızı oluşturun
Kelime OyunuOynarken öğrenin
FOR YOU

Video Öner

Bu dersin kelimeleri ve konuşma notları

Bu C2 seviyesindeki konuşma dersi “Every NestJS Concept Explained in 9 Minutes” videosuna dayanıyor. En çok tekrarlanan kelimeler: module, request, decorator, pipe, nest. Bu videoda gölgeleme çalışması için 87 cümle ve 1501 kelime var. Konuşma bölümü 9:18 sürüyor. Konuşmacı dakikada yaklaşık 161 kelimeyle, günlük konuşmaya yakın doğal bir hızda konuşuyor. Kelimelerin yalnızca %76’i İngilizcede en sık kullanılan 3.000 kelime arasında, bu yüzden kelime dağarcığı zorlayıcı.

Bu videodaki önemli kelimeler

Videodaki en ileri düzey 15 kelime, telaffuzu ve anlamıyla:

KelimeTelaffuzAnlam
module isim/ˈmɑd͡ʒul/modül
decorator isim/ˈdɛkəˌɹeɪtɚ/bezekçi, bezeyici
nest isim/nɛst/yuva
freelance sıfat/ˈfɹiˌlæns/freelance-
graph isim/ɡɹæf/grafik
authentication isim/ɔːˌθɛntɪˈkeɪʃn̩/kimlik doğrulama, kimlik kanıtlama
condense fiil/kənˈdɛns/yoğuşmak
constraint isim/kənˈstɹeɪnt/kısıtlama, sınırlama
criterion isim/kɹaɪˈtɪɹ.i.ən/ölçüt, kriter
endpoint isimbitim noktası, bitiş noktası
integer isim/ˈɪn.tɪ.d͡ʒə(ɹ)/tam sayı, adedimürettep
metadata isim/ˈmɛt.əˌdeɪ.tə/üstveri
singleton isim/ˈsɪŋ.ɡ(ə)l.tən/tek
tarmac isim/ˈtɑː(ɹ)mæk/asfalt
listener isim/ˈlɪs(ə)nɚ/dinleyici

Duyacağınız deyimsel fiiller

KelimeAnlam
heat up fiilısınmak, ısıtmak

Bu videodaki dil bilgisi

Konuşmacının en çok kullandığı yapılar, videodaki sözcüklerin aynısıyla:

YapıVideoda
Edilgen yapı be + fiilin üçüncü hâli — kimin yaptığı değil, ne olduğu önemliis not often talked · is annotated · can be attached
Present perfect have/has + fiilin üçüncü hâli — geçmişte olan ama şimdi de önemli olan bir eylemhave you ever wondered · I've condensed · I've just shown

Dikkat edilecek telaffuzlar

Konuşmacı don't, I'll, I've gibi kısaltılmış biçimleri 12 kez kullanıyor. Bunları duyduğunuz gibi kısa söyleyin.

  • “th” sesleri: authenticate /ɔˈθɛn.tɪ.keɪt/, authentication /ɔːˌθɛntɪˈkeɪʃn̩/, authorize /ˈɔθəɹaɪz/
  • “sh” ve “zh” sesleri: validation /ˌvæl.əˈdeɪ.ʃən/, authentication /ɔːˌθɛntɪˈkeɪʃn̩/, misconception /ˌmɪs.kənˈsɛp.ʃən/, cache /kæʃ/, documentation /ˌdɑkjəmɛnˈteɪʃən/
  • Uzun kelimeler — vurguyu doğru yere koyun: decorator /ˈdɛkəˌɹeɪtɚ/, interceptor /ˈɪn.təɹˌsɛp.təɹ/, validation /ˌvæl.əˈdeɪ.ʃən/, injectable /ɪnˈd͡ʒɛktəbəl/, dependency /dɪˈpɛndənsi/

Türkçe konuşanların zorlandığı sesler:

  • Kelime başındaki ünsüz kümesi — araya ünlü eklemeyin: transform /tɹænsˈfɔɹm/, freelance /ˈfɹiˌlæns/, graph /ɡɹæf/, criterion /kɹaɪˈtɪɹ.i.ən/
  • /æ/ — “e”den daha açık: handler /ˈhænd.lə/, annotate /ˈæn.ə.teɪt/, validation /ˌvæl.əˈdeɪ.ʃən/, transform /tɹænsˈfɔɹm/, validate /ˈvæl.ɪ.deɪt/

Bu videoyla nasıl çalışılır

  1. Videonun tamamını konuşmadan bir kez dinleyin ve bilmediğiniz kelimeleri not edin.
  2. 0,75× hızla başlayın, cümle cümle tekrar edin ve kolaylaşınca normal hıza dönün.
  3. Kendinizi kaydedin ve orijinaliyle karşılaştırın; module, decorator, nest gibi kelimelere özellikle dikkat edin.

Gölgeleme Tekniği Nedir?

Gölgeleme, başlangıçta profesyonel tercüman eğitimi için geliştirilen ve çok dilli Dr. Alexander Arguelles tarafından popüler hale getirilen, bilim destekli bir dil öğrenme tekniğidir. Yöntem basit ama güçlüdür: ana dili İngilizce olan bir sesi dinler ve hemen yüksek sesle tekrar edersiniz — konuşmacıyı 1-2 saniye gecikmeyle takip eden bir gölge gibi. Pasif dinleme veya dilbilgisi alıştırmalarının aksine, gölgeleme beyninizi ve ağız kaslarınızı gerçek konuşma kalıplarını eşzamanlı olarak işlemeye ve yeniden üretmeye zorlar. Araştırmalar, telaffuz doğruluğu, tonlama, ritim, bağlı konuşma, dinleme anlama ve konuşma akıcılığını önemli ölçüde geliştirdiğini göstermektedir — bu da onu IELTS Konuşma hazırlığı ve gerçek dünya İngilizce iletişimi için en etkili yöntemlerden biri yapar.

Shadowing tekniği: adım adım eksiksiz rehberi okuyun →