Design Guide

Design Architecture

The design of KForge mostly follows Martin Fowler’s Patterns of Enterprise Application Architecture, along with Eric Evans’s Domain Driven Design.

Design Summary

KForge has a command line interface (CLI), and application programming interface (API), and a Web user interface. Internally, these interfaces are supported by a presentation layer, which depends on the KForge domain model.

The domain model depends on an event notification system to propagate domain model events to the active plugins.

The persistence layer maps values between the domain model and the database.

+----------------------+    +---+    +------------------+   +----------------+
|Command Line Interface|    |API|    |Web User Interface|   |Service Handlers|
+--------------+-------+    +-+-+    +------+-----------+   +-+---------+----+
               |              |             |                 |         |
               |              |             |                 |         |
               |              V             |                 |         |
               '---->+------------------+<--'                 |         |
                     |Presentation Layer|                     V         |
                     +-----+-- ---------+-->+-------------------+       |
                           |                | Access Controller |       |
                           |              --+-------------------+       |
                           V             /                              |
              +----------------------+<--   +------------------+        |
              |  Domain Model Layer  |----->|Event Notification|        |
        ------+----------+-----------+<-    +---------+--------+        |
        |                |              `.            |                 |
        V                V                `.          V                 V
+----------+    +-----------------+         `-+---------------+    +---------+
|Filesystem|    |Persistence Layer|           | KForge Plugin |    | Service |
+----------+    +--------+--------+           +----------+----+    +--+------+
                         |                               |            |
                         V                               V            V
                  +--------------+                    +-----------------+
                  |Database Layer|                    |  Plugin System  |
                  +--------------+                    +-----------------+

Command Line Interface (CLI)

KForge has a command line program for setup and maintenance of KForge sites.

$ kforge-admin --help

There is a command line program for creating new KForge configuration files.

$ kforge-makeconfig --help

There is also a command line program for unit-testing a KForge service. Don’t unit-test a production service, and don’t use a unit-tested service later as a production system. Instead, create a new separate temporary service configured with ‘system mode’ of ‘development’, check KForge functionality is in order on your platform, discard the temporary service, and then create a new service for use in production (possibly with migrated data).

$ kforge-test --help

Application Programming Interface (API)

The API is forthcoming.

Web User Interace

The Web user interface supports both administration and user access.

Domain Model Layer

The highlighted core includes Person, Project, Member, Plugin, and Service.

The access control sub-domain model includes Action, ProtectionObject, Role, Permission.

Plugin System

A major aim in developing the KForge core has been to support a good plugin system.

Plugins have access to all KForge APIs. They also are notified of events by the DOM’s event notification system. KForge services will be provided as plugins. All KForge tools will be provided as plugins.

Persistence Layer

The persistence layer maps domain model values into the persistence model.

Database Layer

The database layer maps the persistence model into a storage device.

File System

A KForge service has various folders and files:

KForge configuration folder and file.

etc/kforge.conf

Static media for Web interface.

media/

HTML templates for Web interface.

templates/

Folder for executable programs.

bin/

Folder for WSGI scripts.

wsgi/

Folder for CGI scripts.

cgi/

Code library folder.

lib/

Writable folder.

var/

Auto-generated Apache configuration file.

var/http-autogenerated.conf

KForge log folder and files.

var/log/kforge.log

Project data folders.

project/
project/{project-name}/
project/{project-name}/{plugin-name}/
project/{project-name}/{plugin-name}/{service-id}/