1
00:00:02,620 --> 00:00:04,370
Now that we know why the code

2
00:00:04,370 --> 00:00:05,950
should execute on the backend,

3
00:00:05,950 --> 00:00:08,119
let's come back to what we'll build.

4
00:00:08,119 --> 00:00:11,810
We're going to build a blog, a basic blog website

5
00:00:11,810 --> 00:00:16,370
where we can navigate around and view all the blog posts,

6
00:00:16,370 --> 00:00:19,450
view a single blog post, added a blog post,

7
00:00:19,450 --> 00:00:24,173
create new posts, and also delete an added blog posts,

8
00:00:25,140 --> 00:00:27,010
and therefore, we're going to have

9
00:00:27,010 --> 00:00:31,630
to complete CRUD functionality on this demo website.

10
00:00:31,630 --> 00:00:36,630
We will see how we can add sequel code to create blog posts,

11
00:00:37,190 --> 00:00:40,100
to read, and update, and delete blog posts,

12
00:00:40,100 --> 00:00:43,330
but I will say that for this demo website,

13
00:00:43,330 --> 00:00:47,500
all these operations will be exposed to all visitors

14
00:00:47,500 --> 00:00:49,430
of that website.

15
00:00:49,430 --> 00:00:52,820
That of course might not be super realistic.

16
00:00:52,820 --> 00:00:57,020
You might have some visitors, some administrators

17
00:00:57,020 --> 00:01:01,710
who are allowed to update, delete, and create blog posts,

18
00:01:01,710 --> 00:01:04,540
and then the other visitors should maybe just

19
00:01:04,540 --> 00:01:06,970
be allowed to view the blog posts,

20
00:01:06,970 --> 00:01:10,150
but since we haven't learned about authentication,

21
00:01:10,150 --> 00:01:12,960
and different types of visitors yet,

22
00:01:12,960 --> 00:01:15,290
we're going to unlock all the features

23
00:01:15,290 --> 00:01:17,260
to all the visitors right now,

24
00:01:17,260 --> 00:01:18,960
since in this core section,

25
00:01:18,960 --> 00:01:21,700
we wanna practice working with a database

26
00:01:21,700 --> 00:01:24,333
with a sequel database to be precise.

27
00:01:25,620 --> 00:01:28,150
Later in the course, we are also going

28
00:01:28,150 --> 00:01:29,920
to explore authentication,

29
00:01:29,920 --> 00:01:33,040
and how we can deal with different types of users

30
00:01:33,040 --> 00:01:35,330
who should have different privilege,

31
00:01:35,330 --> 00:01:37,330
but in this section, we're going to focus

32
00:01:37,330 --> 00:01:40,370
on the database part, and therefore,

33
00:01:40,370 --> 00:01:43,020
what we are going to do in this core section,

34
00:01:43,020 --> 00:01:46,450
and what you typically always are going to do

35
00:01:46,450 --> 00:01:50,040
when working with a database in your website,

36
00:01:50,040 --> 00:01:55,040
we first of all will plan and design our database structure,

37
00:01:55,390 --> 00:01:57,510
and the tables we wanna have in there,

38
00:01:57,510 --> 00:02:01,490
and which fields, which columns we wanna have on the tables,

39
00:02:01,490 --> 00:02:05,650
and which data types we wanna use for the different columns.

40
00:02:05,650 --> 00:02:08,000
These are the things we're going to start with.

41
00:02:08,919 --> 00:02:12,720
Once we derived the structure we wanna have,

42
00:02:12,720 --> 00:02:15,300
we're going to continue, and we're going

43
00:02:15,300 --> 00:02:19,660
to create that database, and the tables we wanna have,

44
00:02:19,660 --> 00:02:23,370
and we're going to do that with my sequel work bench,

45
00:02:23,370 --> 00:02:25,940
since this is a one time task,

46
00:02:25,940 --> 00:02:29,070
which should not be done by our website.

47
00:02:29,070 --> 00:02:31,300
Instead, our website should interact

48
00:02:31,300 --> 00:02:33,020
with the finished database,

49
00:02:33,020 --> 00:02:35,280
and the initialized tables,

50
00:02:35,280 --> 00:02:39,040
and therefore, we are going to do this administrative task

51
00:02:39,040 --> 00:02:43,000
ahead of time one time with my sequel work bench

52
00:02:43,000 --> 00:02:45,253
once we plan our database.

53
00:02:46,280 --> 00:02:48,840
Then once the database was created,

54
00:02:48,840 --> 00:02:51,400
and our tables were created,

55
00:02:51,400 --> 00:02:55,230
we can also still with my sequel work bench,

56
00:02:55,230 --> 00:02:58,800
add some initial data to that database.

57
00:02:58,800 --> 00:03:01,320
Maybe so that we have some starting data

58
00:03:01,320 --> 00:03:04,140
for the first visitors of our website,

59
00:03:04,140 --> 00:03:06,780
or maybe because we have some data

60
00:03:06,780 --> 00:03:10,240
that can't be managed through the website,

61
00:03:10,240 --> 00:03:12,950
but that instead will always be managed

62
00:03:12,950 --> 00:03:15,223
through some global administrator,

63
00:03:16,130 --> 00:03:19,550
and then once all that setup work is done,

64
00:03:19,550 --> 00:03:23,750
we're going to right code in Node.js

65
00:03:23,750 --> 00:03:27,170
that allows the Node Express application

66
00:03:27,170 --> 00:03:30,550
we're going to build to connect to that database,

67
00:03:30,550 --> 00:03:34,180
and to run queries against that database,

68
00:03:34,180 --> 00:03:37,730
and even though that's only one of these four steps,

69
00:03:37,730 --> 00:03:39,640
that's of course the step we're going

70
00:03:39,640 --> 00:03:42,963
to spend most of our time on in this core section,

71
00:03:44,050 --> 00:03:47,000
but let's start with the first steps,

72
00:03:47,000 --> 00:03:50,830
and let's first of all plan, and create our structure,

73
00:03:50,830 --> 00:03:53,120
and our tables before we then see

74
00:03:53,120 --> 00:03:56,633
how Node.js is able to interact with the database.

