Before you start on a project for a client, you need to give a quote (or estimate) and a deadline. To do this accurately you need to map out the project and what you will do.
Why plan projects?
Planning a project gives you an accurate time and price estimate, it also gives you guidelines on what to build during development. It can cut your development time by a large amount because you won’t have to worry about bad design. Lastly, there is nothing worse for a large application’s design then having a programmer who added as he went. Planning a project will make the overall design far better.
Is there a right or a wrong way to plan a project?
No. There is no best or worst ways to plan out a project. The contents of this article are what I have found works best for me. As you should do with all tips/tutorials you see, play around and find what works best for you.
Enough of the ever so interesting before talk, lets start planning! Each of these steps should build off the last. For example purposes, I will use a fictional image hosting site to map out.
Step 1. What is the project?
In plain English, outline what the sites general purpose is and all features. This should be confirmed by the client before you start to avoid errors.
ExampleThe purpose of this site is to safely and securely upload images to the server. Users can manage their uploaded image if they register and log in. Admins have complete and total access and can manage everyone’s images.
Step 2. In English, what are the functions this site would do.
This is where you in more detailed talk, go through all the features. You generally don’t need to show this or any further steps to the client. This step isn’t completely necessary if you are going to map the rest out in the same sitting. If you are going to have a pause in between this and the end of the next step, do this to save you the time of think it all up again.
Example Uploading –Basic html upload page followed by a php script to see if they are logged in the upload it accordingly.
Login –Basic html login page and a php script to log the user in. I can just use my pre-built user script for this
Register- Html page with a php script following it to register you. Part of the premade user script.
Management –If user is logged in, show all his images and give him the option to delete them.
Admin manage –A list of all images with the ability to delete
Step 3. What files would be used and what would they do
Working off of step 2, create a list of every file you will need.
Example System Class.php –Has the user and SQL cleaning class. The user class includes authentication for both users and admin.
Head.php –To be included on every page, logged you into the mysql server, includes
class.php and does other processes every page needs to do.
End User Index.php –The index page, all html besides the login page
Upload.php –The page that does the uploading from the form on index.php
Login.html –The login form
Login2.php –Actually log the user in.
Logout.php –Delete the user’s login cookie
Register.html –The regsister form
Register2.php –Actually register the user. Check for like username, mismatched passwords, ect.
Manage.php –Show a listing of all the user’s images and redirect them to the login page if they aren’t logged in.
Delete.php –Check if the image if belongs to user logged in (redirect to login page if logged out) and delete image if it is.
Admin Admin/manage.php –The admin management script, identical to the user’s management script, just remove the queries limitations and display them all.
Admin/searchuser.php –A text box to search for usernames
Admin/searchuser2.php –Searches users from serchuser.php, if no name is in the GET data, search everyone to have a member list without making an identical file. This has links to ban, make member or make admin any user (including other admins and yourself)
Admin/changeuser.php –Actually changes the user the way the admin requested
3.1 Database design (done at the same time)
While you are going though the files, compile your database design.
Example Table user Int id
Varchar name
Varchar pass
Int rank
Table images Int id
Varchar url
int user_ID
4. How much time with expected debugging would this take
You now have your database designed and your files mapped out, go to each file and assign how long it should take you, assign one fee for the database (that includes designing it here)
Example System Class.php –2.5hrs
Head.php –.5hr
End User Index.php –.5hr
Upload.php –1.5hr
Login.html + Login2.php + Logout.php –.5hr.
Register.html + Register2.php –1hr
Manage.php –1.5hrs
Delete.php –.5hr
Admin Admin/manage.php –.5hr
Admin/searchuser.php + Admin/searchuser2.php –2hrs
Admin/changeuser.php –1hr
That totals to 11hrs, you use that to give your quote or estimate to the client. The art of estimating how long a part will take is a tricky one. If you are not sure how long it will take, break the file into every part you can think of and think how long each part will take to code. If you simply don't know, estimate up. Chances are if you don't know how long it will take you (or exactly how to build it) you will have quite a fun time debugging the file.
When you start programming, you use what you made as a guideline to program your projects by. Go from file to file creating the script. When it is finished it should be almost exactly as you mapped it out.
Happy programming!