Kallithea internals overview

Mads Kiilerich mads at kiilerich.com
Wed Feb 18 22:21:43 EST 2015


On 01/29/2015 11:50 AM, Thomas De Schampheleire wrote:
>
> Let me give this a try. It's not very structured, but it could become
> better when the picture is more complete.

Some replies here, some in the other mail ...

> Frontend:
> ---------
>
> URLs are connected to actual code using pyRoutes, configured at
> config/routing.py.

No, it primarily uses the Python routes mapper 
http://routes.readthedocs.org/en/latest/ on the server side.

On the client side there is an extended pyRoutes implementation that 
tries to implement the routes URL creation functionality so we can 
create URLs from javascript on the client side.

> The code that is called is part of controllers, but how to
> define/describe a controller?

routing.py contains references to the right controllers and they are 
found with "introspection".

> Templates (kallithea/templates) define the core of the user interface.
> They intermix regular HTML with Javascript code (plain Javascript or
> frameworks like jQuery, YUI, (others?)).

It also use other javascript libraries. YUI is being removed.

> The templates are parsed
> using the 'mako' template library. Data regarding
> commits/repositories/... is loaded dynamically from the server through
> AJAX calls.

Sometimes, yes. In that case it also use templates. But I would say that 
most of the time the data come as a part of the html of the page.

> Question: what is the reasoning to both use jQuery and YUI? Can't we
> select one framework and do everything in that?
> Answer: according to the wiki 'future' list, YUI should be killed in
> favor of jQuery.
>
> Related question: a bird told me that it may be better to use a
> higher-level framework like AngularJS instead of directly scripting
> stuff either in plain Javascript or jQuery. Has there been any thought
> about this before?
>
> On the 'future' list, I see "move code from templates to controllers
> and from controllers to libs or models". Can you clarify this a bit
> more?
>
> Question: how is the relation between the REST API (controllers/api)
> and the AJAX calls? Is the API used internally in some way, or only
> provided for external usage?
>
> The codemirror JS library (http://codemirror.net/) is used to display
> code files.
>
> The mergely JS library (http://mergely.com) is used to display diffs
> of code. Mergely is based on codemirror.
>
> fontello is a library/service to create a font of symbols (instead of
> using icons in image files). Did we create our own font or are we
> using an existing one?
> 'font awesome' is a specific symbol font. How does it relate to fontello?
>
> pygments: syntax highlighting
>
> formencode: form validation
>
> excanvas?
>
> mousetrap?
>
> native.history.js?
>
>
> Backend:
> --------
>
> Revision information is obtained from the VCS library (lib/vcs), which
> in case of Mercurial interacts directly with the Mercurial python
> classes, and in case of git uses the dulwich python module.
>
> models: this is a class representation of the database tables. Which
> framework/component handles the relation between these classes and the
> actual database? I guess using SQLAlchemy? How does this relate to
> Django?

Yes, it uses SQLAlchemy.

I think django has its own ORM but it might also be possible to use alchemy.

> pylons: web framework, but what exactly does it do?
> On the 'future' list, I see: 'more best practice for web apps and the
> frameworks', can you clarify a bit more?

It is mainly to figure out exactly which parts of it we are using, what 
it is doing, and consider if there could be better alternatives.

It is a big stack with lots of things to learn.

> paste: ?
>
> bcrypt: password hashing
>
> celery: distributed task queue  (how is this used?)
>
> whoosh: code indexing/search
>
> Question: what is all this WSGI stuff? If you start Kallithea
> according to the base instructions, it's hosting it's own web
> interface (without WSGI?) How does WSGI work, what are the
> advantages/disadvantages? Related to this, I see people running
> Kallithea under Apache, advantages/disadvantages?
>
>
> Thanks,
> Thomas



More information about the kallithea-general mailing list