So let's make a plan for our project here.
You saw what we built.
We built this online shop, this demo online shop,
which combines many features you'll learn about
throughout this course.
And to get there, what we'll need is a frontend with HTML,
CSS and browser side JavaScript.
And of course, a backend.
We're going to write the code for both ends,
but it's also not just about frontend versus backend,
but instead, we also have too many websites combined
in one and the same website you could say,
because we have the customer-facing sites or pages
and we have the administration pages,
and they're all part of the same overarching website.
But of course,
these are very different areas of this website.
They're only accessible to certain users.
Only administrators can visit the admin pages,
and they contain totally different features.
It's a difference if you are able to view products
and add them to a shopping cart,
or if you're able to add it or delete products,
and we're going to build all of that,
so there is tons of content in this section.
Now therefore, to plan this project,
let's maybe start by thinking about the different pages,
the views which we need.
I'm calling it views because in this course section,
we're going to use the MVC,
the Model View Controller pattern,
which you learned about in the previous course section.
And when it comes to the views,
the pages of this course project,
then, of course, we can differentiate
between the pages that are accessible to our customers
and the pages that are accessible to our administrators.
For both customers and administrators,
we'll have signup and login pages.
Those pages have to be accessible to both
because both customers and administrators
will need to log in.
Actually, customers don't need to log in.
They can browse products
and even add them to a shopping cart
without being logged in,
but administrators do need to log in to do anything
and customers do need to log in to finally make a purchase.
So we need these pages for both kinds of users.
But then we also have pages
that are exclusive to certain users.
For example, customers should be able to view
all the products and the details for a given product.
They should be able to add products to a shopping cart,
and then also view that shopping cart
where they can also edit the items in the shopping cart,
increase or decrease the number of items of a given product,
and customers have to be able
to view the orders they placed.
We also need a couple of other smaller views
like error pages or success or failure pages
after placing an order,
but I don't list those separately here
since they are rather trivial.
Nonetheless, we're going to add them
throughout this course section.
Now, for the administrator, there we have the dashboard,
the first page that's shown to an administrator
once you visit the administration area.
We then have the products page
where you can view all the products
that are currently offered in the shop.
And we then got pages for adding new products
or for updating existing products.
Last but not least, we also have an orders page
where you can view all the orders of all the users.
And there, you will also be able to update those orders.
Now, these are the pages
that are exclusively accessible by administrators.
And again, we're going to build all those pages together
step-by-step in this course section.
And these therefore are the main pages overall,
the main views which we'll create in this course section
and the main views we're going to work on.
Now, views, pages, aren't everything.
We're going to use the MVC pattern and therefore,
we should also think about the models we need.
And even if we would not use the MVC pattern,
we still would be working with some data
that needs to be stored in a database.
And we wanna plan those data entities,
these kinds of data we're going to work with ahead of time.
So which kind of data are we going to store there?
Well, we definitely need users,
both customers and administrators in the end are users,
the only difference is a little flag,
a little extra property
that makes users either administrators or not.
And therefore, for a given user
for this demo shop which we're building,
we wanna store the email of a user, a password,
then this isAdmin flag,
which controls whether a user is a regular customer
or an administrator.
And we also wanna store the name of the user
and the address information like the street,
the city, the postal code and so on.
So that in our fictional shop here,
we would be able to send goods to a given customer.
Now, besides users for this online shop,
we, of course, also need products.
And the idea here is simply that
we can store the name of a product,
a short summary text that shows up on the all products page,
then also the price of a product, the image of a product,
and the description
that's showing on the product details page.
We also want to allow users to add products
into a shopping cart
and therefore that is another data entity
with which we have to work.
Though you will see that throughout this course section,
this will be a special data entity
because we will actually not store carts
in a separate database table or collection,
but instead of our session,
and you'll see why we do this and how we do this
throughout this course section.
Now, this cart then, of course,
will store the items that are in the cart,
so the products that are in the cart,
and also the total price of all the items
and the number of items that were added.
And last but not least, of course, it's a shop,
and therefore customers should be able to convert a cart
into an order by buying the goods in a cart.
And therefore, we also need orders
and the order, in the end, is just a combination
of some user data describing the user who placed the order
and the product data, the cart data.
And then we can also add a date stamp
so that we know when the order was placed
and a status which could be pending, canceled, or fulfilled.
And that's this status which we can manage
in the administration area.
And these are the data models we are going to work with
throughout this course section.