Differences between revisions 12 and 13
Deletions are marked like this. Additions are marked like this.
Line 35: Line 35:
 1. '''mapps''' - Master Application Payment System Application source code
 1. '''v2''' - V2 application code
 1. '''skeleton''' - Skeleton Application source code
 1. '''proto-ds''' - Darren Starsmore prototype
 1. '''''TODO''''' '''mapps''' - Master Application Payment System Application source code
 1. '''''TODO''''' '''v2''' - V2 application code
 1. '''''TODO''''' '''skeleton''' - Skeleton Application source code
 1. '''''TODO''''' '''proto-ds''' - Darren Starsmore prototype
Line 61: Line 61:
echo 'Short one-line description of new-name project' > Description echo 'Short one-line description of new-name project' > description

V2 High Level Design Notes

Introduction

This section contains notes for the design and implementation of V2, in particular notes about how to use the technology stack.

Ruby On Rails Resources

On-Line Reference Material

  1. Rails API documentation - http://api.rubyonrails.org

  2. Rails Guides - http://guides.rubyonrails.org

Books

  1. Ruby on Rails 3 Tutorial, by Michael Hartl - A beginning book with an emphasis on automated unit and integration testing with RSpec

  2. The Rails 3 Way, by David H. Hansson - An advanced book with in-depth descriptions of most Rails related topics

    1. Section 11.20 - Internationalization using the I18n Ruby GEM

    2. Chapter 14.2 - Authentication using Devise
    3. Chapter 18 - RSpec

Source Code Management

  1. Use git

Repositories

  1. Server: git.softxs.ch
  2. Directory: /home/bit/gitroot

  1. TODO mapps - Master Application Payment System Application source code

  2. TODO v2 - V2 application code

  3. TODO skeleton - Skeleton Application source code

  4. TODO proto-ds - Darren Starsmore prototype

  5. sample-app-ah - Alan Hodgkinson sample_app source code, from Hartl book

Creating a New git Repository

  1. Repositories should have the suffix .git

  2. Repositories should have group git and be group writable

The following example shows how to make a new git repository named new-name

  • ssh git.softxs.ch
    
    cd /home/git/gitroot
    
    mkdir new-name.git
    chgrp git new-name.git
    chmod g+w new-name.git
    
    cd new-name.git
    
    git init --bare --shared
    
    echo 'Short one-line description of new-name project' > description
    
    vi config
    # add the following
    [gitweb]
       owner = Your Name

Pushing a git Repository to the Git Server

This needs to be done once to transfer your local repository to the git server.

Do the following from the root directory of your local git repository.

  • git remote add origin user@git.softxs.ch:/home/git/gitroot/new-name.git
    git push origin master

Use of Branches

  • TODO describe conventions for using branches

Application Services

Logging

  1. Use Log4R

Application Configuration

  1. Use rails_config

  2. For more about Rails application configuration:

Authentication

  1. Use Devise

  2. Consider the following supporting modules:
    1. CanCan - Integrates with Devise and provides useful authentication functions that can be used in .erb templates

    2. OmniAuth - Which probably supports logins via Google+, Facebook, etc.

  3. General discussion of Rails recurity
  4. Other references:

JavaScript Libraries

Ruby on Rails uses unobtrusive JavaScript, which makes use of custom HTML attributes for binding HTML elements to JavaScript functions. This is done via special parameters to server-side calls to, which means that the you don't need to have script= attributes in your HTML.

  1. Use jQuery - For DOM manipulation

  2. Use Backbone.js - For managing client-side collections of records with REST synchronization to the server

  3. Use Underscore.js - Contains many useful general purpose utility functions. Required by Backbone.js

Internationalization

  1. Use I18n

Automated Unit and Integration Testing

  1. Use RSpec - A Ruby GEM for specifying unit and integration tests

  2. Use FactoryGirl - For generating test data

  3. Use: Faker - A Ruby GEM, for generating fake/sample test data

  4. Resources:
  5. RSpec test specifications should include the tracking system bug number (e.g. 'BUG-4765') in the test description. This allows the bug to be specifically tested for using the RSpec -e parameter. E.g. rspec spec -e 'BUG-4765'

Background Process (Event Daemon)

PDF File Generation

  • TODO

Application Architecture

  • TODO describe the division between MAPPS and V2

User Access Modeling

Definitions

  1. Library - an entity that contains multiple Projects

    1. A Library is the repository that manages user login, e.g. it authenticates users, typically via user login name and password (or LDAP, etc.)
      1. Contains a catalog of user names, login names and authorization information, e.g. encrypted passwords or links to LDAP or other authentication external authentication systems
    2. A Library does not contain user role information for individual projects
      1. Except that it is able to provide a list of links that jump to the home pages of the projects (in the library) that the user has access to
      2. If a user doesn't have any roles for a particular project, then they do not even see that the project exists
        1. This might be managed by a configuration variable, to allow implementation of a compeny-based systems which let all users see the names of all projects
  2. Project - an entity that contains user data, e.g. documents, revisions, tasks, etc.

    1. Each project must belong to exactly one library
    2. A project contains:
      1. Project metadata, stored in the project's database
        1. Including user access rights for all the project's users
      2. A set of files (revision files, correspondence files, ZIP files, etc.) stored in a directory tree
      3. The metadata database and files of a project are never mixed between projects. This is to:
        1. Ensure customer data privacy
        2. Make it possible to make individual project backups

Requirements

  1. A user has the same login credentials for all projects, he has access to, within a single library
  2. A library dictates the user authentication policy, e.g. how user logins are validated, for all the projects that belong to it
  3. A library has a landing page
    1. The landing page is the user login page for the all projects that belong to it
  4. A library has administrative transactions for defining and managing users
    1. There are library users that have library administrator roles

    2. The library configuration sets the login security policy, e.g. password length, frequency of password changes, etc.
      1. Initially this will be via configuration variables
      2. Later this might be managed by online transactions available to the library administrators
  5. Integrity of project metadata:
    1. All metadata for a project is stored in a single database
    2. Databases never contain metadata from multiple projects
  6. Projects can be migrated between libraries
    1. This will initially be done using a manual procedure, e.g. shell and SQL scripts
    2. Later this could be automated
  7. User roles for individual projects are managed within the projects
  8. There are users that have project administrator roles within projects

    1. A project administrator manages user roles for a project
    2. The project administrator role is limited the project it is associated with
    3. A user might have project administrator rights in multiple projects
  9. User roles for library and project administration do not include the ability to grant the roles to others, which are controlled by seperate grant library administrator and grant project administrator roles

V2HighLevelDesign (last edited 2013-01-15 15:22:22 by 10)

Copyright 2008-2014, SoftXS GmbH, Switzerland