Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to plan my web based project before starting code? [closed]

Me and my friend started working together as partners , we have decided to make Kick-as* website after website. We have the ideas written down like 100's of them (yes we are choosing best and easy among them first).

My friend does the layout design and arranging things , and my part is coding and server management.

The little problem i am facing is lack of experience in planing a project. What i do is, I just start the code straight away and along with code I make DB, like when i need a table i make it.

I know this is very bad approach for a medium sized project.

Here at stackoverflow i saw lots of experienced coders. Need to learn a lot from you guys :) .

So can you plese help me on how to plan a project and what coding standard/structure/frameworks to be used (I do PHP code).

Thanks in advance.

like image 673
Arshdeep Avatar asked Feb 03 '23 04:02

Arshdeep


2 Answers

Start by defining the scope. Write a paragraph to a page and try to describe your website. A top-down approach would be to start thinking of functionality you'd like to implement and refining it by adding more detail.

A top-down approach (is also known as step-wise design) is essentially the breaking down of a system to gain insight into its compositional sub-systems. In a top-down approach an overview of the system is first formulated, specifying but not detailing any first-level subsystems. Each subsystem is then refined in yet greater detail, sometimes in many additional subsystem levels, until the entire specification is reduced to base elements. A top-down model is often specified with the assistance of "black boxes", these make it easier to manipulate. However, black boxes may fail to elucidate elementary mechanisms or be detailed enough to realistically validate the model. http://en.wikipedia.org/wiki/Top-down_and_bottom-up_design.

There are many other approaches, however.

http://en.wikipedia.org/wiki/Software_project_management#Software_development_process

Again, the most important step is to be able to put your idea in words; before you can adequately do that, I wouldn't even consider starting to write one line of code.

like image 178
Jan K. Avatar answered Feb 05 '23 18:02

Jan K.


Regarding coding standard/structure/frameworks I recommend zend framework coding standard, MVC structure, and Zend Framework.

A brief guide for a MVC architecture. The idea is tho help you remember ideas (while your brain is steaming code) and have documents for future programmers.

  • Design the database. Make an ER diagram. Put it in a document.
    Briefly describe reasons behind the design for the important issues (why you choose a polymorphic relation, why use this view, what selects you expect that are more trickey etc.). This will change as you code (and there is nothing you can do). Document the changes. To cope with the changes, use a versioning system for the database like rails migrations.

  • Design the structure of your website (sections, pages, links, page-flows etc.). Document it. (like: "the site 2 sections, this section is made of ..." etc.)
    Based on this make a document describing your controllers and views. ( "a controller for articles, with a list view, and article view, also edit and create views but just for admins" etc).
    Describe how you are going to enforce authentication and authorization (on controller and view level). Who is allowed where.
    Describe how you protect against the main web-attacks (xss, csrf) where required. (example: "i escape all my view variables using htmlentities for xss protection and ...")

  • Design your models and side functionality (sending emails, background jobs etc.). These will be the bulk of code. Document each and describe the main issues (for example how timezones are to be handled, how this certain model is to connect to the currency service, how that model is to parse and manipulate some crone file, what algoritm you shall use to decide top 5 articles, depending on your app.) Describe what libraries you use, how, and for what purposes (example: "we are to use curl to scrap SO and make rss feed")
    Describe how you protect against the main web-attacks where required (sql-injection, xss).

As you code, things change. Your knowledge about the discrete works of your system evolves and you start to improve the design based on the new found enlightenment. Document your changes.

like image 37
clyfe Avatar answered Feb 05 '23 17:02

clyfe