Alaveteli’s directory structure

This page gives you an overview of where to find things in Alaveteli's directories.

You’ll probably never need to worry about this if you’re just installing Alaveteli – this is really more useful if you’re a developer planning on making more substantive changes to the code. You don’t need to be familiar with Ruby to install or make basic customisations to your installation.

Alaveteli uses Ruby on Rails, which is a common “Model-View-Controller” web framework — if you’re familiar with Rails this will look very familiar. For more information about the Rails structure see the Ruby on Rails website.

Key directories and what they’re for

app

the core Alaveteli application code

assets
static assets that require precompilation before being served
fonts
images
javascripts
stylesheets

stylesheets in CSS or SCSS format.

SCSS stylesheets are compiled to CSS.

controllers
helpers
mailers
models
views
cache

cached files for downloads, attachments and templates.

commonlib

mySociety's library of common functions

We maintain a common library that we use across many of our projects (not just Alaveteli). This is implemented as a git submodule, so Alaveteli contains it even though the code is separate. Normally, you don't need to think about this (because git handles it automatically)... but if you really do need to change anything here, be aware that it is a separate git repository.

config

configuration files

The primary configuration file is general.yml. This file isn't in the git repository (since it will contain information specific to your installation, including the database password), but example files are.

db

database files

migrate
Rails' migration (updating the database scheme up or down as the code develops).
doc

documentation

These are technical notes. This is in addition to the core documentation — which you are reading now — which is actually stored in the git repository in the gh-pages branch, and published as GitHub pages.

lib

custom libraries

tasks
Rake tasks.
themes
This is where your Alaveteli theme lives.
locale

translations (internationalisation/i18n)

The translation strings are stored in .po files in directories specific to the locale and encoding. For example, es/ contains the translations for the Spanish site.

log

application log files.

public

static files that can be served directly.

script

server-side shell scripts

For example, alert-overdue-requests for running the script which finds overdue requests and mails them out.

spec

tests

Alaveteli's test suite runs under rspec.

tmp

temporary files

vendor

third-party software

bundle

the bundle of gems needed to run Alaveteli

We’ve missed out some of the less important subdirectories here just to keep things clear.