Blog Express.js Web Application Example

Blog Express.js App Admin Page

For the past few weeks, I’ve been writing a new book on Node.js. Hence the lack of new posts. This time, the book encompasses virtually all of the practical aspects of web development using Node.js: authentication, authorization, OAuth with third-party service providers, testing, libraries, frameworks, databases, ORMs and MVC-like patterns. In other words, if you have to read only one book on Node.js (which is not a good advice, but let’s assume), this will be the book that you have to read. :-)

The title and the alpha sign up are in secret for now (subscribe to get the news faster). The book is due in early spring 2014.

Here is one of the main examples that is featured in the book: the Blog application built with Express.js, MongoDB and Mongoskin. The application is subject to change, but if you’re an intermediate or advance Node.js programmer, go ahead and poke the source code, kick the tires of the server. It’s not a Ghost blogging platform, but blog-express can give valuable practical tips on how to implement:

  • Session-based authentication
  • Express.js middleware authorization
  • MVC-like pattern using lightweight MongoDB library called Mongoskin
  • REST API server
  • Express.js routes organization
  • Jade and server-side rendering
Blog Express.js App Home Page

Blog Express.js App Home Page

GitHub: http://github.com/azat-co/blog-express

--
Best Regards,
Azat Mardan
Microsoft MVP | Book and Course Author | Software Engineering Leader
Azat Mardan avatar
https://www.linkedin.com/in/azatm
To contact Azat, the main author of this blog, submit the contact form or schedule a call at clarity.fm/azat and we can go over your bugs, questions and career.

10 thoughts on “Blog Express.js Web Application Example

  1. Azat Post author

    Nice, thank you. The problem wasn’t with req.session = null. It was with everyauth overwriting /logout route (I added it later and probably didn’t see the bug). So everyauth /logout wasn’t destroying the session and it never got to the proper /logout. Please try it now. PS: everyauth is so amazing that it automatically add /logout when it sees connect and/or express, cool right? ;-)

    https://github.com/azat-co/blog-express/commit/ee51f83c5ba609e245df7d690591378945ca6720

  2. hazou

    i tried your app and it seems like there is an issue with logout function. it did not clear the user session

  3. Mayur

    Cool … I just wish mongoose was integrated in it. Also it would be more interesting to use if you would add an admin module. But still , the pattern of the app itself is very helpful.

  4. Azat Post author

    Not in this particular example. On the client-side, we just change classes on elements (here). But someone can use Underscore, jade-browser, Handlebars or any other front-end JS template engine with a Node.js REST API server.

    Jade-browser is something I maintained during my tenure at Storify. The benefit of this library is that same templates can be shared between server and browser.

Leave a Reply

Your email address will not be published. Required fields are marked *