As with any system, it needs a structure, a foundation to be built upon, around, and within.

This system is not any different. In order to best support the ideas and concepts behind this “scaffolding” system, to best secure scripts and data, I have used the best (or so I think) approaches from the various Frameworks and have thrown in a few ideas of my own.

First of all, there needs to be 2 directories at the sibling level to your “public_html” (or htdocs) directory:

  • application
  • cache
  • html (or htdocs)
  • library

You may have others at this level, but they are not used by this structure.


This directory holds the HTML based (pseudo) templates and the control scripts. It also stores the global and local configuration files you may need for your application.

  • config – conf files for your application
    • local.ini.php – this is a standard ini file, it stores the user controlled config data
    • locale – application specific Bluewater translation files
      • en_US – Files in American English [default]
  • controller – the [C]ontrol part of MVC
    • index – central controller class
    • [section name] – controller class for this section
    • helpers – application specific Helper files
    • model – the [M]odel part of MVC
      • [database name] – name of database to use as defined in local.ini.php
      • [table name] – Database table name access class
    • view – the [V]iew part of MVC
      • Templates – display templates
      • [section name] – display pages for this section


This directory is used to house the class libraries that you may use. Both the ones from this collection and others. My ‘library‘ directory has:

  • adodb – An excellent open source db access library
  • FIPS – a class library to access “Federal Information Processing Standards” data
  • geshi – The code library for code highlighting.
  • bluewater – This library of classes
    • bluewater.ini.php – this is a standard ini file, it stores the Bluewater MVC specific system config data
    • bootstrap.php – File that sets up all the locations and pathing directions for the system
  • debug.php – a simple debugging tool


File caching files are placed here, secured against web access.

html (or htdocs)

This is your “web root”. Where all your web access pages reside. This directory should have a few child directories:

  • images
    • fileicons – a pseudo standard set of File Type Icons
    • smileys – a pseudo standard set of Smiley Icons
  • scripts – global Javascript files
  • styles – global CSS files

And if you want to utilize the Bluewater::Dispatch for an easier time of creating an MVC style app, then your going to have to use an Apache server (try this method for a windows solution) and activate Apache ”redirect” and then define a htaccess file. With this file, all URL requests will be channeled back to your index.php file for handling.