development full of
merriment and sense

Basejumper – Yet Another Starter Application

Geoffrey on February 22, 2009 at 8:37 pm

I do not hide the fact that I like to try out new ideas by building lots of little applications. One thing I find myself doing is recreating many of the same pieces for each application. So I finally gave in and built a default template for the way I like all of my applications to start. There are other starter apps, but this one is tailored to my idiosyncrasies.

You can find the project, Basejumper, at: http://github.com/gdagley/basejumper

What is included?

Blueprint CSS (http://www.bluprintcss.org)

Say what you will about CSS frameworks, but they make my life a lot easier. From the website, it “gives you a solid CSS foundation to build your project on top of, with an easy-to-use grid, sensible typography, and even a stylesheet for printing.” There are official plugins for the framework, like “buttons” and “link-icons”, and other user created ones, like silksprite (http://www.ajaxbestiary.com/Labs/SilkSprite).

Authlogic (http://github.com/binarylogic/authlogic)

The way I think authentication should be done. Instead of copying a lot of authentication logic (encrypting passwords, remember tokens, etc.) into your user model, it is kept in the gem and is easily updatable. It has lots of configuration options to fit with your authentication needs and some really good tutorials.

In app/models/user.rb

class User < ActiveRecord::Base
  acts_as_authentic
end

Configatron (http://github.com/markbates/configatron)

This is great way to store application wide configuration and settings. By adding an initializer to load the config.yml, you can access configuration anywhere in the app.

In config/initializers/load_config.rb:

configatron.configure_from_yaml("config/config.yml", :hash => Rails.env)

And in config/config.yml

development: &#38;local
    property1: value1
    property2: value2

test:
  <<: *local
  value2: test_value2

production:
  <<: *local
  value2: prod_value2

Searchlogic (http://github.com/binarylogic/searchlogic)

From the same folks who brought you Authlogic, there is Searchlogic. You will always need pagination. You may not think so now, but believe me, you will. So just start out with it enabled. What I really, really like about Searchlogic, is not just the pagination support, but how easy it makes building advanced search forms (including searching nested objects). And again, there is a great tutorial

log-buddy (http://github.com/relevance/log_buddy)

For the lazy debugger in all of us. How many times have you typed:

some_var = 'some_value'
logger.debug "some_var = #{some_var}" 

Now try this

some_var = 'some_value'
d { some_var }

which will log

some_var = 'some_value'  

micronaut and micronaut-rails (http://github.com/spicycode/micronaut and http://github.com/spicycode/micronaut-rails)

It just makes more sense to me. Like RSpec, only fewer calories. micronaut is a BDD framework similar to RSpec. In fact it uses all the same RSpec matchers, so there is not a new syntax to learn. And it adds metadata to the loaded examples that is useful for deciding which tests to run, exclude, document, etc. or building additional tools for your example suite.

The application currently has examples (a.k.a. specs) for most of the existing code. Adding new examples, should be quick and easy. To see it all, start with rake examples

beholder treasure map (http://github.com/spicycode/beholder)

I like continuous integration. I work for a company that likes continuous integration. Having continuous testing locally let’s me as soon as I break something.

beholder watches for files to change and then reruns the appropriate tests/specs/examples. Now I don’t have an excuse for not running the example suite, because it is always running for me.

active_form (http://github.com/nesquena/active_form)

Easy ActiveRecord validations for non-AR models (for those Contact Us forms).

comatose (http://github.com/darthapo/comatose)

Inevitably, every project wants to be able to manage the “static” content on the site. Comatose is a very simple CMS plugin. Nothing fancy, but that is great for these small projects. You can even style the admin interface to look more like your application (which I did), but the default styles could work just fine. It is possible to use the content in Comatose as an entire page or a partial across many pages. The app has a migration that creates some default pages and an example partial.

active_scaffold (http://github.com/activescaffold/active_scaffold)

Fastest way to build a super simple admin interface. Or you could use it to build more complex admin. It is really quite flexible with its search, CRUD, and the ability to customize.

display_flash_helper (http://github.com/gdagley/display_flash_helper)

Shameless use of my own plugin to display flash messages. Nothing too fancy.

exception_notification (http://github.com/rails/exception_notification)

Because they happen and I want to know about them.

pretty_buttons (http://github.com/relevance/pretty_buttons)

HTML buttons shouldn’t have to look so bad. This plugin plays nicely with Blueprint CSS buttons plugin, too

semantic_form_builder (http://github.com/nesquena/semantic_form_builder)

HTML forms made easier and semantic. Also makes the forms easier to style.

seo_helper (http://github.com/relevance/seo_helper)

A few useful helpers for SEO purposes. Create page titles (h1) that match the html title (title), support for meta tags and easily add some breadcrumbs to each page.

Conclusion

Like I said before, it is tailored to they way I like things to start out. You can fork it and change it. I may not roll you changes back in, but that’s ok because now you have an starter app just the way you like it.

Filed under: CSS, Development Environment, Entrepreneurial, Rails, Web Applications, Web Development, microapps

6 Comments »

  1. That’s great info. It’s helpful to see what Rails bits and pieces you’re getting mileage out of.

    I’ve been browsing GitHub looking at plugins and such, but often it’s hard for me to judge if something is solid, reliable, and useful, or just unmaintained junk. A few that you mentioned I haven’t heard of, so I really appreciate it.

    Dave

    Comment by David Ortinau — February 23, 2009 @ 11:34 pm

  2. Geoffrey,

    You might be interested by this project:

    http://jackdempsey.github.com/beet/

    I too love to build a lot of little apps to test out ideas, etc. I got tired of having to do the same thing time and time again, while not being able to reuse similar ideas across recipes.

    Jack

    Comment by Jack Dempsey — June 14, 2009 @ 12:26 am

  3. Hi Geoffrey,

    I’ve been struggling to make this work for me with just some basic Controllers, but I’m also a real Rails newbie who doesn’t have time to hack on this alot. I’d like to make a couple of suggestions to improve the docs.

    1. mention that Ruby 1.9.x won’t work at all currently. I went down this route initially on my Ubuntu Karmic VM that I setup. Big mistake. So I dropped back to 1.8.x and it’s now working.

    2. Can you please give a stupid basic example of how to setup a pair of models, their controllers and what routes are needed? And any other stuff that needs to be tweaked? I’ve done:

    
      script/generate model Team name:string
      script/generate model Player first:string last:string team:references
       vi app/model/team.rb
           - add in:   has_many :players
      rake db:migrate
     script/generate controller Team index
      vi app/controllers/team_controller.rb
          - add in:   active_scaffold
      vi app/config/routes.rb
         - add in before the map.static call:
            map.resources :teams
      rake db:migrate
      script/server
    

    then when I goto the web page, it craps out with something like the following, which honestly doesn’t tell me enough to let me know where I’m not doing the right thing.

    
     ActionController::RoutingError in Teams#index
    
    Showing vendor/plugins/active_scaffold/frontends/default/views/_list_header.html.erb where line #8 raised:
    
    No route matches {:action=>"show_search", :controller=>"teams", :_method=>:get}
    
    Extracted source (around line #8):
    
    5:
    6:
    7:
    8:
    9:
    10:
    11:      :table) %>
    
    Trace of template inclusion: vendor/plugins/active_scaffold/frontends/default/views/list.html.erb
    
    RAILS_ROOT: /home/john/Web/Soccer/basejumper2
    

    Comment by John — March 8, 2010 @ 8:59 pm

  4. John,

    I believe the problem is that if you are you using ActiveScaffold for teams and players, then the routes.rb needs to look like:

    
    map.resources :teams, :active_scaffold => true
    map.resources :players, :active_scaffold => true
    

    I will look at adding the comments and extra help that you mention. Thanks for the feedback.

    Comment by Geoffrey — March 10, 2010 @ 9:59 am

  5. В каком-то блоге я уже видел почти такую же подборку инфы да ладно

    Comment by Forex Inside — April 27, 2010 @ 3:57 pm

  6. Елки, неожиданная заметка

    Comment by Трипо — May 17, 2010 @ 1:15 pm

RSS feed for comments on this post.
TrackBack URL

Leave a comment




  • gdagley on Twitter

  • gdagley on del.icio.us

Powered by WordPress