Coder Social home page Coder Social logo

cliftonc / express-mvc-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
272.0 12.0 50.0 733 KB

Application template for a structured Node.js, Express, [Sequelizer in devel, Mongoose in master/Mongoose Branch], EJS & JQuery Application

Home Page: http://cliftonc.github.com/express-mvc-bootstrap/

JavaScript 92.51% CSS 7.49%

express-mvc-bootstrap's Introduction

THIS PROJECT IS NO LONGER MAINTAINED, TRY THIS ONE: https://github.com/niftylettuce/eskimo

Express MVC Bootstrap

A MVC boilerplate for Express.js

Description

I built this application to create a template MVC style app that I could then use as the start point for further development. I used the excellent examples in the main Express github repository, specifically the MVC example, as the starting point. I have however changed it quite substantially to make it clearer and remove some of the magic that confused me at first when learning. If you are familiar with other MVC frameworks hopefully my file structure makes some sense.

Requires

You need to manually install:

  • Node.js: Amazing javascript asynchronous IO library, install manually.
  • MongoDB: NoSQL Database, install manually.
  • NPM: Node package manager, used to install the remaining.

And then install via NPM:

  • Express: Application Framework for Node.js
  • Mongoose: Node.JS ORM for Mongo
  • ejs: EmbeddedJS Templating
  • cluster: extensible multi-core server manager
  • log: Tiny logger with streaming reader
  • connect: High performance middleware framework
  • mime: A comprehensive library for mime-type mapping
  • qs: querystring parser
  • expresso: TDD framework, light-weight, fast, CI-friendly
  • should: test framework agnostic BDD-style assertions
  • socket.io: The cross-browser WebSocket

But I've included in this project:

Installation

  • Install node.js
  // on osx with brew
  brew update
  brew install node

  // build from source
  git clone git://github.com/joyent/node.git
  ./configure
  make
  make install
  • Ininstall mongodb
  // on osx with brew
  brew update
  brew install mongodb

  // create db folder
  mkdir -p /usr/local/db/

For more installation detail please see this

  • Install npm
curl http://npmjs.org/install.sh | clean=no sh
  • Install required packages
  // install executable package globally
  npm install express-mvc-bootstrap -g

  // make project folder and go to that folder
  mkdir /path/to/project
  cd /path/to/project

  // install packages locally to be `require();`
  npm install socket.io should mongoose log cluster expresso qs mime ejs connect express express-mvc-bootstrap

Setup

  • In you project folder run
  // create app 
  eb create-app

  // running mongodb
  mongod --dbpath /usr/local/db/

  // running server
  eb

Commands:

  // Shows help
  eb script

  // Wrapper for 3 commands below
  eb script generate-all HelloWorld

  // Creates a model
  eb script create-model HelloWorld 

  // Creates a controller
  eb script create-controller HelloWorld

  // Creates views
  eb script create-view HelloWorld

  // Creates tests
  eb script create-test HelloWorld

  // Runs server on different port
  eb server server.port=3000

  // Creates a new app
  eb create-app

TODO:

Build some amazing apps!

express-mvc-bootstrap's People

Contributors

ashokgelal avatar ben-lin avatar cliftonc avatar srod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

express-mvc-bootstrap's Issues

Slow templating engine

Why EJS out of all templating engines. I would use doT, or at the very least underscore templates "underscore = bloat". EJS is slow and is going to be the biggest bottle neck in your boilerplate. Dont get caught up on other functionality like helpers and stuff for templating either its not needed, I tried about every js templating engine out there Dot can do everything you need it to do and nothing you dont.

http://jsperf.com/ejs-vs-dot

This isnt even the precompiled. Once I moved to dot precompiled all my apps are fast they scream right now you have one of the most important pieces to be fast super slow. Other than that good work on the boilerplate.

http://jsperf.com/template-without-precompile/8

template engine chooser

typos in README

Thank you for creating such a helpful resource, seriously. This is hugely helping me get more into node.js. I found two minor typos in the readme:

type one:

  • npm install express-mvc-bootsrap

(should be 'bootstrap'...)

  • npm install express-mvc-bootstrap

typo two:
eb sever server.port=3000

(should be 'server')

eb server server.port=3000

lack of error log on 500 error

When error on 500, there is no error msg on the page nor in the error log.
It might be better to add a log in app.js with 500 error.

eb - command not found

probably being very thick, the project does not work on latest versions of node, but i love the setup of it so am trying to replciate a few elements in a new project.

From project directory typing ed = command not found. Is it dependent on another plugin or module I may have not setup, possibly that would be installed with npm install express-mvc-bootstrap?

Thanks for any assistance

windows mvc is showing blank page.

Hi,

I am new to node and mvc. I tried to install node windows version and used ryppi to install all the dependencies now I could able to run all express and its examples correctly. Now how to run eb command on windows command prompt? I could not find equivalent command for eb in windows XP How run this file. Please help. I like the structure and even 404 and 500 links are working correctly. Please give a solution for windows too.

regards
Sridhar DK

Need a way to enable the node --debug

I've only been at this for a very short time, so perhaps there is a way. Looking over the eb.js code, it doesn't look like there is thou. In fact, this may not be possible at this time. If so, is there an alternate way to load up the app.js directly from 'node' so I can append the --debug flag?

This project seems outdated? Start using Expressling!

Hello!

I see we have some overlap with a boilerplate for Node.js --

In addition to being compatible with node 0.6.3, Expressling is kept up to date and contains a full MVC-style framework with routes/views/auth/db/sessions.

If possible, could your watchers/contributors help to merge options/features with Expressling?

We plan to continually improve and stay updated with Expressling :-).

Hop over to #expressling in Freenode and we can have a chat!

package dependency problem on npm 1.0+

With npm 1.0+ it separates packages to global and local.
If we install modules globally than they can not be found on require.
If we install modules locally than we can not use the *bin file ex. eb

Even if we install express-mvc-bootstrap both in local and in global
It still does not work. Because all the dependent packages will be installed under express-mvc-bootstrap,
suck as cluster, express... etc.

Therefore I manually installed all the dependent packages locally to get express-mvc-bootstrap to work

404 becomes 500

when we visit some url does not exist, it shows 500 instead of 404
I think it is the same problem as issue #7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.