Blog

Showing posts with label checklists. Show all posts
Showing posts with label checklists. Show all posts

Monday, October 17, 2011

References and tools for Memory Consumption in Rails

It's not often that I need these, but when there's a Memory Consumption issue in a Rails application, these references and tools definitely come in handy:

Rails 3 References and Tools

Some Older References and Tools

Thursday, July 28, 2011

Basic Heroku addons I always use for production websites


heroku addons

cron:daily
custom_domains:basic
logging:expanded
memcache:5mb
newrelic:standard
pgbackups:auto-month
sendgrid:basic
shared-database:5mb

Thursday, October 21, 2010

Web Integrator Application Hand-off Checklist

One scenario in developing applications, is the application is built and then handed off to a Web Integrator to implement the CSS. The other is templates are created and these are integrated by the web developer. This checklist is primary for the first scenario, but is probably applicable to the second. Here is a list of checks you should make before handing off for integration:

  • Demo data: Can the web integrator easily add demo data to the application. This should be done via a script.
  • Translation: If your application is multi-lingual, ensure all strings are in a locale file and the Web Integrator knows how to edit these. Spend some time teaching the Web Integrator on how it works.
  • Test translations: Before an application is translated, run the application in the secondary language to make sure that all "strings" for that language are missing. Check especially for emails static pages and built-in error messages, labels and attributes.
  • Language Switcher: Ensure a language switcher exists and is working.
  • Emails: If your application sends emails, ensure the developer can send and preview these easily. This can be done with the a script to send emails and a preview option via http. Rather than your application send emails, use a email service provider.
  • Minimize custom helpers: Helpers can be a roadblock for a Web Integrator not familiar with Rails. If you do use helpers, have the helper render a partial which can be easily customized.
  • Test accounts: Most applications are not standalone these days. If your application connects with external services such as Twitter and Youtube, ensure test accounts have been setup and can easily be used. You want to encourage the Web Integrator to use these integrations as much as possible. It's a great way to catch bugs!
  • Overlay option: Seen a web site without an overlay these days? Allow your Web Integrator to render a page without the entire layout easily. Passing a parameter along the URI is great way to do this.

Any thing I have missed? Please let me know in the comments.

Wednesday, October 13, 2010

Ensure all your external assets are SSL too

Just a quick reminder to link all your assets with https:// when they are under SSL. Since libraries such as jQuery are hosted by third parties such as Google, it's easy to forget to use https. When a user accesses a page under https and some assets are not accessed securely, the user will see a dreaded message warning that the page has some unsecured assets.

In Rails I use the request protocol which returns http: or https://

= javascript_include_tag "#{request.protocol}ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"

I have updated my Webmaster Launch Checklist to include this item.

Thursday, October 7, 2010

Allow the designer to easily preview Rails application emails

In my post Leave a project how you would like to find it, I discussed how to leave a project with a great README. I added another item to that, how to preview emails. When handing off a project to a designer to skin, an issue that arises is previewing the application emails.

In his Scaling Labs video, Greg Pollack suggests handing of application emails to an email service provider. I think that is a great idea, but sometimes if you are working on a short lived website that might be over kill. So my solution is to create a rake that a designer can easily use. Here's my recipe:

  • Create a separate config/mail.rb environment based on development.
  • Append config.action_mailer.delivery_method = :sendmail to the file.
  • Configure your database.yml with the same settings as your development environment.
  • Write your rake tasks.

Here an (edited) example of the rake task I wrote (lib/application.rake):

desc %{Sends test notification
Must specify RAILS_ENV=mail
EMAIL=you@example.com to specify email address}
    
task :send_notification => :environment do |t|
  registration = OpenStruct.new
  registration.first_name = Faker::Name.first_name
  registration.last_name = Faker::Name.last_name
  registration.email_address = ENV['EMAIL']
  
  CompetitionMailer.deliver_notification(registration)
end

Now run rake send_notification RAILS_ENV=mail EMAIL=nicholas@example.com. Check your email inbox!

Platform notes:

  • Rails 2.3.8
  • Mac OS X

There are other solutions that you may be interested in as well:

  • MockApp: "a native Mac application that embeds its own SMTP server. It also features an e-mail client browser, enabling instant viewing of both raw content and HTML rendering, so you can see how your mail looks when delivered".
  • MailTrap: "A mock SMTP server for use in Rails development".

Friday, September 17, 2010

Rails Application Launch Checklist

As a part of my on-going effort to publish checklists on this blog, here is my Application Launch Checklist. Let me know if there's anything missing in the comments.
Configuration and Setup
Optimizations
  • Database optimization (bullet for n + 1 queries, rails_indexes, slim scrooge, query_reviewer)
  • Page Responsiveness (Javascript and CSS caching with Jammit, Sprites, Asset hosts)
  • Background Processing (Delayed Jobs - long running processes, email, file imports and processing, HTTP calls)
Caching
  • Page Caching
  • Action Caching
  • Fragment Caching
  • Query Caching
  • Client-side Caching
  • HTTP Caching
Anything missing from Firsthand Rails Template? Plugins?
NewRelic has a great series on Scaling Rails that reviews techniques for caching and database optimizations.

Monday, September 13, 2010

Basic HTML Template for Designers to create a Style Guide

When I start a new front-end project coding HTML/CSS I will ask the designer to provide a style guide to outline the typography used through the website. I find when I mark-up the CSS for the typography first, before starting the grid, the overall CSS is cleaner. How do you communicate what elements need to be in the style guide? Well there are some basic elements such as headers, forms and table that I provide in a HTML file that the designer can start with. Then additional typography elements, such as typography in sidebars and call-to-actions are added to the style guide. Are there any elements you think need to be included in my basic HTML file? I like to keep it relatively simple so I don't add things like definition lists, but perhaps I should. Let me know.

Saturday, September 4, 2010

Shopify (eCommerce) Pre-Launch Checklist

Here is a basic pre-launch checklist I use when working on a Shopify Project. Of course this checklist can be used on any type of eCommerce project:

Setup the following:

  1. Email Notifications
  2. Shipping Handling
  3. Taxes
  4. Payment Gateway
  5. Google Analytics
  6. Redirect domain name

And don't forget training the client in using the administration backend. Shopify has a great set of resources for support and training:

The first thing you will probably want to do is help your client understand how to organize their products.

Thursday, September 2, 2010

Leave a project how you would like to find it

I started a new CMS project yesterday with Radiant. One aspect I am really focusing on is to ensure that all the "other" details are taking care of during the development, so when another developer needs to work on it, they can get started on it as quickly as possible.

The new Bundler and Rails 2.x config.gem have certainly helped with installing dependent gems, but I still think it's beneficial to have a step by step guide in the form of a README file on getting the application running and any other aspects of the application the developer should know about.

GitHub presents the README file of the homepage of the repository.

README file on Github

Please replace the default README file in your Rails or Radiant application (or any other open source application). Here's a basic outline of what you could include:

  • Application setup and database bootstrapping
  • Testing frameworks used and how to run the tests
  • References used on the project (for example, if you used a third-party API, link to those documents)
  • Any other interesting notes that you discovered during development, but would have liked to have known before you got started
  • Populating the database with "demo" data
  • How to easily preview application emails (hint: rake tasks)

Are there any other items that should be in the README? Do you have any links to examples of great README's?

Friday, August 27, 2010

"Webmaster" Launch Checklist

I have a bunch of checklists that I really need to start sharing on this blog. Here's the first one, the "Webmaster" Launch Checklist. Just some basic things to check before going live with a site. If you have your own online, please link in the comments. If you think there is something I'm missing, please let me know. Admittedly a lot of this is covered by by "blank-static" project, which covers the basics like custom 404 and 500 pages. It's the little things...

General

  • Add Favicon
  • Add robots.txt
  • Validate HTML
  • Custom Meta data for each page: title, meta_description, meta_keywords
  • Setup FOSI Tag
  • Setup Google Account
  • Integrate Google Custom Search Engine (if required)
  • Integrate Google Analytics
  • Add site to Google Webmaster Tools (GMT)
  • Add sitemap to GMT
  • Submit to open source directory
  • Custom 404
  • Monitor 404's, broken links (I use Deep Trawl)
  • Ensure all assets under SSL are linked using https://

Blogs

  • Sign blog up on Technocrati
  • Twitter Link
  • Facebook Link
  • AddThis/ShareThis

Saturday, December 26, 2009

Maintenance and Monitoring Checklist for your Ruby on Rails Application

Before your application goes into production there are some maintenance and monitoring tasks you need to consider. These tasks include:

  1. Backups
  2. Log Rotation
  3. Monitoring
  4. Scheduled Jobs

Backups

You need to maintain offsite backups for your application’s:

  • database,
  • shared assets, and
  • source code repository.

I have a set of backup scripts (executed via a nightly cron process) that dumps the database for each of my applications, which are in turn archived, and then downloaded to my server. Shared assets, those files uploaded via your application typically located in the public folder, are synced to my server and then archived. As my source control is hosted on Github, I don’t need to worry about backing this up.

Log Rotation

Installing the logrotate package will take care of your system logs, but you will need to set up log rotation specifically for your Rails application. I typically deploy my applications using Moonshine, a server provisioning tool from the folks at Rails Machine, so log rotation has been addressed. There maybe some other logs that are generated by your application such as Ferret server. Consider these files in your applications log folder:

  • production.log
  • mongrel.log (not necessary if you deploy on Passenger of course)
  • ferret.log (other log producing components)

Monitoring

Monitoring is split into four categories:

  • Monitoring Services
  • Performance Monitoring
  • External Monitoring
  • Exception Notification

Monitoring services such as Apache, MySQL or even processes that are apart of your application, such as the Ferret server can be monitored by Monit or God. If these services go down unexpected, they are automatically restarted by the monitor.

Performance Monitoring can be broken down further into Server and Application Performance. Munin is a good candidate for the first, while service providers such as New Relic and Scout are good for the later. With Server monitoring you will also want to consider the consumption of resources. For example, how much disk space do I have left? How much RAM do I have left?

An external monitoring service is useful. Services such as Monstatic, 24×7, or Pingdom can notify you when your server is inaccessible.

Finally, the Exception Notification plugin suits my needs to be notified of an exception, but you may prefer a service to manage this such as Airbrake Bug Tracker or Exceptional.

Cron Jobs (Schedule Jobs)

Sometimes you will need to run scheduled jobs against your application such as managing recurring subscriptions. Make sure these are installed and running. It’s best to make these a part of your deployment using whenever or again, my preference is using Moonshine.

If you are you are using ActiveRecord-based sessions in your application, then you will definitely need to setup a task to remove old records in the sessions table.

Please note this blog is no longer maintained. Please visit CivilCode Inc - Custom Software Development.