Bootstrap 2.2.2 and Express 3.0.5 using Jade templates, and Passport authentication. We also use a few very helpful modules:
About this project
I needed a basic "starter kit" for Node. I like Expressjs, but was not familiar with Jade and wanted to learn it for templating. I also wanted a little continous integration so by using less middleware we will recompile the Less code "automagically" for us. In this way both Less and Jade code can be changed with the applciation running and the changes will be imemdiately reflected. Probably not best for production. ;)
Finally I wanted the ability to setup users. log them in and log them out. I chose Passport over Everyauth. I also wanted the users persisted in a database. Jared Hanson's Express 3 example misses the all important "register a new user" step so I wanted to build that out. In short, I wanted a fully operational launch point for an Express 3 project with working local authentication.
My longer term goal is to add facebook and twitter strategies but local will almost always be needed and it's a good starting point.
You will need to have both node and git installed on your development system.
You will also need a working couchDB implementation. The easiest way to start is to sign up for a free account with either:
All you need is your:
- Server Path: 'https://somebody.cloudant.com'
- UserID: 'somebody'
- Password: 'passw0rd'
When the application starts it will create a "users" database for you, then add a view so you can query it, plus insert a test user. In short when you fire it up it should "just work".
- Clone the repo:
git clone email@example.com:dstroot/express-bootstrap-passport.git && cd express-boot*
- install the dependencies:
sudo npm install
- rename config-example.js to config.js
cp config-example.js config.jsand tweak it with your couchDB settings
- run the app:
Keep track of development and community news.
- Follow @twbootstrap on Twitter.
- Read and subscribe to the The Official Twitter Bootstrap Blog.
- Have a question that's not a feature request or bug report? Ask on the mailing list.
- Chat with fellow Bootstrappers in IRC. On the
irc.freenode.netserver, in the
- Please submit all pull requests against *-wip branches.
- If we are going to use Bootstrap then I suppose HTML and CSS should conform to the Code Guide, maintained by Mark Otto.
Copyright and license
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
v.0.1 : Initial commit - December 29th, 2012
Copy the Bootstrap Less files to a directory under root project directory: /less.
Note the system will use less-middleware to "automagically" compile them by reading the css asked for in the html!
Copy the Bootstrap assets /docs/assets/* into /public.
This grabs all the icons, images, js, etc.
move the contents of public/js to public/js/lib.
I like to keep libraries separated from my code. This system will concatenate and minify the libs using uglify-js.
If you are doing a big bump such as 2.x to 3.x you will also need to play with the Jade templates to match up.