Shadowing Practice: Next.js in 100 Seconds // Plus Full Beginner's Tutorial - Learn English Speaking with Video

Choose a practice mode

Each mode opens a full-screen practice room.

163 sentences
If sentences are too short or too long, click Edit to adjust them.
1
Next .js, create fast, search engine optimized
2
React apps with zero configuration.
3
A traditional React app is rendered client -side, where the browser starts with a shell of an HTML page lacking any rendered content.
4
From there, the browser fetches the JavaScript file containing the React code to render content to the page and make it interactive.
5
But there are two major drawbacks with client -side rendering.
6
One, the content is not reliably indexed by all search engines or read by social media linkbots.
7
And two, it can take longer to reach the first contentful paint when a user first lands on the web page.
8
Next is a framework that allows you to build a React app, but render the content in advance on the server,
9
so the first thing a user or a search bot sees is the fully rendered HTML.
10
After receiving this initial page, client -side rendering takes over, and it works just like a traditional React app.
11
It's the best of both worlds.
12
Fully rendered content for bots, highly interactive content for users.
13
Inside of a Next project, you have a Pages directory.
14
Each JavaScript file defined here exports a React component that represents a route in the application.
15
In other words, the file structure here mirrors the actual URLs that the user will navigate to,
16
and Next provides its own router to make navigation seamless.
17
But the real magic comes into play when we talk about data fetching, because Next can perform multiple server rendering strategies from a single project.
18
Static generation, or pre -rendering, allows you to render your pages at build time.
19
Each page or component can implement a function called getStaticProps.
20
It might fetch data from a cloud database, then pass the data as props to the component.
21
You can then build your app to render out all the HTML locally
22
and upload it to a storage bucket where it can be easily cached by a CDN.
23
That works great for a blog or any kind of app where the data doesn't change often.
24
But if the data does change often, you can implement server -side rendering, which builds the HTML page each time it's requested by the user.
25
In the component, we implement data fetching with the getServerSideProps function.
26
Instead of running at build time, this function runs at request time.
27
That means the page will fetch the latest data on the server each time a new request comes in.
28
That's great for pages with rapidly changing data, but maybe you want something in between.
29
Yet another option is incremental static regeneration.
30
By simply adding a revalidate option to get static props, Next can regenerate a page whenever a new request comes in within a certain time interval.
31
This has been Next .js in 100 seconds.
32
If you want to see more short videos like this, make sure to subscribe and hit the like button.
33
Then open up VS Code and get ready to go beyond 100 seconds with a full breakdown of Next.
34
Before we get going, I'd like to point out that I'm working on a full
35
React Next Firebase course, which I hope to have finally finished by the end of January, which will be available to Fireship Pro members.
36
My goal over the next few minutes is to teach you the fundamentals of Next
37
while also explaining the complexities of server side rendering.
38
To follow along, open up the terminal and run npx create next app followed by the name of your app.
39
And if you get lost at any point, make sure to grab the source code on GitHub or Fireship IO.
40
Let's open up the project in VS Code and then go into the package .json file.
41
In development, the only script we need to worry about is dev, which you can execute by running npm run dev from the command line,
42
which will run our app on localhost 3000.
43
That should give you the default boilerplate in the browser.
44
Now before we get into the React code, there's a few things that I want to point out.
45
First, in the styles directory here, you'll notice how
46
Next supports CSS modules.
47
In the globals file, you can define styles that apply to the entire application.
48
But in other files with .module, you can define classes that only apply to a specific route or component.
49
And you don't have to worry about coming up with a bunch of unique class names
50
or naming conventions when managing your styles.
51
If you want to use styles from a certain module, you just import the style sheet in your JavaScript,
52
then reference your styles in JSX as if the styles were a JavaScript object.
53
That's pretty awesome, but from there, let's shift our attention over to the pages directory.
54
Inside this directory, we define all of the pages and routes for the application.
55
At the highest level, we have this underscore app .js file, which is like the main entry point into the app.
56
In other words, every individual page will start from this template.
57
Currently, the application only has one page, which points to the root URL and is defined by the component in the index .js file.
58
When a user navigates to this URL, next will find the default export, which is a React component, in this file.
59
So every file or page in your application needs to have one default export.
60
To demonstrate this further, let's create our first route.
61
In the pages directory, create a new file called hello .js.
62
Then we can define the content of this page by exporting
63
a default react component from it from there we can go back to the browser
64
and navigate to localhost 3000 slash hello and we should get the content of
65
that component congratulations you just built your first web page with next
66
but now let's imagine a route that's a little more complex we have a cars route
67
that should show a list of cars then an infinite number of cars
68
that might be dynamically generated under that url we can implement a dynamic route like that by first creating a cars directory.
69
Then inside the directory, we'll add an index .js file.
70
which will show the main list of cars.
71
Then for each individual car, we'll add a component that has a file name of brackets param name dot j s.
72
The brackets make this route dynamic, which means anytime a user navigates to cars slash whatever, or cars slash
73
Tesla, it will render the component in this file.
74
To see that in action, let's go ahead and implement the component logic.
75
In the index file, we'll just add a placeholder for the cars list for now.
76
But in the dynamic component, we'll import the useRouter hook from the next router.
77
It allows us to access the query parameters from the URL.
78
In this example, the value is ID, but you can give it a name of whatever you want.
79
And then we'll render that value out to the template.
80
Now back in the browser, if we go to the cars URL, it renders out the cars component.
81
Then if we add any string after the cars URL, it renders out the dynamic component.
82
Now one other thing you may have noticed in the pages directory is this API directory.
83
So what is that all about?
84
The API directory is a special part of Next for setting up routes that will only apply to the server.
85
That can be useful because the code you write here won't increase the client -side JavaScript bundle
86
that needs to ultimately be sent over the network.
87
We're not going to get into API routes in this video,
88
but just know that it's a useful feature when you have work that needs to be done on the backend,
89
or if you simply want to expose an API for your end users.
90
But now, let's shift our attention over to the most valuable feature in Next, which of course is data fetching.
91
Next allows us to fetch data and render HTML on the server.
92
And again, the benefit of doing that is
93
that the end user gets rendered content quicker
94
and the content can be reliably crawled by search bots and social media link bots.
95
Now, when it comes to server rendering, there are two main options, static generation and server -side rendering.
96
Static generation is also called pre -rendering because you generate all the HTML at build time.
97
It makes life very simple because you generate a bunch of HTML files, then upload them to a storage bucket or static host,
98
and they can be delivered with very high performance over a CDN.
99
But there's a couple of big trade -offs here.
100
The first one is that your data may become stale.
101
If the data on the server changes, you need to rebuild and redeploy your site in order for those changes to be reflected.
102
Another important trade -off to think about is scale.
103
If your website has a million pages, it'll be very slow and difficult to pre -render all of them.
104
That makes static generation most well -suited for data
105
that doesn't change often and for sites that have a relatively low number of total pages.
106
A good example would be a blog, because it might have a few hundred pages and those pages likely don't change on a daily basis.
107
Let's go ahead and take a look at how we might implement static generation in Next.
108
In the car component, let's imagine we need to fetch data from an external source, like a database or API.
109
To simulate that for the demo, I've added a couple of JSON files to the public directory.
110
We have a file that returns an array of IDs, then an individual response for each car,
111
which contains an image and other data about the car.
112
Now we can fetch this data for the car component by implementing the get static props function inside the component file.
113
When you build your site, Next will automatically call this function, then send the result as props to the component itself.
114
What we want to do here is fetch the JSON for an individual car
115
so it can be used in the HTML or UI for the car page.
116
In this case, we need the ID from the URL to know which car was requested.
117
We can get that information from the params argument in the function.
118
Then from there, we'll use the fetch API to make a request to localhost to request the JSON file with that ID.
119
We can then convert it to JSON.
120
Then the final step is to return an object that has a props property, where each prop can then be accessed by the component.
121
Up in the component code, we can destructure the car prop and then use it in the JSX,
122
which I'm doing here by adding an image tag, which relies on the data fetched by the server as the image source.
123
Now if you're concerned about search engine optimization,
124
you likely want to add an SEO -friendly title as well as meta tags to the head of the document.
125
Next makes that very easy to accomplish by simply importing the head component.
126
Anything inside this component will be rendered out to the head of the document.
127
Like in this case, we add a title with the car color and ID.
128
And we could also add meta tags for Twitter and Facebook cards if we wanted to.
129
Now because we're working with a dynamic route, there's one other thing we have to keep in mind.
130
And that's the fact that
131
Next has no way of knowing how many pages we actually have associated to a dynamic route.
132
In order to pre -render all the car IDs, Next needs to know those IDs in advance.
133
And the way we provide that information is by implementing the get static paths function.
134
This function can also request data from an API or database,
135
then its job is to return a paths object that contains an array with every route for this dynamic URL.
136
In this demo, we only have three routes, Tesla, Ford, and Lambo.
137
We map those values to an array of objects, then return them from the function, along with additional options like the fallback behavior.
138
Now if we go visit the app in the browser.
139
we should see a fully rendered web page.
140
It doesn't look any different than a regular React app.
141
However, if you open up the Sources panel in Chrome DevTools, it'll show you the fully rendered HTML before it was touched by JavaScript.
142
Notice how it contains the title and pre -rendered content, which is essential for SEO and sharing content on social media sites.
143
So that's how you implement server -side generation.
144
But another big strategy is server -side rendering.
145
The big difference is that with SSR, the content is generated on a server when requested by the user.
146
This approach is ideal when data changes constantly
147
because it ensures the end user will always get the latest and greatest data from whatever your data source happens to be.
148
However, it's far less efficient because you need to have a server in place to respond to those requests,
149
as opposed to caching everything on a global CDN.
150
Imagine something like an eBay auction where you have millions of listings and those listings are changing all the time.
151
That's probably a good candidate for SSR.
152
In any case, it's very easy to implement a Next.
153
Back in our page file, we'll go ahead and implement another function called getServerSideProps.
154
The only thing that actually changes in our code is the name of the function.
155
We can simply copy the body of the getStaticProps function and paste it into our new function.
156
It does the exact same thing, but does it on every request instead of at build time.
157
Then we can comment out getStaticProps and getStaticPaths because we no longer need those functions.
158
But the real beauty of Next is that we can apply both of these paradigms wherever we want in the application.
159
We're not limited to one or the other.
160
I'm going to go ahead and wrap things up there.
161
If there's anything you want to see in my full
162
Next course, make sure to let me know in the comments.
163
Thanks for watching, and I will see you in the next one.

Download App

Everything you need to speak fluently

AI PronunciationScore every sentence
IPA PracticeMaster every sound
VocabularyBuild your word bank
Vocab GameLearn while playing

Same Channel

FOR YOU

Recommend Video

Vocabulary and speaking notes for this lesson

This speaking lesson is built on the video “Next.js in 100 Seconds // Plus Full Beginner's Tutorial”. The speaker keeps coming back to these words: page, component, file, server, route. This video has 163 sentences and 2418 words to shadow. The speech runs for 11:49. The speaker talks fast, about 205 words per minute, so expect linked and reduced sounds. Only 80% of the words are among the 3,000 most common in English, so the vocabulary is demanding.

Key vocabulary in this video

15 words from the video worth learning, with pronunciation and meaning:

WordPronunciationMeaning
render verb/ˈɹɛn.dɚ/To cause to become.
component noun/kəmˈpoʊ.nənt/A smaller, self-contained part of a larger entity. Often refers to a manufactured object that is part of a larger device.
server noun/ˈsɝvɚ/A program that provides services to other programs or devices, either in the same computer or over a computer network.
fetch verb/fɛt͡ʃ/To retrieve; to bear towards; to go and get.
implement verb/ˈɪmpləmənt/To bring about; to put into practice; to carry out.
react verb/ɹiːˈækt/To act in response.
directory noun/dɪˈɹɛktəɹi/A list of names, addresses etc, of specific classes of people or organizations, often in alphabetical order or in some classification.
static adjective/ˈstæt.ɪk/Unchanging; that cannot or does not change.
dynamic adjective/daɪˈnæm.ɪk/Changing; active; in motion.
prop noun/pɹɑp/An object placed against or under another, to support it; anything that supports.
define verb/dɪˈfaɪn/To determine with precision; to mark out with distinctness; to ascertain or exhibit clearly.
browser noun/ˈbɹaʊ.zəɹ/One who or which browses.
default noun/dɪˈfɔlt/The condition of failing to meet an obligation.
export noun/ˈɛks.pɔɹt/Something that is exported.
generate verb/ˈd͡ʒɛn.ə.ɹeɪt/To bring into being; give rise to.

Phrasal verbs you will hear

WordPronunciationMeaning
go ahead verb/ˌɡoʊ əˈhɛd/To proceed with; to begin.
open up verbTo open.
point out verbTo identify among a group of similar subjects, or in a scene where the subject might not be readily seen or noticed, with a gesture of the body.
come up with verbTo manage to produce, deliver, or present (something) by inventing, creating, thinking of, or obtaining it.
follow along verbTo continue behind or beside an animal, person, vehicle or other object, especially as a companion.
go back to verbTo stem from; to originate in.
set up verb/ˌsɛt ˈʌp/To make ready for use.
take over verbTo assume control of something, such as a business or enterprise, and sometimes by force.

Grammar in this video

The structures the speaker uses most, with the exact words from the video:

StructureIn the video
Passive voice be + past participle — the focus is on what happens, not who does itis rendered · is not reliably indexed · can be easily cached
Relative clauses who / which + clause — extra information about a person or thingJanuary, which will · file, which is · export, which is
Present perfect have/has + past participle — a past action that still matters nowhas been · I've added · have associated

Pronunciation to watch

The speaker uses 25 contractions and reduced forms, such as we'll, doesn't, I'm. Say them the short way, as you hear them.

  • The “sh” and “zh” sounds: cache /kæʃ/, efficient /ɪˈfɪʃənt/, congratulations /kənˌɡɹæt͡ʃəˈleɪʃ(ə)nz/, sheet /ʃit/, shell /ʃɛl/
  • Long words — get the stress right: directory /dɪˈɹɛktəɹi/, interactive /ˌɪn.tɚˈæk.tɪv/, congratulations /kənˌɡɹæt͡ʃəˈleɪʃ(ə)nz/, fundamental /ˌfʌn.dəˈmɛn.təl/, navigation /nævɪˈɡeɪʃən/

How to practise with this video

  1. Listen to the whole video once without speaking and note the words you do not know.
  2. Start at 0.75× speed, shadow it sentence by sentence, then go back to normal speed once it feels easy.
  3. Record yourself and compare with the original, paying attention to words like render, component, server.

What is the Shadowing Technique?

Shadowing is a science-backed language learning technique originally developed for professional interpreter training and popularized by polyglot Dr. Alexander Arguelles. The method is simple but powerful: you listen to native English audio and immediately repeat it out loud — like a shadow following the speaker with just a 1–2 second delay. Unlike passive listening or grammar drills, shadowing forces your brain and mouth muscles to simultaneously process and reproduce real speech patterns. Research shows it significantly improves pronunciation accuracy, intonation, rhythm, connected speech, listening comprehension, and speaking fluency — making it one of the most effective methods for IELTS Speaking preparation and real-world English communication.

Shadowing technique: read the full step-by-step guide →