Directory tree structure

Below, there's a picture of the project's development tree, with a high level description of what you can find in each level. Note that in the tree itself, there are README files at various levels which describe the content of the directories in more detail.

  + -- bin/
  + -- lib/LedgerSMB/
             +-- Scripts/
  + -- old/
     + -- bin/
     + -- 
  + -- sql/
     + -- changes/
     + -- modules/
        + -- test/
     + -- coa/
     + -- upgrade/        
  + -- UI/
     + -- lib/
     + -- css/
     + -- js/
     + -- js-src/
  + -- doc/
     + -- database/
  + -- t/
     + -- data/
     + -- var/
  + -- xt/


This directory contains a series of *.pl files used when you run LedgerSMB in CGI mode. Depending on the type of code they forward to, they either forward to scripts in the bin/ directory or the LedgerSMB/Scripts directory. These scripts are up for removal as soon as we stop supporting the CGI mode of operation in favor of supporting PSGI only.

t/ & xt/

These are the directory with test scripts. Note that the database tests depend on the scripts in the directory sql/modules/test/. Further instructions will be found in the README in this directory. Test initialization data can be found in t/data/.

The t/ directory holds tests that can be executed during installation of the software to verify correct operation of the software with the specific set of dependencies.

The xt/ directory holds much more extensive tests which are being used during the development process; tests in this category include: completeness of documentation, correctness of syntax and checks that require extensive testing environment setups (such as Travis CI or similar).





This directory contains all the "library" code that LedgerSMB uses, with a special role for the Scripts/ directory. Library code used solely for testing the application can be found in t/lib/.


This directory contains the scripts which contain the "entry points" used by the web application to trigger application events. These entry points are nothing more than defined subroutines which take a request record as an argument. Scripts in this directory depend on templates in UI/ to define the generated HTML response.

olb/bin & old/lib/LedgerSMB/

These directories contains Perl scripts and modules which need phasing out (mostly inherited from SQL Ledger). Minimal adjustments are being made to these scripts with a preference for rewriting functionality. Scripts in this directory generally mix code with string litterals to build their HTML response.

This is code that one should touch only with extreme caution.


This directory contains the base schema definition file Pg-database.sql and a few subdirectories in which all SQL and PL/pgSQL code is organized.

sql/modules/ and sql/modules/test/

These directories contain pairs of equally named *.sql files. Each file contains the PostgreSQL code (stored procedures, types, triggers, but not tables -- tables are part of the base schema and thus in Pg-database.sql).

The file LOADORDER in sql/modules determines in which order the schema files should be loaded in order for files to be able to build on each other.


This directory contains SQL schema migration scripts that need to be run to upgrade the SQL database schema from one version to another.


This directory contains SQL scripts to initialize various localized charts of accounts.


This directory contains scripts used to convert various versions of LedgerSMB and SQL Ledger to the current version of LedgerSMB.


This directory holds templates (processed by Template Toolkit, one of Perl's most well-known templating engines); the templates are fed with parameters set up by the code in LedgerSMB/Scripts/. Subdirectories exist for specific functionalities, such as those for and


Many repetitive components have been concentrated in a centralized repository of template building blocks. For form tags such as INPUT and SELECT, these are defined in UI/lib/elements.html; another regularly used component is dynatable.html; it's a component which generates table-layouts for various purposes. Next to template building blocks, this directory also contains Dojo-extensions used by the templates.


LedgerSMB uses the Dojo toolkit for its in-browser automation. This directory contains the subdirectories dojo/, dojox/ and dijit/ -- each a Dojo-provided hierarchy of Dojo classes and components.


Various collected documents; ranging from policy documentation and manual to notes for integrators.


This directory contains the database schema documentation in various forms (PDF, HTML, dot, neato, ...).