Discuss and provide feedback on the pattern (here) and Parse (here). (please!)
This is an demonstrative app (live) built using the PARM (PArse, Roots, Marionette) stack and based on this wireframe.
It demonstrates an experimental convention for developing PARM apps heavily inspired by rails.
-
The app is architected in a strict MVC pattern.
├── assets │ ├── css │ ├── img │ └── js │ ├── models │ └── views │ ├── controllers │ ├── app.coffee │ ├── boot.coffee │ ├── config.coffee │ ├── routes.coffee ├── templates ├── views ├── app.coffee ├── package.json ├── readme.md
- /js:
- /models:
Parse.Object
classes. - /controllers: Objects with methods (actions) to direct the app once a route is hit (instantiate a view, save a
Parse.Object
) - /views:
Backbone.View
classes (includeMarionette.ItemView
,Marionette.CompositeView
, etc.)
- /models:
- /views: Templates to be compiled and output.
- /templates: Templates to be precompiled via roots-client-templates
- /js:
-
app.coffee bootstraps the entire app;
App
is added of thewindow
object on instantiation. -
boot.coffee requires the dependencies and instantiates the app.
-
Routes are defined in routes.coffee like so:
"controller": "routes/to/action": "action"
The app will instantiate a router for each controller and store it in
App.Routers
.Of note: controllers are stored in
App.Controllers
only if they are defined inroutes.coffee
. -
Configuration settings are defined in config.coffee.
-
The app provides a few helper methods available in the
App
object:- App.Template() to grab a precompiled template. Using App.Template is much like using
_.template
; it includes the following helpers by default:- config:
App.Config
- current_user:
App.User
- route:
App.Route
- config:
- App.User() to grab the current user via Parse.
- App.Route(controller, action) to grab a route via its controller and action.
- App.Go() to redirect to an action.
- App.Template() to grab a precompiled template. Using App.Template is much like using
-
The app is structured with rails-inspired nomenclature and folder hierarchy.
├── controllers │ ├── photos.coffee ├── models │ ├── photo.coffee └── views └── photos ├── index.coffee ├── new.coffee └── photo.coffee
- Details on the license can be found here.