78
How t o b ui l d c omple x web appl ic a ti ons ha vi n g fu n ? How t o b ui l d c omple x web appl ic a ti ons ha vi n g fu n ? How to build complex web applications having fun ?

EuroPython 2011 - How to build complex web applications having fun?

Embed Size (px)

DESCRIPTION

Web development is a complexity challenge nowadays. Growing number of functionalities results in customer expectations increase which makes project design more difficult. Using proper tools that suite your customer needs is essential. This talk is about successful story using closely together Pyramid and Plone. Basing on these examples you will see the main reasons for using Plone as a CMS only and letting Pyramid do the rest (vertical application).

Citation preview

Page 1: EuroPython 2011 - How to build complex web applications having fun?

How to build complex

web applications having fun?

How to build complex

web applications having fun?

How to build complex

web applications having fun?

Page 2: EuroPython 2011 - How to build complex web applications having fun?

Andrew MleczkoSoftware Integrator

Ferrara (Italy)

twitter: amleczko

[email protected]

author

Page 3: EuroPython 2011 - How to build complex web applications having fun?

the team

Page 4: EuroPython 2011 - How to build complex web applications having fun?

WHY this talk?

Page 5: EuroPython 2011 - How to build complex web applications having fun?

My Reasons to be here

★ Building complex web

applications could be fun

★ Architectural decisions are

more important than you

think

★ Promote

and

Page 6: EuroPython 2011 - How to build complex web applications having fun?

★ among the top 2% of all open source projects worldwide

★ more than 340 active core developers

★ developed since 2001

★ version 4.1 released 12 days ago

Page 7: EuroPython 2011 - How to build complex web applications having fun?
Page 8: EuroPython 2011 - How to build complex web applications having fun?

★ available in more than 40 languages

★ the best security track record of any major CMS

Page 9: EuroPython 2011 - How to build complex web applications having fun?

powered

Page 10: EuroPython 2011 - How to build complex web applications having fun?

the growing community

Page 11: EuroPython 2011 - How to build complex web applications having fun?
Page 12: EuroPython 2011 - How to build complex web applications having fun?
Page 13: EuroPython 2011 - How to build complex web applications having fun?

SMALL “Roughly 5000 lines of code”

Page 14: EuroPython 2011 - How to build complex web applications having fun?

SMALL

FAST

“Roughly 5000 lines of code”

Page 15: EuroPython 2011 - How to build complex web applications having fun?

SMALL

FAST

STABLE

“Roughly 5000 lines of code”

Page 16: EuroPython 2011 - How to build complex web applications having fun?

SMALL

TESTED

FAST

STABLE

“Roughly 5000 lines of code”

“100% statement coverage via unit and

integration tests”

Page 17: EuroPython 2011 - How to build complex web applications having fun?

SMALL

DOCUMENTED

TESTED

FAST

STABLE

“Roughly 5000 lines of code”

“100% statement coverage via unit and

integration tests”

“Literally nothingin Pyramid

is undocumented”

Page 18: EuroPython 2011 - How to build complex web applications having fun?

The Bad story

Page 19: EuroPython 2011 - How to build complex web applications having fun?

The Customer

★ Large public sectore

entity

★ > 1000 employees

★ Needs a complex intranet

★ Deadline: 2 years

Page 20: EuroPython 2011 - How to build complex web applications having fun?

The Team

Page 21: EuroPython 2011 - How to build complex web applications having fun?

The Team★ Mixed roles:

Tester

Developer

Project manager

Software architect

★ No development philosophy

Page 22: EuroPython 2011 - How to build complex web applications having fun?

technology★ Temptation to be on the

technological edge

★ The Learning Curve Effect

everything is a “prototype”

★ Technical design debt is...

... more then average

Page 23: EuroPython 2011 - How to build complex web applications having fun?

bad dec i s ions★ Project manager as

Software architect as

Tester

★ Technology didn't

fit in

★ no fun at all

Page 24: EuroPython 2011 - How to build complex web applications having fun?

The Good Story

Page 25: EuroPython 2011 - How to build complex web applications having fun?

The Customer

★ .

★ Born as a startup

★ Offices in Miami,

New York and Los Angeles

Page 26: EuroPython 2011 - How to build complex web applications having fun?

Water today

★ U.S. - the largest consumer market for

bottled water in the world

★ in 2011, the market is forecast to have a

value of $86,421.2 billion

“Bottled water has become the second largest commercial beverage category”

Page 27: EuroPython 2011 - How to build complex web applications having fun?
Page 28: EuroPython 2011 - How to build complex web applications having fun?
Page 29: EuroPython 2011 - How to build complex web applications having fun?

project requirements

Page 30: EuroPython 2011 - How to build complex web applications having fun?
Page 31: EuroPython 2011 - How to build complex web applications having fun?

paperless saleCRM

Sales

1

2

3

4

5

Warehouse

E-commerce

Support

Page 32: EuroPython 2011 - How to build complex web applications having fun?

paperless saleCRM

Sales

1

2

3

4

5

Warehouse

E-commerce

Support

★ Customer’s management (satisfaction, order status, etc.)

★ Reports (machine statistics, etc.)

★ Campaigns

Page 33: EuroPython 2011 - How to build complex web applications having fun?

paperless saleCRM

Sales

1

2

3

4

5

Warehouse

E-commerce

Support

★ Sales network management

★ Invoicing / accountancy

★ Revenue counter

★ Discount management

Page 34: EuroPython 2011 - How to build complex web applications having fun?

paperless saleCRM

Sales

1

2

3

4

5

Warehouse

E-commerce

Support

★ Catalog management

★ Warehouse management

★ Logistic tracking

Page 35: EuroPython 2011 - How to build complex web applications having fun?

★ Online shop (for beverages and accessories)

★ Machine configurator (interactive wizard)

★ Online payments

paperless saleCRM

Sales

1

2

3

4

5

Warehouse

E-commerce

Support

Page 36: EuroPython 2011 - How to build complex web applications having fun?

paperless saleCRM

Sales

1

2

3

4

5

Warehouse

E-commerce

Support

★ Machine maintenance (filter change)

★ Emergency services

★ Order / installation process

Page 37: EuroPython 2011 - How to build complex web applications having fun?

paperless saleCRM

Sales

1

2

3

4

5

Warehouse

E-commerce

Support

★ Machine maintenance (filter change)

★ Emergency services

★ Order / installation process

Page 38: EuroPython 2011 - How to build complex web applications having fun?

Support

CRM

Sales

Warehouse

E-commerce

paperless sale

Page 39: EuroPython 2011 - How to build complex web applications having fun?

Support

CRM

Sales

Warehouse

E-commerce

Intranet Extranet

paperless sale

Page 40: EuroPython 2011 - How to build complex web applications having fun?

Totally paperless ERP

Page 41: EuroPython 2011 - How to build complex web applications having fun?

project gotchas

Page 42: EuroPython 2011 - How to build complex web applications having fun?

project gotchas

★ Requirements are not rock solid

(it’s a startup) - project will grow with the customer

★ Customer is in U.S. - planning

regular meetings is essential

★ We need to find proper (new?)

framework

★ Only 5 months to delivery

Page 43: EuroPython 2011 - How to build complex web applications having fun?

project background

Page 44: EuroPython 2011 - How to build complex web applications having fun?

The DEV TEAM★ Software architect

★ database design

★ integration layer (data,

authentication)

★ Developers

★ Plone team

★ Pyramid team

Page 45: EuroPython 2011 - How to build complex web applications having fun?

★ Prototyping - the good way

★ Collecting specification and

keeping docs up-to-date

★ Software development having

fun

Page 46: EuroPython 2011 - How to build complex web applications having fun?

Arch i tectural dec i s ions

Page 47: EuroPython 2011 - How to build complex web applications having fun?

a n d

Page 48: EuroPython 2011 - How to build complex web applications having fun?

★ architecture is not so far away

from Zope

★ it supports SQLAlchemy out

of the box

★ great documentation and

active community

★ add’s some fresh air to your

architecture

why ?

Page 49: EuroPython 2011 - How to build complex web applications having fun?

★ Pyramid CRUD

★ Multi-upload widget

★ Metric units widget

★ Autocomplete widget

★ Multi-relation widget

★ ... and more

★ 75% jQuery code

why ?

Page 50: EuroPython 2011 - How to build complex web applications having fun?

why ?

★ The Best CMS

★ Enterprise ready

★ 1595 addons (and counting...)

on plone.org/products

Page 51: EuroPython 2011 - How to build complex web applications having fun?

★ Poi

★ Diazo

★ LinguaPlone

★ PloneFormGen

★ The Best CMS

★ Enterprise ready

★ 1595 addons (and counting...)

on plone.org/products

why ?

Page 52: EuroPython 2011 - How to build complex web applications having fun?

★ Poi

★ Diazo

★ LinguaPlone

★ PloneFormGen

★ The Best CMS

★ Enterprise ready

★ 1595 addons (and counting...)

on plone.org/products

why ?

Page 53: EuroPython 2011 - How to build complex web applications having fun?

★ Poi

★ Diazo

★ LinguaPlone

★ PloneFormGen

★ The Best CMS

★ Enterprise ready

★ 1595 addons (and counting...)

on plone.org/products

why ?

Page 54: EuroPython 2011 - How to build complex web applications having fun?

★ Poi

★ Diazo

★ LinguaPlone

★ PloneFormGen

★ The Best CMS

★ Enterprise ready

★ 1595 addons (and counting...)

on plone.org/products

why ?

Page 55: EuroPython 2011 - How to build complex web applications having fun?

★ Poi

★ Diazo

★ LinguaPlone

★ PloneFormGen

★ The Best CMS

★ Enterprise ready

★ 1595 addons (and counting...)

on plone.org/products

why ?

Page 56: EuroPython 2011 - How to build complex web applications having fun?

★ Poi

★ Diazo

★ LinguaPlone

★ PloneFormGen

★ The Best CMS

★ Enterprise ready

★ 1595 addons (and counting...)

on plone.org/products

why ?

Page 57: EuroPython 2011 - How to build complex web applications having fun?

★ Poi

★ Diazo

★ LinguaPlone

★ PloneFormGen

★ The Best CMS

★ Enterprise ready

★ 1595 addons (and counting...)

on plone.org/products

why ?

Page 58: EuroPython 2011 - How to build complex web applications having fun?

★ Poi

★ Diazo

★ LinguaPlone

★ PloneFormGen

★ The Best CMS

★ Enterprise ready

★ 1595 addons (and counting...)

on plone.org/products

why ?

Page 59: EuroPython 2011 - How to build complex web applications having fun?

Integrat ion

Page 60: EuroPython 2011 - How to build complex web applications having fun?

PostgreSQL

aeterna.models

SQ LA l chemy

Page 61: EuroPython 2011 - How to build complex web applications having fun?

auth storage

au then t i c a t ion - au thor iza t ionR

eque

st

PostgreSQL

repoze.who

pas.plugins.sa

Page 62: EuroPython 2011 - How to build complex web applications having fun?

auth storage

au then t i c a t ion - au thor iza t ion

★ users

★ groups

★ roles

PostgreSQL

single-sign-on

★ plone.session

★ repoze.who.plugins.auth_tkt

mod_auth_tkt

Page 63: EuroPython 2011 - How to build complex web applications having fun?

bu i l dout

[intranet-plone]

recipe = plone.recipe.zope2instance

eggs =

${intranet-plone:eggs} aeterna.models

[intranet-pyramid]

recipe = zc.recipe.egg

eggs =

${intranet-pyramid:eggs} aeterna.models

Page 64: EuroPython 2011 - How to build complex web applications having fun?

intranetextranet

T he b ig p i c ture

PostgreSQL

ZODB

Apa

che

repoze.who

pas.plugins.sa

beaker

Page 65: EuroPython 2011 - How to build complex web applications having fun?

why not other compet i tors?

Page 66: EuroPython 2011 - How to build complex web applications having fun?

django: no!★ less code more magic

★ not so flexible

(specification is growing)

★ using SQLAlchemy

could be tricky

Page 67: EuroPython 2011 - How to build complex web applications having fun?

drupal : no!★ security problems

(370 CVE entries)

★ integration is more

difficult

(PHP vs. Python)

★ missing features -

workflow, complex ACL, etc.

Page 68: EuroPython 2011 - How to build complex web applications having fun?

openerp : hmm★ quite complex: CRM, sales,

accounting and much more

★ not enough time

to fully investigate it

Page 69: EuroPython 2011 - How to build complex web applications having fun?

What matters

Page 70: EuroPython 2011 - How to build complex web applications having fun?

Proper Tools

Page 71: EuroPython 2011 - How to build complex web applications having fun?

Proper ROLES

Page 72: EuroPython 2011 - How to build complex web applications having fun?

What's next?

Page 73: EuroPython 2011 - How to build complex web applications having fun?

Pyramid CRUD

★ started from Sergey Volobuev

Kelpie (repoze.bfg crud prototype)

★ using SQLAlchemy, Formalchemy

and fa.jquery

★ known as pyramid_formalchemy

Page 74: EuroPython 2011 - How to build complex web applications having fun?

★ what is accomplished:

★ events hooks

★ view and action customizations

★ i18n support

★ autocomplete widget

★ paster templates

★ plans:

★ fanstatic integration

Sprint summary

Page 75: EuroPython 2011 - How to build complex web applications having fun?

>>> $ pip install pyramid_formalchemy

>>> $ paster create -t pyramid_fa myapp

pa s t er t emp la t e

more details:http://blog.redturtle.it/redturtle-blog/pyramid-crud-sprint-summary

Page 76: EuroPython 2011 - How to build complex web applications having fun?

★ sprinters:

★ Gaël Pasgrimaud [gawel]

★ Patrick Gerken [do3cc]

★ Me [amleczko]

★ new version of:

★ pyramid_formalchemy 0.4

★ fa.jquery 0.9.4

Sprint summary

Page 77: EuroPython 2011 - How to build complex web applications having fun?

Quest ions?