Skip to content

Instantly share code, notes, and snippets.

@voter101
Created August 18, 2014 22:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voter101/a57ef67d84245b1d9d6c to your computer and use it in GitHub Desktop.
Save voter101/a57ef67d84245b1d9d6c to your computer and use it in GitHub Desktop.
Our file structure per single mini-application:
app_starter.js.coffee
--- app_directory
--- app.module.js.coffee
--- backend.module.js.coffee
--- components
--- component_file1.module.js.coffee
...
--- domain.module.js.coffee
--- glue.module.js.coffee
app_starter - we got one per each application. It is code like this:
#= require_tree ./app_directory
App = require('app_directory/app')
$('[data-app=appFromAppDirectory]').each ->
window.app = new App(@)
window.app.start()
app - starting point of application. Here we initialize every component of application
backend - here we fetch and send data to backend. It is also a place, where we create domain objects
components - our React.js components, we use to render an application.
domain - definitions of domain objects used in view. Example: immutable list of single entries (which are domain object too).
glue - hexagonal.js glue
Further reading for hexagonal.js: http://hexagonaljs.com/
Also, we use data streams from RxJS: https://github.com/Reactive-Extensions/RxJS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment