The Crucible Framework

The ideas and software design for Effluency 2.0 are coming together.

Effluency 2.0 will use a site framework dubbed Crucible, which will consist of areas, where each area will consist of a specific kind of communication medium. Areas will include such media as: user profiles, blogs, discussion forums, chat, private studios (for fiction writing, digital painting, game design), galleries (for publication/general viewing from each user’s private studio), clubs (multi-session long-term chat, private and public), game rooms (for on-line game play including tournaments), services (dice rollers, dictionaries and other tools).

The Software Architecture

The browser interface with the site will be made via Javascript calls to URLs of FastCGI scripts. FastCGI scripts are scripts that continue to run in between web browser accesses in order to handle many page requests over time efficiently. For instance, each request to a Ruby CGI script involves the process initialization of the Ruby interpreter, the execution of the script code and the shutdown of the interpreter. For FastCGI scripts, the Ruby interpreter is initialized once and the script continues to run until it has been idle (no incoming browser requests) for some time. This methodology removes the repeated initialization and shutdown execution times of the interpreter and focuses the time spent on the script logic itself.

The scripting engine consists of the following:

index.fcgi
Index.fcgi is a server-side Ruby/FastCGI script which will serve as the front-end login, user registration and site navigation script. Site navigation will be made across different areas of the site.
services.fcgi
Services.fcgi is a server-side Ruby/FastCGI script which will serve inter-area Ajax service requests from the browser. Once a user, via their browser, enters a particular area, navigation within the area will be made via Javascript rerendering of the page with data collected via Ajax service requests to services.fcgi
ServiceManager.rb
ServiceManager is a server-side Ruby class which is included within the services.fcgi script. It will receive the XmlCGI request from the user’s browser via the services.fcgi script and shall parse the request, authenticate it against the requested service’s contract, pass the request to the requested service and format the service results for transmission back to the user’s browser via the services.fcgi script. Additionally, ServiceManager will maintain a pool of database connection handles and a pool of service objects to grant requests.
DBRegistry.rb
DBRegistry is a server-side mixin module which is included by the ServiceManager class. DBRegistry contains the database configuration parameters required for the services as well as the DBRegistry.connect function. DBRegistry requires the mysql module to handle the low-level connection logic.
ServiceContract.rb
ServiceContract is a server-side Ruby mixin module which will be included in each individual service definition. This module will contain the authenticate function which will correctly parse the incoming function request and compare is against function contract parameters supplied by each individual class via their @contracts variable.
SystemService.rb
SystemService will provide system-level services to user requests. Among the services provided will be a listing of available services as well as a listing of available functions for each service.
DebugService.rb
DebugService is a test service which provides three functions: Ping, Echo and ReverseEcho.
DHTML.js
DHTML.js is the Javascript module which will contain the necessary logic to read from and write to web page controls as well as handle the re-rendering and manipulation of web page elements.
Ajax.js
Ajax.js will provide the necessary Javascript logic to make and receive requests to the server’s services.fcgi script.
SystemService.js
SystemService.js is a Javascript module which will contain the necessary request formatting to handle calls to the server’s SystemService functions.
DebugService.js
DebugService.js is a Javascript module which will contain the necessary request formatting to handle calls to the server’s DebugService functions.

Other services will be provided by MyService.rb / MyService.js code pairs. As each area of the site will be maintained by service calls, future services will be ForumService, ProfileService, ChatService, etc.

The File Architecture

The site shall initially be organized according to the following file system folders:

public
The public folder shall contain all the user-accessible files of the site. No sensitive information, such as database connection passwords, shall be contained herein. The FastCGI scripts shall be found here.
public/js
All Javascript modules shall be found in this subdirectory.
public/images
All images pertaining to the site shall be found here.
public/user
All Internet-accessible user materials, such as profiles and blogs, shall be located in the folder tree under this location.
services
All service-oriented Ruby classes shall be in this folder away from the public eye.
lib
All non-service Ruby module code used by the site shall be in this folder.
user
All private user data, such as avatars, clip art, artistic works in progress, shall be in the folder tree under this folder.
galleries
All site-published works, such as works of fiction or other art work, shall be stored in the folder tree under this folder. Works published here will not be accessible to the Internet at large.
games
All site-published games and associated materials shall be stored in a the folder tree under this folder. Works published here will not be accessible to the Internet at large. Materials shall consist of such static items as reference materials, graphics, maps as well as such dynamic items as scenario states, character states and other game play data.

Comments are closed.