Skip to content

carrot/parm-genie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parm-genie

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 (include Marionette.ItemView, Marionette.CompositeView, etc.)
    • /views: Templates to be compiled and output.
    • /templates: Templates to be precompiled via roots-client-templates
  • app.coffee bootstraps the entire app; App is added of the window 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 in routes.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
    • 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.
  • 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
    

License