Learn how to blueprint a web application before starting development to get organized, to solve problems, and to free Your mind for coding. Walk through the blueprint for building a content management system (CMS).
- [Instructor] We will begin creating our database driven project by learning how to blueprint an application. The web application that we're going to be building is a Content Management System. Or CMS, for short. The idea is to have private webpages which administrators can use to create and edit website content. But the public has different pages where they can read the content but which are not editable. An essential first step when beginning any web project is to create a project blueprint. If the site is simple, you may be able to simply type up a few notes or draw a picture on a single piece of paper.
If your site's complex, you may need page mock-ups and flowcharts to keep track of everything. The fundamental idea, in either case, is to take what's in your head and to put it on paper. So that you can look it over and assess it before you start your work. It helps you to clarify the work that's ahead. And forces you to think about problems that you might otherwise have put off until you were well down the road with your development. I usually do my blueprinting by getting out pen and paper and drawing boxes to represent different parts of the site. I draw connections between the boxes and I make notes and details that I don't want to forget.
By the end, I have the full picture in front of me. And I don't have to hold all the moving parts in my head anymore. Instead, I can use that part of my brain for development. I also don't have to try and build the whole site all at once. I can begin to tackle it piece by piece. Moving through it in a methodical fashion. I can also tack my blueprint up on the wall in front of me. So that I can refer to it constantly as I'm developing. It's efficient and it's liberating. So let's begin our blueprint for our Content Management System.
We know that we're going to need to have two areas. The Public Area and the Admin Area. The Public Area is going to be fairly simple. The pages are all going to have a similar page structure. An area for navigation, like a menu of content, and then an area to view that page content. So users will pick a navigation item and then the PHP page that loads will show that pages content. Pick a new navigation item, get new page content. For the Admin Area, I know that I'm going to need to start with a login page. Where we can ask admin users to provide a user name and password to authenticate themselves and gain access.
That'll keep the public out. If they log in successfully, then we'll take them to an admin menu page. This is a simple landing page that lists the options in the admin area. Those options are just links to those other pages. The menu choices will be manage content, manage admins, and logout. In the manage content area, I want to divide our website content into two parts. Subjects and pages. So the webpage content will be stored on pages but then those pages are going to be grouped by their subject.
We'll see an example of this in just a moment. Next, we'll need a section to maintain the admin users. That is the users who can access this admin area and use the CMS to update content. And, of course, the final menu option is going to be, simply, logout. Which will perform that action of logging us out of the admin area. In this course, which is part one of a two part series, we're going to focus on building the Admin Area section that allows us to manage page content. Our subjects and our pages. This is going to give us an opportunity to learn how to interact with the database and to create new records, read existing records in the database, edit those records and delete records.
Then, in part two of this course, we'll build on those fundamentals of database interaction to complete our Content Management System. So that completes the blueprint of our application architecture. Let me show you some examples so that you'll have a better idea of where we're headed. This is what the public facing version of our website is going to look like. At the moment, these are just simple HTML pages. You can see that we have the name of our fictitious website, Globe Bank International, up at the top. And then we have a navigation over here that allows us to select different subjects that we might want to view the content for.
We also get a default homepage that's here. If we click About Globe Bank, you'll see that it loads up the About Globe Bank page. This is a page content below the subject. We also have History, Leadership, Contact Us, and so on. And each one of these subjects has different pages that are listed underneath it. So, again, this is our navigation. This is our page content area. So that's what we're going to be building on the public side, eventually. What we're going to be building in this course is going to be the Content Management System portion that'll allow us to manage this page content.
Here's an example of what that might look like. So here's an example of the Staff Area that we're going to be building in this course. Now there is no login or logout at the moment. We don't have any admin users, there's no passwords or anything like that. We're going to be building all of that in part two. We'll learn about user authentication. We'll learn how to password protect all this content. For this course, we're going to be focused exclusively on how we interact with the database. So that we can manage the content of our subjects and our pages. So let's click on Subjects to get an idea of what that looks like.
When I click on Subjects, you'll see I get a list of the subjects that are in the database. Notice this is PHP, it is pulling content from the database. And I'm getting a list of all the subjects that are currently in the database. It's reading those back and displaying them. Then I also have the ability to view detail on any one of those. I'll click View. And you can see I get a detailed view about what's in each one of those records. I also have options for editing. Or, I'll go back, I have an option for deleting. If I want to delete the content.
There's also an option up here for creating a new subject. If I want to add a new subject to the database as well. So those are the basic ways we're going to interact with this content. We're going to do it for both subjects and, also, for our page content. Now that we have an overall understanding of what we're going to be creating, let's get started by creating the beginnings of our project.
- Organizing project files
- Including and requiring files
- Working with URL parameters
- Encoding dynamic content
- Modifying headers and page redirection
- Creating forms and processing form data
- MySQL basics
- Using PHP to access database tables
- Creating, reading, updating, and deleting database records with PHP
- Validating data
- Preventing SQL injection