Skip to content
Alexey Gordeyev edited this page Aug 17, 2014 · 40 revisions

Back to Documentation

Table of contents

Create Default Application

      # Create application
      $ trinte -i HelloWorld     
      # intall dependencies              
      $ cd HelloWorld && npm -l install        

      # generate scaffold
      $ trinte -g crud User active:bool name email password
      # running server
      $ trinte -s                              

On initialization directories tree generated, like that

Create Application with Theme

Available 7 themes default, black, blue, green, orange, pink, violet. Default theme violet.

      # add `--theme` argument
      $ trinte -i HelloWorld --theme default

See themes here.

Create Application with Session

      # add `--sess` argument
      $ trinte -i HelloWorld --sess

Will be the following changes:

  • Add deps to connect-caminte module
  • Rewrite file /config/session.js code here

Create Application with Authorization

  $ trinte -i HelloWorld  --auth
  • Add deps to trinte-auth, passport and passport-local modules
  • Add file /config/authorization/local.js code here
  • Rewrite file /config/routes.js
var Auth = require('./authorization/local'); 

module.exports = function routes(map) { 

    // default login page
    map.all( "/login", "apps#login" );
    // default logout route
    map.all( "/logout", Auth.logOut( '/' ) );

    // add middleware 
    map.resources( "posts", {
        middleware: [Auth.isLoggedIn( '/login')]
    } );

});

Create Application with Uploader

  $ trinte -i HelloWorld  --uploader
  • Add deps to express-uploader, gm and node-uuid modules
  • Add file /config/addons/uploader.js code here
  • Rewrite file /config/routes.js
var Uploader = require('./addons/uploader');

module.exports = function routes(map) { 

    map.post('/uploading', Uploader.middleware());

});

Create Application with Recaptcha

  $ trinte -i HelloWorld  --recaptcha
  • Add deps to recaptcha module
  • Add file /config/addons/recaptcha.js code here
  • Rewrite file /config/routes.js
var Recaptcha = require('./addons/recaptcha');

module.exports = function routes(map) { 
    /**
     * recapcha middleware usage Recaptcha.middleware()
     **/
});

Create Application with Mailer

  $ trinte -i HelloWorld  --mailer
  • Add deps to nodemailer module
  • Add file /config/addons/mailer.js code here
  • Rewrite file /config/routes.js
var Mail = require('./addons/mailer');

module.exports = function routes(map) { 

    map.post('/sendmail', Mail.mailSender());

});

Back to Documentation

Clone this wiki locally