Skip to content
Application template for a structured Node.js, Express, [Sequelizer in devel, Mongoose in master/Mongoose Branch], EJS & JQuery Application
JavaScript CSS
Find file
Pull request Compare This branch is 37 commits behind master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
conf
controllers
lib
models
public
scripts
utils
views
.project
README
app.js
package.json

README

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 (https://github.com/visionmedia/express) 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.

NOTE: I've now configured this to work as an npm package, but can't npm publish (still trying to figure out why it won't let me auth).  You can follow the  commands below, but then run 'npm install' in the root.  This will then install it as a library, and give you access to the scripts via the command 'eb' (express bootstrap).  

It depends on:

You need to manually install: 

* http://nodejs.org/ Node.js: Amazing javascript asynchronous IO library, install manually.
* http://www.mongodb.org MongoDB: NoSQL Database, install manually.
* http://npmjs.org/ NPM: Node package manager, used to install the remaining.

And then install via NPM:

* http://expressjs.com/ Express: Application Framework for Node.js
* http://mongoosejs.com/ Mongoose: Node.JS ORM for Mongo

But I've included in this project:

* http://embeddedjs.com/ EJS: Embedded Javascript Templating Library
* http://jquery.com/ jQuery: Javascript Library
* http://jqueryui.com/ jQuery UI: UI Library
* http://taitems.tumblr.com/post/482577430/introducing-aristo-a-jquery-ui-theme jQuery Aristo Template: Fantastic looking jQuery UI Template.

TO RUN:

* Install all the dependencies above.
* Clone project somewhere (e.g. /var/www/express-mvc-bootstrap)
* Run: npm install
* Go to a nice clean folder
* Run 'eb create-app'
* Run 'eb'
* browse to http://localhost:3000

NOTE ON BOOTSTRAP AND SCRIPTS:

* I have now created a simple scripting wrapper, it can be accessed via 'eb script' once you have installed the library via npm.
* You can use it to create simple models, controllers and views, based on the templates stored in /scripts/templates.
* You can also generate-all to rapidly roll out a simple MVC flow to use as a base.

TODO: 

* I need to add a proper github pages site for it, with a tutorial of how to use it to setup a new application.
* EJS is currently embedded in the lib folder, this should either be a submodule or installed via npm (didn't work for me via npm)
* DONE - I'd like to write scripts that can be run to enable creation of 'template' Models, Controllers & Views (like Grails)
* Write some amazing apps?!
Something went wrong with that request. Please try again.