blob: 34a92b411bb23db01b820e9489cadd151a59796f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
---
layout: page
title: Directory structure
---
# Alaveteli's directory structure
<p class="lead">This page gives you an overview of where to find things in Alaveteli's
directories.</p>
**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](/docs/customising/).
<!-- (and if you do,
remember to read the page about [feeding your changes back](/feeding-back)).-->
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](http://guides.rubyonrails.org/getting_started.html).
## Key directories and what they're for
<dl class="dir-structure">
<dt>
app
</dt>
<dd>
<p><em>the core Alaveteli application code</em></p>
<dl>
<dt>
assets
</dt>
<dd>
<em>static assets that require precompilation before being served</em>
<dl>
<dt>
fonts
</dt>
<dt>
images
</dt>
<dt>
javascripts
</dt>
<dt class="last">
stylesheets
</dt>
<dd class="last">
<p><em>stylesheets in CSS or <a href="http://sass-lang.com/">SCSS</a> format.</em></p>
<p>SCSS stylesheets are compiled to CSS.</p>
</dd>
</dl>
</dd>
<dt>
controllers
</dt>
<dt>
helpers
</dt>
<dt>
mailers
</dt>
<dt>
models
</dt>
<dt class="last">
views
</dt>
</dl>
</dd>
<dt>cache
</dt>
<dd><p><em>cached files for downloads, attachments and templates.</em></p>
</dd>
<dt>
commonlib
</dt>
<dd>
<p><em>mySociety's library of common functions</em></p>
<p>
We maintain a <a href="https://github.com/mysociety/commonlib">common
library</a> that we use across many of our projects (not just
Alaveteli). This is implemented as a <a
href="http://git-scm.com/book/en/Git-Tools-Submodules">git submodule</a>,
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 <em>do</em> need to change anything here, be aware that
it is a separate git repository.
</p>
</dd>
<dt>
config
</dt>
<dd>
<p><em>configuration files</em></p>
<p>
The primary configuration file is <code>general.yml</code>. 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.
</p>
</dd>
<dt>
db
</dt>
<dd>
<p><em>database files</em></p>
<dl>
<dt class="last">
migrate
</dt>
<dd class="last">
Rails' migration (updating the database scheme up or down
as the code develops).
</dd>
</dl>
</dd>
<dt>
doc
</dt>
<dd>
<p><em>documentation</em></p>
<p>
These are technical notes. This is in addition to the <a
href="http://code.alaveteli.org/docs/">core documentation</a> — which
you are reading now — which is actually stored in the git
repository in the <code>gh-pages</code> branch, and published as GitHub
pages.
</p>
</dd>
<dt>
lib
</dt>
<dd>
<p><em>custom libraries</em></p>
<dl>
<dt>
tasks
</dt>
<dd><a href="http://guides.rubyonrails.org/command_line.html#rake">Rake</a> tasks.
</dd>
<dt class="last">
themes
</dt>
<dd class="last">This is where your Alaveteli theme lives.
</dd>
</dl>
</dd>
<dt>
locale
</dt>
<dd>
<p><em>translations (internationalisation/i18n)</em></p>
<p>
The translation strings are stored in <code>.po</code> files in directories specific to
the locale and encoding. For example, <code>es/</code> contains the translations for the Spanish site.
</p>
</dd>
<dt>
log
</dt>
<dd>
<p><em>application log files.</em></p>
</dd>
<dt>
public
</dt>
<dd> <p><em>static files that can be served directly.</em></p>
</dd>
<dt>
script
</dt>
<dd>
<p><em>server-side shell scripts</em></p>
<p>
For example, <code>alert-overdue-requests</code> for running the script
which finds overdue requests and mails them out.
</p>
</dd>
<dt>
spec
</dt>
<dd>
<p><em>tests</em></p>
<p>
Alaveteli's test suite runs under <a href="http://rspec.info/">rspec</a>.
</p>
</dd>
<dt>
tmp
</dt>
<dd>
<p>
<em>temporary files</em>
</p>
</dd>
<dt class="last">
vendor
</dt>
<dd class="last">
<p><em>third-party software</em></p>
<dl>
<dt class="last">bundle</dt>
<dd class="last">
<p>
<em>the bundle of gems needed to run Alaveteli</em>
</p>
</dd>
</dl>
</dd>
</dl>
We've missed out some of the less important subdirectories here just to keep
things clear.
|