Skip to content

Architecture Notes

Greg Slepak edited this page Jul 29, 2023 · 13 revisions

Front End

See: Getting started frontend documentation

CSS related

Outdated (but potentially still useful) stuff follows:

Folder structure

We're placing the actual "Group Income (Simple Edition)" app under frontend/simple/. This is where the real work is taking place.

The stuff in frontend/ (above frontend/simple/), is mostly ignored for now, and it could be anything really. It should be considered a "totally separate website/project" that represents the main homepage of groupincome.org (a separate github repo altogether, and currently they do not match).

For now, the browserify/webpack stuff is applied only to what's in frontend/simple/, and the stuff in there should not use nginx SSI (server-side includes). Instead it should use EJS's <%- include %> syntax to include things like headers/footers.

Dev stuff

Written in JavaScript ES7 (for async/await; no callbacks!), converted with Babel.

Uses Vue.js and (possibly) Cycle.js frameworks.

Vue.js Resources:

Cycle.js Resources:

Alternatively, we could go full Elm, but that seems a bit overkill and (at the moment) would hurt us more than it would help.

Build system

Although Browserify seems to have some advantages as far as Node compatibility goes, Webpack seems to be winning people's favor [1 2 3 4]. Since Webpack doesn't seem to have any major downsides, has received praise from various folks, doesn't require grunt/gulp, and because Vue.js recommends it.

EDIT: However, Webpack is turning out to be a real PITA for using with multiple .html files, so we might go with browserify after all. This article explains the general problem.

Why we went with browserify

To explore

Webpack + Babel + Vue resources:

Avoiding vue-router AKA using multiple .html files:

Sharing resources across app + .html files:

Testing

  • Backend tests are currently being done directly in Mocha
  • Frontend tests can use Nightmare and/or Karma (which the vue-cli webpack demo gives an example of)

Misc. Useful Things