Looking for a great open source example of a production quality rails, emberjs, and single-page-application project? Check out Discourse.
Discourse is the 100% open source, next-generation discussion platform built for the next decade of the Internet.
Production Quality, not a Tutorial
Note, this is an example of a production quality application, rather than a useful tutorial sample application. What’s the difference? The Discourse codebase is the real deal, including all the gory details, such as performance optimizations. If you want a superb sample rails application, check out Rails Tutorial, 2nd Ediition and read the book Ruby on Rails Tutorial, Learn Web Development with Rails, Michael Hartl. There’s even an interesting discussion on the Discourse blog about Discourse as Your First Rails App, which it shouldn’t be.
That being said, the Discourse code base is probably as good as or, in many cases, better than what you’ll find in many software-as-a-service companies. It’s no secret that public scrutiny of popular open source code really raises the bar on quality. Consequently, if you’re a serious and experienced Rails developer, it’s worth your time to install the source of discourse and explore and run it. I just did that and I’m impressed.
Why Explore Discourse’s Source?
- Example of EmberJs Single-Page-Application.
- Solid project, from code quality to organization.
- Co-Founded by Jeff Atwood, who created Stack Overflow. Jeff wrote a article introducing the discourse project: Civilized Discourse Construction Kit.
Basically, there’s a few dependencies to install, some of which you probably already have installed, such as Postgres and Redis. The main gotcha I faced was to make sure that you run the postgres instructions for creating the development database, rather than using the rake task. Then you can install the seed data:
The rake task to do
rake db:seed_fu does not install the sample data, but
rather some tiny bit of “seed” data (like post action types).
Once you have the test data installed, then run these commands.
1 2 3 4 5
Then to run the Discourse application (assuming postgres and redis are running) open up two tabs. Cd each to the disource directory.
Or, install foreman (
gem install foreman) and run (runs the
1 2 3
If you got this working, you’ll see this: