From the course: PHP with MySQL Essential Training: 1 The Basics
Blueprint the application
From the course: PHP with MySQL Essential Training: 1 The Basics
Blueprint the application
- [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 web pages, 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 flow charts 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 of 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 tag 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 username 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 Managed content, Manage admins and Logout. In the Managed 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 performed the 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 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 log out 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, and 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. 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 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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.