1
00:00:02,000 --> 00:00:04,000
Now let's start with step number one

2
00:00:04,000 --> 00:00:06,000
in this lecture.

3
00:00:06,000 --> 00:00:08,000
Let's double check our code

4
00:00:08,000 --> 00:00:11,000
and verify that we're happy with it.

5
00:00:11,000 --> 00:00:14,000
Now for this I'm back in this blog project

6
00:00:14,000 --> 00:00:17,000
which we worked on in the last course section.

7
00:00:17,000 --> 00:00:19,000
If you didn't follow along there,

8
00:00:19,000 --> 00:00:22,000
you find my latest snapshot attached.

9
00:00:22,000 --> 00:00:27,000
Just be aware that the MongoDB credentials I'm using here,

10
00:00:27,000 --> 00:00:28,000
won't work for you.

11
00:00:28,000 --> 00:00:32,000
This is my cluster and I invalidated this user

12
00:00:32,000 --> 00:00:34,000
and its password after recording this course.

13
00:00:34,000 --> 00:00:38,000
So you will need to bring your own MongoDB database

14
00:00:38,000 --> 00:00:40,000
and your own connection string

15
00:00:40,000 --> 00:00:43,000
to make that API route work.

16
00:00:43,000 --> 00:00:44,000
Other than that you can continue

17
00:00:44,000 --> 00:00:47,000
with what I shared here as an attachment.

18
00:00:47,000 --> 00:00:50,000
And therefore, now we want to double check this setup

19
00:00:50,000 --> 00:00:52,000
and see if we're happy with it.

20
00:00:52,000 --> 00:00:56,000
Now, of course, such a validation is an ongoing process

21
00:00:56,000 --> 00:00:59,000
and you will always find improvement potential,

22
00:00:59,000 --> 00:01:03,000
but generally what we have here shouldn't be too bad.

23
00:01:03,000 --> 00:01:07,000
We are, for example, already using Nextimage.

24
00:01:07,000 --> 00:01:11,000
So the optimized images in all the places

25
00:01:11,000 --> 00:01:13,000
where we are working with images,

26
00:01:13,000 --> 00:01:15,000
even in our post contents.

27
00:01:15,000 --> 00:01:19,000
Even there we make sure that images

28
00:01:19,000 --> 00:01:23,000
that are part of our posts are rendered with Nextimage.

29
00:01:23,000 --> 00:01:26,000
And that is a great optimization

30
00:01:26,000 --> 00:01:29,000
because that loads images only when they are needed.

31
00:01:29,000 --> 00:01:34,000
It loads them lazily, and it also shrinks them in size.

32
00:01:34,000 --> 00:01:36,000
Now, speaking of lazy loading,

33
00:01:36,000 --> 00:01:41,000
that also is a concept we know in general in React,

34
00:01:41,000 --> 00:01:45,000
and most prominently when working with just React,

35
00:01:45,000 --> 00:01:49,000
without NextJS, you might want to lazy load your routes.

36
00:01:49,000 --> 00:01:52,000
So that the code for a given page

37
00:01:52,000 --> 00:01:56,000
is only downloaded if you're visiting that page,

38
00:01:56,000 --> 00:02:00,000
and it's not downloaded if you not visit the page.

39
00:02:00,000 --> 00:02:03,000
The great thing here is that NextJS

40
00:02:03,000 --> 00:02:06,000
has this kind of lazy loading built in.

41
00:02:06,000 --> 00:02:08,000
You don't need to worry about it.

42
00:02:08,000 --> 00:02:11,000
Your different pages, which we have here,

43
00:02:11,000 --> 00:02:13,000
are already lazy loaded.

44
00:02:13,000 --> 00:02:16,000
So the code for them is only fetched on demand,

45
00:02:16,000 --> 00:02:18,000
when we visit a page.

46
00:02:18,000 --> 00:02:20,000
So that built-in lazy loading

47
00:02:20,000 --> 00:02:23,000
is a very nice feature to have.

48
00:02:23,000 --> 00:02:25,000
Now regarding the metadata, which we should add.

49
00:02:25,000 --> 00:02:28,000
I'm happy with the amount of metadata, like title,

50
00:02:28,000 --> 00:02:33,000
and this description tag I added in the last course section.

51
00:02:33,000 --> 00:02:35,000
Of course, there is more you might want to add.

52
00:02:35,000 --> 00:02:38,000
Favicons, images which are displayed

53
00:02:38,000 --> 00:02:42,000
if you share a page through Facebook or Twitter.

54
00:02:42,000 --> 00:02:44,000
So these little preview images and so on.

55
00:02:44,000 --> 00:02:46,000
These are all extra kinds of data

56
00:02:46,000 --> 00:02:49,000
you could add into your head section,

57
00:02:49,000 --> 00:02:52,000
but for this demo here for this project,

58
00:02:52,000 --> 00:02:54,000
the current amount of metadata which we added,

59
00:02:54,000 --> 00:02:56,000
is fine for me.

60
00:02:56,000 --> 00:02:59,000
And therefore at the moment, I'm happy with that code.

61
00:02:59,000 --> 00:03:01,000
I think it should be fine

62
00:03:01,000 --> 00:03:03,000
but we will soon revalidate this

63
00:03:03,000 --> 00:03:05,000
by doing a test build, of course.

64
00:03:05,000 --> 00:03:09,000
Nonetheless, for the moment let's move on to the next step.

