UNPKG

2.87 kBMarkdownView Raw
1# Arthus
2--------
3
4A solid framework for building webapps.
5
6## Goals
7
8* All pieces should be separated and decoupled. Everything should be easily
9 testable. That means no globals or anything.
10* A common pattern for controllers and helpers.
11* Framework should be separated from the actual app.
12* A great view layer.
13* Utilize streams where possible.
14* Fast, of course.
15* Include client-side framework.
16* Great support for rich JavaScript client applications.
17* Easy to profile and benchmark.
18* Centralized logging.
19* Follow Node patterns.
20* Great for developement.
21
22## Implementation
23
24How to reach each of the goals.
25
26### Decoupled and separated parts
27
28Different parts of the application will always require some kind of
29configuration. Instead of putting the configuration in a global location,
30each part gets the configuration passed on instantiation.
31
32This can be done automatically by mapping the configuration section to the
33name of the object that needs variables.
34
35### Common pattern for object
36
37By defining strict rules for how object constructors may look this can be
38generalized.
39
40### Framework separation
41
42By writing the framework itself as a separate project we can further force
43ourselves to separate app logic from framework logic.
44
45### Great view layer
46
47Each controller should return a view object. The view object is an object
48that defines how a page should be rendered. The framework will then inspect
49this object and render it and pass it to the browser.
50
51During AJAX requests this view object can be serialized to JSON and sent to
52the browser for rendering on the client.
53
54### Utilize streams
55
56The view layer could possibly be abstracted to work with streams in some way.
57
58### Client side framework
59
60On the client side there should be a router layer that correctly invokes the
61controller for the current page.
62
63The view objects from the server should be made to work on the client.
64
65View objects defines a target for how it should be rendered. For incremental
66requests (like endless scrolling) they can set a selector and wether the
67result should be prepended or appended to the target.
68
69The client side should support single page applications where supported by the
70browser. Pages should be stored in the DOM to make jumping back and forth a
71breeze.
72
73### Easy to profile
74
75I believe this is achieved by writing clear, separated logic. Hooks and events
76will have to be provided for this kind of functionality to sit outside the app.
77
78### Centralized logging
79
80The application should provide a simple way of doing logging. Runtime
81configurations can then be made to decide where the log messages are sent.
82
83### Follow Node patterns
84
85Callbacks should all do error first. All that good jazz.
86
87### Great for dev
88
89Keep convention over configuration for stuff like folder structure etc.
90Provide scaffolding methods for creating models, helpers, controllers etc.
91