root / veekun / trunk / README.pod

Revision 424, 5.2 kB (checked in by eevee, 5 months ago)

Removed timed_exec in favor of the Time::Out module. (#289)

Line 
1=pod
2
3=head1 INTRODUCTION
4
5Welcome to the veekun codebase!  This is the magical mystical melting pot of
6Perl that somehow keeps http://veekun.com running.
7
8=head1 GETTING STARTED
9
10For the most part, this code should run as-is with very little setup.  However,
11there are two dependencies you will need to take care of first: Perl modules
12and the database.
13
14=head2 Perl Modules
15
16You will need the following modules installed to run this code.  This list is
17not exhaustive, as I am typing it off the top of my head and making no effort
18to confirm it whatsoever.
19
20    Catalyst
21    Catalyst::Model::DBIC
22    Catalyst::Model::DBIC::Schema
23    Catalyst::View::TT
24    Catalyst::Plugin::Authentication
25    Catalyst::Plugin::Authentication::Store::DBIC
26    Catalyst::Plugin::ConfigLoader
27    Catalyst::Plugin::Session
28    Catalyst::Plugin::Session::State::Cookie
29    Catalyst::Plugin::Session::Store::DBIC
30    Catalyst::Plugin::Unicode
31    DBIx::Class
32    DBIx::Class::QueryLog
33    DateTime
34    Email::Valid
35    Image::Size
36    JSON
37    List::MoreUtils
38    List::Util (part of Scalar-List-Utils)
39    String::Approx
40    Template
41    Time::Out
42    XML::Feed
43    YAML
44
45Additionally, you may want the following modules if you plan to do any heavy
46development.
47
48    Catalyst::Devel
49    Catalyst::Plugin::StackTrace
50    Catalyst::Plugin::Static::Simple
51
52=head2 Database Setup
53
54All you need to do is create a database (or even reuse an old one, as long as
55you aren't worried about naming clashes) and load each of the .sql files in the
56script/ directory, as described below in L<script/>.  The F<base_data.sql> file
57contains very minimal test data; enough to ensure every page will display.  A
58dummy administrator login of C<admin:password> is included; I suggest you not
59leave it there any longer than necessary.
60
61I have been using MySQL and have not tested the code on any other database, but
62as long as you change the database driver in vee.yml and manage to import the
63table definitions, any other database should be fine.
64
65=head2 File Setup
66
67If you want to generate the downloads at L</dex/resources>, run the script
68F<script/create_downloads.pl>.  You will need to have tar, gzip, ImageMagick,
69and pngcrush available.
70
71=head2 Running
72
73The easiest way to get veekun on the Web is just to run F<script/vee_server.pl>
74(although you may have to manually use perl; the shebang line was generated on
75a Windows box).  This will start the built-in Catalyst server on port 3000.
76
77=head1 CODE LAYOUT
78
79=head2 lib/
80
81All of the actual site's Perl code is stashed in here, arranged as normal for a
82Catalyst app.  The main namespace is C<Vee::>.  Controllers (i.e. the bulk of
83the code) are under C<Vee::Controller::>, a small View module that serves as a
84glue to Template Toolkit is in C<Vee::Controller::TT>, and class wrappers for
85database tables reside in C<Vee::Model::>.  C<Vee::Schema> is a tiny database
86glue class.  Other modules are extra bits of useful code that don't really fit
87the regular Catalyst structure.
88
89=head2 root/
90
91Root of the filesystem, where static files live.  As a general rule, anything
92static should go into one of the existing folders, to make it easier to run
93veekun without C<Static::Simple>.
94
95=head2 script/
96
97This folder contains scripts that are not actually part of the veekun code, are
98are not ever called by any veekun code, and are not actually necessary for the
99operation of veekun.  Since looking through all of them to find out whether or
100not they are necessary would be a colossal waste of time, their functions are
101documented here.
102
103=head3 dump_sql.pl and *.sql
104
105The Perl script is a simple wrapper around mysqldump that will produce a .sql
106file for some chunk of the database.  It will read database, user, and password
107information from the main Catalyst configuration file.  It can take table
108group names as arguments; the groups are rather clearly/obviously defined in
109the script if you are really curious. These .sql files are in the repository
110and are used to track the structure of the database.  The Pokedex script dumps
111all the table data, whereas the others only dump table structure; there is,
112however, some very minimal starting data in F<base_data.sql>.
113
114If you change the structure of the database, please remember to also run the
115corresponding dump script so that you can commit the change.
116
117=head3 vee_*.pl
118
119These are startup scripts generated by Catalyst for running the code under
120various engines.  C<vee_server.pl> is the Catalyst standalone server and best
121suited for development or testing.  The others are fairly self-explanatory, and
122the Catalyst documentation will tell you which one you need depending on which
123engine you are trying to use.
124
125=head2 static/
126
127Static Template Toolkit templates that are used when a URL with no matching
128controller is requested -- i.e., a request for F</a/b/c> with no controller
129named C<A> will try to return F</static/a/b/c.tt>.  If no static template is
130found, of course, the client will get a 404.
131
132=head2 t/
133
134Auto-generated Catalyst tests.  I haven't written any real ones of my own yet
135because I am a terrible person.  I am sorry; maybe I will get around to it
136sometime.
137
138=head2 templates/
139
140Template Toolkit templates.  More or less matches the URL structure, although
141not necessarily exactly.  There are a few 'include' templates, too, all named
142F<common.tt> or similar.
143
144=cut
145
Note: See TracBrowser for help on using the browser.