Route66 Design Documentation

Architecture

The Route66 project falls into a number of different architecture categories. A Python script is used to convert the currently existing content to an independent, newly developed database-driven system. The reading content is generated dynamically at request time by a PHP script which retrieves the data from a MySQL database. There are also separate MySQL-driven components for managing user accounts and creating/editing reading content. These components allow the user to perform different tasks – ranging from creating content to adding/deleting students to creating new admins – depending on that user’s permissions. A generalized system architecture is provided (General Architecture). For detailed flow charts of the system’s capabilities, see the available flowcharts (Super Admin Flow Chart, Admin Flow Chart, Teacher Flow Charts).

Database

The database has been set up to support more features that are to be implemented in the future. The characteristics of the database are described in the database documentation (Database Documentation). The database's host, the user's login and password, and the database ($db_host, $db_user, $db_password, $db_db respectively) all must be provided to the Route66 system during setup in common/dcconnection.php.

Objects

Links to important objects can be found in the 'objects' subfolder. The main object files are bookObject.php and userObject.php. factoryObject.php is used to select the appropriate object within userObject.php to return based on the login information. factoryObject.php follows the factory design pattern. All variables of the objects within objects directory have getter/setter methods to manipulate their variables. When the system is eventually migrated to PHP5, the variables within these classes should become type private to ensure proper encapsulation.

Design Decisions

We choose to implement this system to rely heavily on encapsulization. All data which is passed between classes and functions have object types. This design was chosen to simplify the code for future additions/modifications.

Deployment

To deploy Route 66, there are four key steps.

  1. Copy the source to the destination.
  2. Copy the mysql dump to your mysql host
  3. In the source for Route66, change the variables in file /common/dbconnection.php to reflect your mysql host
  4. Log into the system as a SuperAdmin with the login: Administrator password: password. After logging in, you can click 'Edit Info' to change the password.

Adding Features

One key feature that should be easily implemented is the Super Units. Super Units are collections of Units. The database is already set up so that Units are assigned to Super Units through a foreign key in the unit table to an entry in the superunit table. You will also need to add a table for the assignment of super units to administrators. This will set up a rights based system in which certain administrators (and their sub-users) will have access to certain super units.

General Directory Structure

Other features should follow the convension of being seperated into sub-directories to keep the code clean and easily readable. Rendering of pages, for example, is contained in the render subdirectory of Route66. The code for managing users is contained in the users directory. Furthermore, common files used by multiple scripts are contained in the common subdirectory. Additionally, the stories directory contains all files for managing stories, units, etc. Content approval is contained in the control directory.

Class Documentation

/common
common.php
controlheader.php
dbconnection.php
dblibrary.php
dblibraryBookObject.php
footer.php
general.php
header.php
layout.php
loginheader.php

/control
contentapproval.php
index.php

/login
retrievePassword.php
index.php

/logout
logout.php

/objects
userObject.php
factoryObject.php
bookObject.php

/render
bookselect.php
renderbook.php
rendermenu.php
typeselect.php

/stories
bannerwindow.php
browseimages.php
contentapproval.php
createstory.php
createunits.php
insertpage.php
insertquestion.php
managestories.php
manageunits.php
previewimage.php
selectimages.php
uploadbanner.php
uploadimage.php

/users

editinfo.php
index.php
manageadmins.php
managestudents.php
manageteachers.php