A year in the life of a Grails startup

72
A year in the life of a Grails startup Tomas Lin @tomaslin [email protected] Donovan Frew [email protected] Secret Escapes Grails Exchange 2011 Saturday, 10 December 11

Transcript of A year in the life of a Grails startup

Page 1: A year in the life of a Grails startup

A year in the life of a Grails startup

Tomas Lin@tomaslin [email protected]

Donovan [email protected]

Secret EscapesGrails Exchange 2011

Saturday, 10 December 11

Page 2: A year in the life of a Grails startup

•We will focus on the lessons we learned working with and changing a Grails application over a year in a London startup.

•Focus: Technology, People, Processes.

Saturday, 10 December 11

Page 3: A year in the life of a Grails startup

Agenda•Who is Secret Escapes?

• Before / After we launched the site

• A work environment around Grails

• Success / Challenges / The future

• Questions?

Saturday, 10 December 11

Page 4: A year in the life of a Grails startup

Secret Escapes• Best members-only travel site for the UK

• VC-funded ( just closed series-B )

• From founders of Dealchecker.co.uk

• More than 1 million happy users + growing

• Started with 3 full time staff in November 2010, growing to 25 in January

Saturday, 10 December 11

Page 5: A year in the life of a Grails startup

Saturday, 10 December 11

Page 6: A year in the life of a Grails startup

Saturday, 10 December 11

Page 7: A year in the life of a Grails startup

Saturday, 10 December 11

Page 8: A year in the life of a Grails startup

Saturday, 10 December 11

Page 9: A year in the life of a Grails startup

Saturday, 10 December 11

Page 10: A year in the life of a Grails startup

Architecture

• 2 Apps - CMS and StoreFront

• Domain classes, shared services, controllers and views live in one plugin.

• StoreFront and CMS live on different servers.

Saturday, 10 December 11

Page 11: A year in the life of a Grails startup

Before Launch - Goals• Make app easy to deploy

• Get enough tests to make it work

• Basic CMS

• Integrate third party tools quickly

• Ship!

Saturday, 10 December 11

Page 12: A year in the life of a Grails startup

Saturday, 10 December 11

Page 13: A year in the life of a Grails startup

Saturday, 10 December 11

Page 14: A year in the life of a Grails startup

Saturday, 10 December 11

Page 15: A year in the life of a Grails startup

Saturday, 10 December 11

Page 16: A year in the life of a Grails startup

January, 2011Site is Launched

( Yes, you can build a fully transactional website with Grails in 4 months )

Saturday, 10 December 11

Page 17: A year in the life of a Grails startup

After Launch• Growing existing features - Booking engine.

• Third party integration - Facebook, Google tracking, plugins.

• Build better tools for business - allocation uploading, customer support.

• Pulling data out of the system.

• Integrate with other sites.

• Validate effect of changes ( A/B tests ).

Saturday, 10 December 11

Page 18: A year in the life of a Grails startup

Brief timeline• End Of January - launch

• 1st Half of the year - CMS / CRM improvements, Affiliates, Calendar Booker.

• 2nd Half - Better invitation system, exclusive deals, custom theming, third Party Integration, A/B testing, Better design.

Saturday, 10 December 11

Page 19: A year in the life of a Grails startup

Brief timeline• End Of January - launch

• 1st Half of the year - Easier to work with codebase as a team. Growing the team. (Jenkins, Amazon Beanstalk, Git )

• 2nd Half - Making team better. Devotion to testing. ( Unit testing, Integration testing, agile, pairing )

Saturday, 10 December 11

Page 20: A year in the life of a Grails startup

Growing features-Dealing with Changing

Domain Models

Saturday, 10 December 11

Page 21: A year in the life of a Grails startup

Before

After

HotelFixed DateDropDrown

Fixed DateFlexible DatesHotelPackagesTravel OnlyBy Departure

More Flexible Bookings

Saturday, 10 December 11

Page 22: A year in the life of a Grails startup

Database Migrations• Use the dbm-gorm-diff mechanism

• Set default values via the sql( ) command

• Load automatically on application startup

• Add date of migration so that it is easier to sort / merge across git branches

Saturday, 10 December 11

Page 23: A year in the life of a Grails startup

Saturday, 10 December 11

Page 24: A year in the life of a Grails startup

Integrating with Third Party Services

Saturday, 10 December 11

Page 25: A year in the life of a Grails startup

Improve Tracking

•Google Goals Tracking

•Google eCommerce Tracking

•Google Analytics

•Third Party Tracking Tags

Saturday, 10 December 11

Page 26: A year in the life of a Grails startup

Saturday, 10 December 11

Page 27: A year in the life of a Grails startup

Saturday, 10 December 11

Page 28: A year in the life of a Grails startup

Third Party Integrations

• Try to capture as much as possible in one standalone plugin

• Write tests within the plugin so you don’t have to worry about it working in the app

• Use tag libraries to make your GSP files very clean

• Publish plugins for feedback / sharing

Saturday, 10 December 11

Page 29: A year in the life of a Grails startup

Our Plugins• Email Validator - Email Syntax.

• Inviter - Handles inviting friends from Yahoo, Gmail, Facebook, Windows Live, LinkedIn, etc.

• Website Optimizer - A/B Testing.

• CDN Resources - Adds pull-down CDN support for resources plugin.

Saturday, 10 December 11

Page 30: A year in the life of a Grails startup

CMS - Going beyond scaffolding

Saturday, 10 December 11

Page 31: A year in the life of a Grails startup

Better Customer Support

Saturday, 10 December 11

Page 32: A year in the life of a Grails startup

RemoteLink to Actions

Saturday, 10 December 11

Page 33: A year in the life of a Grails startup

Easier to add data

Saturday, 10 December 11

Page 34: A year in the life of a Grails startup

Saturday, 10 December 11

Page 35: A year in the life of a Grails startup

Easy to Customize

Saturday, 10 December 11

Page 36: A year in the life of a Grails startup

• Put into a domain classes

• Use bean fields plugin to manage changes.

• Use one template for edit and new actions.

•Mail templates, Sales, Affiliates, Themes.

Saturday, 10 December 11

Page 37: A year in the life of a Grails startup

Saturday, 10 December 11

Page 38: A year in the life of a Grails startup

Getting data out for analysis

Saturday, 10 December 11

Page 39: A year in the life of a Grails startup

Reporting

• We inherited a reporting framework from Dealchecker Applications.

• Allows you to either write a grails service or use a SQL statement.

• Can add additional query parameters like sale / affiliate, etc.

• Exports to Excel.

Saturday, 10 December 11

Page 40: A year in the life of a Grails startup

Saturday, 10 December 11

Page 41: A year in the life of a Grails startup

Saturday, 10 December 11

Page 42: A year in the life of a Grails startup

Dashboard

Saturday, 10 December 11

Page 43: A year in the life of a Grails startup

CMS Lessons• Move things that will change into a Domain

Object in the CMS.

• Build batch operations for editing data.

• Use g:remoteField for quick edit items.

• Use the Console Plugin

• Use Bean Fields

• Work with Excel / CSV.

Saturday, 10 December 11

Page 44: A year in the life of a Grails startup

Some interesting techwe built -

Stuff other people never seem to talk about

Saturday, 10 December 11

Page 45: A year in the life of a Grails startup

Custom Theming Apps

• We keep all our customizations in a Theme domain object.

• Partners can overwrite our site defaults via a CSS file and a JS file.

• Use image references in CSS files to make it easy to change.

• Themes are loaded by domain name or url parameter

Saturday, 10 December 11

Page 46: A year in the life of a Grails startup

What can you change?• Application Name.• Domain Name• Theme CSS file • Theme JavaScript file • Favicon.• An URL to redirect

Technical Support• Email• Phone Number

Embedded Header of Footer• A header URL• A footer URL

Social Networks• Name of Facebook Page• Description for application• Image for Sale Now• Color for Sale Title• Color for destination

Text displayed for staticpages on the Site

• About Us• Contact Us• Faq• Terms and Conditions• Privacy Policy• Current Sales Sidebar

Email Templates• Title • Background Color• Header Text• Header Logo• Footer Signature• Footer Text• Blurb Title• Blurb Test• Title Color

Paypal Payment Page• Background Color• Background Image• Footer Text Color• Header Background Color• Header Height• Font for the Logo• Color of the Logo Font• Logo Image• Logo Image Position• Logo Text• Order Summary Background Color• Custom Image for Order Summary• Color of the Pay Now Button• Text color of the Pay Now Button• Section Background Colors• Color of the byline

Saturday, 10 December 11

Page 47: A year in the life of a Grails startup

Saturday, 10 December 11

Page 48: A year in the life of a Grails startup

A/B Testing• Allows us to verify and test different designs

against one another.

• Via Google Website Optimizer and the GWO plugin.

• Validates that changes we have made do not significantly affect conversion.

Saturday, 10 December 11

Page 49: A year in the life of a Grails startup

Adding new A/B Tests• Create Variations.

• Define experiments.

• Insert <gwo:includes/> tags in code.

• Insert <gwo:conversion/> tag in code.

• Run Experiment.

Saturday, 10 December 11

Page 50: A year in the life of a Grails startup

Saturday, 10 December 11

Page 51: A year in the life of a Grails startup

Goals At this Stage

• Make changes without breaking the site.

• No longer just ‘make it work’, need to make it really nice.

• Adapt to rapidly changing business needs.

• Scaling up development.

Saturday, 10 December 11

Page 52: A year in the life of a Grails startup

How do you build up a team around Grails?

Saturday, 10 December 11

Page 53: A year in the life of a Grails startup

• Grails Programmers are hard to find

• But we can always find Java developers

• Builds on industry-leading frameworks. Spring / Hibernate. Those developers are available.

• Attitude / fit

Identifying the right people to work with

Saturday, 10 December 11

Page 54: A year in the life of a Grails startup

• Put together job specs as a team

• Blogging / social networks / twitter

• Conferences and User Group Meetings

• Letting our work get out there.

• Recruiters are expensive and bad. DIY.

Making it attractive

Saturday, 10 December 11

Page 55: A year in the life of a Grails startup

Silicon Milk Roundabout

Saturday, 10 December 11

Page 56: A year in the life of a Grails startup

Other places

• http://www.grailsjobs.com

• London Groovy Grails User Group

• Reddit

• Here!

Saturday, 10 December 11

Page 57: A year in the life of a Grails startup

How we work?• Pair Programming

• Daily Standups

• Retrospruktions

• Team Activities ( Lunches, conferences )

• No a lot of hierarchy.

• Features in pairs are more robust

• Hack Days fortnightly ( every 2 weeks )

Saturday, 10 December 11

Page 58: A year in the life of a Grails startup

Communication• Across different teams

• Pivotal Tracker / Trello

• Validation of features

• Team Lunches with a friend

Saturday, 10 December 11

Page 59: A year in the life of a Grails startup

Saturday, 10 December 11

Page 60: A year in the life of a Grails startup

Saturday, 10 December 11

Page 61: A year in the life of a Grails startup

Communication

• Within the team

• Stand ups

• Retrospectives

• Document via tests

• Common Environments

Saturday, 10 December 11

Page 62: A year in the life of a Grails startup

Code Quality• Writing more tests. Commitment to write unit /

integration / functional tests.

• Boy Scout Rule

• Shared Ownership

• TDD using Geb and Spock.

• Jenkins to make sure it works on the other machine.

• CodeNarc to enforce best practices.

Saturday, 10 December 11

Page 63: A year in the life of a Grails startup

Increase in Unit Tests over time

Saturday, 10 December 11

Page 64: A year in the life of a Grails startup

Increase in Integration Tests over time

Saturday, 10 December 11

Page 65: A year in the life of a Grails startup

Useful Stuff• Git Flow

• Continous Integration Game for Jenkins

• Less

• Start / Stop / Continue / Less / More

• Pairing with Designers

Saturday, 10 December 11

Page 66: A year in the life of a Grails startup

Saturday, 10 December 11

Page 67: A year in the life of a Grails startup

Saturday, 10 December 11

Page 68: A year in the life of a Grails startup

Is Grails right for my startup?

• Penetration test by the Telegraph showed us value of best practices.

• Can build things quicker. Make us more responsive.

• “At Last Minute this would have taken 6 months”

• Awesome Community.

Saturday, 10 December 11

Page 69: A year in the life of a Grails startup

Challenges• Speed running Functional test and Integration tests.

• Finding the right people.

• Cost of Idea licenses.

• Deployment.

• Services are US-based. Difficult in the UK.

• Failed Amazon Beanstalk Experiment.

Saturday, 10 December 11

Page 70: A year in the life of a Grails startup

The Future• £5 Million Marketing initiative

• Mobile

• More integrations

• Grails 2.0

• ?

Saturday, 10 December 11

Page 71: A year in the life of a Grails startup

Questions?

Saturday, 10 December 11

Page 72: A year in the life of a Grails startup

come work with us

http://www.secretescapes.com/jobs

Saturday, 10 December 11