Looking for a great open source example of a production quality rails,
emberjs, and single-page-application project? Check out
Discourse is the 100% open source, next-generation discussion platform
built for the next decade of the Internet.
Here's a great example of the Discourse code in action: Is it better
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,
There's even an interesting discussion on the Discourse blog about
Discourse as Your First Rails
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
Why Explore Discourse's Source?
- Example of EmberJs Single-Page-Application.
- Design decisions are discussed at
meta.discourse.org, such as Is it
- 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
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
rather than using the rake task. Then you can install the seed data:
psql -d discourse_development < pg_dumps/development-image.sql
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.
bundle exec rspec
You should have installed MailCatcher, so that
you don't have to configure any smtp server. Then you just have to visit
http://localhost:1080 to see the mail messages that Discourse sends.
Then to run the Discourse application (assuming postgres and redis are
running) open up two tabs. Cd each to the disource directory.
bundle exec clockwork config/clock.rb
Or, install foreman (
gem install foreman) and run (runs the
If you got this working, you'll see this: