Now that we know why the code
should execute on the backend,
let's come back to what we'll build.
We're going to build a blog, a basic blog website
where we can navigate around and view all the blog posts,
view a single blog post, added a blog post,
create new posts, and also delete an added blog posts,
and therefore, we're going to have
to complete CRUD functionality on this demo website.
We will see how we can add sequel code to create blog posts,
to read, and update, and delete blog posts,
but I will say that for this demo website,
all these operations will be exposed to all visitors
of that website.
That of course might not be super realistic.
You might have some visitors, some administrators
who are allowed to update, delete, and create blog posts,
and then the other visitors should maybe just
be allowed to view the blog posts,
but since we haven't learned about authentication,
and different types of visitors yet,
we're going to unlock all the features
to all the visitors right now,
since in this core section,
we wanna practice working with a database
with a sequel database to be precise.
Later in the course, we are also going
to explore authentication,
and how we can deal with different types of users
who should have different privilege,
but in this section, we're going to focus
on the database part, and therefore,
what we are going to do in this core section,
and what you typically always are going to do
when working with a database in your website,
we first of all will plan and design our database structure,
and the tables we wanna have in there,
and which fields, which columns we wanna have on the tables,
and which data types we wanna use for the different columns.
These are the things we're going to start with.
Once we derived the structure we wanna have,
we're going to continue, and we're going
to create that database, and the tables we wanna have,
and we're going to do that with my sequel work bench,
since this is a one time task,
which should not be done by our website.
Instead, our website should interact
with the finished database,
and the initialized tables,
and therefore, we are going to do this administrative task
ahead of time one time with my sequel work bench
once we plan our database.
Then once the database was created,
and our tables were created,
we can also still with my sequel work bench,
add some initial data to that database.
Maybe so that we have some starting data
for the first visitors of our website,
or maybe because we have some data
that can't be managed through the website,
but that instead will always be managed
through some global administrator,
and then once all that setup work is done,
we're going to right code in Node.js
that allows the Node Express application
we're going to build to connect to that database,
and to run queries against that database,
and even though that's only one of these four steps,
that's of course the step we're going
to spend most of our time on in this core section,
but let's start with the first steps,
and let's first of all plan, and create our structure,
and our tables before we then see
how Node.js is able to interact with the database.