How to build complex
web applications having   fun?
author
         Andrew Mleczko
         Software Integrator
         Ferrara (Italy)
         twitter: amleczko
         amleczko@redturtle.it
the   team
WHY this talk?
My Reasons to be here
★   Building   complex web
    applications could be   fun

★   Architectural    decisions are
    more important than     you
    think


★   Promote

               and
★   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
★   available in more than   40 languages
★   the   best security track record of any major CMS
powered
the growing   community
SMALL   “Roughly 5000 lines
             of code”
SMALL   “Roughly 5000 lines
             of code”
FAST
SMALL    “Roughly 5000 lines
              of code”
FAST
STABLE
SMALL    “Roughly 5000 lines
              of code”
FAST
                “100% statement
STABLE
               coverage via unit and
TESTED           integration tests”
SMALL        “Roughly 5000 lines
                  of code”
FAST
                    “100% statement
STABLE
                   coverage via unit and
TESTED               integration tests”


DOCUMENTED    “Literally nothing
                  in Pyramid
              is undocumented”
The   Bad   story
Th e Cus to mer
★   Large    public sectore
    entity


★   >   1000 employees

★   Needs a complex   intranet

★   Deadline:   2 years
T he T eam
Th e T eam
             ★   Mixed    roles:

                          Software
                          architect

                                           Project
                 Tester                    manager



                              Developer


             ★   No development       philosophy
t ec h no lo g y
★   Temptation to be on the

    technological   edge

★   The   Learning      Curve Effect

    everything is a “prototype”


★   Technical design   debt   is...


           ... more then average
bad deci si ons
             ★   Project manager as

                 Software architect as
                 Tester

             ★ Technology didn't

                 fit in

             ★
                 no   fun at all
The Good Story
The Customer
★   .


★   Born as a startup


★   Offices in Miami,

    New York and Los Angeles
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”
project requirements
paperless sale
1      CRM



2     Sales



3   Warehouse



4   E-commerce



5    Support
paperless sale
1      CRM       ★   Customer’s management
                     (satisfaction, order status,
                     etc.)
2     Sales
                 ★   Reports (machine statistics,
                     etc.)
3   Warehouse
                 ★   Campaigns

4   E-commerce



5    Support
paperless sale
1      CRM       ★   Sales network management


                 ★   Invoicing / accountancy
2     Sales
                 ★   Revenue counter

3   Warehouse    ★   Discount management


4   E-commerce



5    Support
paperless sale
1      CRM       ★   Catalog management


                 ★   Warehouse management
2     Sales
                 ★   Logistic tracking

3   Warehouse



4   E-commerce



5    Support
paperless sale
1      CRM       ★   Online shop (for beverages
                     and accessories)


2     Sales      ★   Machine configurator
                     (interactive wizard)

3   Warehouse    ★   Online payments



4   E-commerce



5    Support
paperless sale
1      CRM       ★   Machine maintenance (filter
                     change)


2     Sales      ★   Emergency services


                 ★   Order / installation process
3   Warehouse



4   E-commerce



5    Support
paperless sale
1      CRM       ★   Machine maintenance (filter
                     change)


2     Sales      ★   Emergency services


                 ★   Order / installation process
3   Warehouse



4   E-commerce



5    Support
paperless sale


    Warehouse     Support



      CRM        E-commerce




      Sales
paperless sale
   Intranet      Extranet

    Warehouse     Support



      CRM        E-commerce




      Sales
Totally paperless ERP
project gotchas
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
proj ect backg round
The DEV TEAM
★   Software architect

    ★   database design

    ★   integration layer (data,
        authentication)

★   Developers

    ★   Plone team

    ★   Pyramid team
★   Prototyping - the good way

★   Collecting specification and

    keeping docs up-to-date

★   Software development having

    fun
Arc hi t e ct u ral dec i si ons
and
why                                   ?
★   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                         ?
★   Pyramid CRUD

    ★   Multi-upload widget

    ★   Metric units widget

    ★   Autocomplete widget

    ★   Multi-relation widget

    ★   ... and more

    ★   75% jQuery code
why                             ?
★   The Best CMS


★   Enterprise ready


★   1595 addons (and counting...)
    on plone.org/products
why                             ?
★   The Best CMS


★   Enterprise ready


★   1595 addons (and counting...)
    on plone.org/products

     ★   PloneFormGen

     ★   Poi

     ★   Diazo

     ★   LinguaPlone
why                             ?
★   The Best CMS


★   Enterprise ready


★   1595 addons (and counting...)
    on plone.org/products

     ★   PloneFormGen

     ★   Poi

     ★   Diazo

     ★   LinguaPlone
why                             ?
★   The Best CMS


★   Enterprise ready


★   1595 addons (and counting...)
    on plone.org/products

     ★   PloneFormGen

     ★   Poi

     ★   Diazo

     ★   LinguaPlone
why                             ?
★   The Best CMS


★   Enterprise ready


★   1595 addons (and counting...)
    on plone.org/products

     ★   PloneFormGen

     ★   Poi

     ★   Diazo

     ★   LinguaPlone
why                             ?
★   The Best CMS


★   Enterprise ready


★   1595 addons (and counting...)
    on plone.org/products

     ★   PloneFormGen

     ★   Poi

     ★   Diazo

     ★   LinguaPlone
why                             ?
★   The Best CMS


★   Enterprise ready


★   1595 addons (and counting...)
    on plone.org/products

     ★   PloneFormGen

     ★   Poi

     ★   Diazo

     ★   LinguaPlone
why                             ?
★   The Best CMS


★   Enterprise ready


★   1595 addons (and counting...)
    on plone.org/products

     ★   PloneFormGen

     ★   Poi

     ★   Diazo

     ★   LinguaPlone
why                             ?
★   The Best CMS


★   Enterprise ready


★   1595 addons (and counting...)
    on plone.org/products

     ★   PloneFormGen

     ★   Poi

     ★   Diazo

     ★   LinguaPlone
I nt eg r at i o n
SQL A lchemy

         aeterna.models




         PostgreSQL
authentication - authorization
           auth storage
 Request




            pas.plugins.sa




             repoze.who




            PostgreSQL
authentication - authorization
      auth storage        single-sign-on
 ★   users           ★   plone.session

                     ★   repoze.who.plugins.auth_tkt
 ★   groups

 ★   roles
                            mod_auth_tkt



       PostgreSQL
buildout
[intranet-plone]
recipe = plone.recipe.zope2instance
eggs =
    ${intranet-plone:eggs} aeterna.models


[intranet-pyramid]
recipe = zc.recipe.egg
eggs =
    ${intranet-pyramid:eggs} aeterna.models
The big picture




                                                 extranet
                  pas.plugins.
                       sa

                                          ZODB
Apache




         beaker              PostgreSQL




                                                 intranet
                   repoze.
                     who
why not o t h er c o mpet i t o rs?
d j ang o :             no!
★   less   code more magic

★   not so   flexible
    (specification is growing)


★   using   SQLAlchemy
    could be tricky
d r u pal:              no!
★   security problems
    (370 CVE entries)


★   integration is more
    difficult
    (PHP vs. Python)


★   missing features -
    workflow, complex ACL, etc.
o pen erp :                   hmm
★   quite complex: CRM , sales,
    accounting and much more


★   not enough   time
    to fully investigate it
What mat t ers
Proper Tools
Proper R O L ES
What's next?
Pyramid CRUD
★   started from Sergey Volobuev
    Kelpie (repoze.bfg crud prototype)


★   using SQLAlchemy, Formalchemy
    and fa.jquery


★   known as pyramid_formalchemy
Sprint summary
                 ★   what is   accomplished:

                     ★   events hooks

                     ★   view and action customizations

                     ★   i18n support

                     ★   autocomplete widget

                     ★   paster templates

                 ★   plans:

                     ★   fanstatic integration
paster template


>>> $ pip install pyramid_formalchemy
>>> $ paster create -t pyramid_fa myapp




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

                     ★   Gaël Pasgrimaud [gawel]

                     ★   Patrick Gerken [do3cc]

                     ★   Me [amleczko]

                 ★   new version of:

                     ★   pyramid_formalchemy 0.4

                     ★   fa.jquery 0.9.4
Qu est i ons?
Credits
★   http://flickr.com/photos/mleczko

★   http://www.melaiphone.com/

★   http://static.iphoneitalia.com

★   http://www.theapplelounge.com

★   http://www.nonconvenzionale.com

★   http://craziestgadgets.com/

★   http://obsessivelystitching.blogspot.com/

★   http://theclockblog.blogspot.com/

★   http://www.scatoladeigiochi.altervista.org/

★   http://wallpapers.brothersoft.com/

★   www.prisionerodelpixel.com

★   http://jawaexpress.com/

★   http://mikehenneke.mvourtown.com/

★   http://android-apps.com/

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

  • 1.
    How to buildcomplex web applications having fun?
  • 2.
    author Andrew Mleczko Software Integrator Ferrara (Italy) twitter: amleczko amleczko@redturtle.it
  • 3.
    the team
  • 4.
  • 5.
    My Reasons tobe here ★ Building complex web applications could be fun ★ Architectural decisions are more important than you think ★ Promote and
  • 6.
    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
  • 8.
    available in more than 40 languages ★ the best security track record of any major CMS
  • 9.
  • 10.
    the growing community
  • 13.
    SMALL “Roughly 5000 lines of code”
  • 14.
    SMALL “Roughly 5000 lines of code” FAST
  • 15.
    SMALL “Roughly 5000 lines of code” FAST STABLE
  • 16.
    SMALL “Roughly 5000 lines of code” FAST “100% statement STABLE coverage via unit and TESTED integration tests”
  • 17.
    SMALL “Roughly 5000 lines of code” FAST “100% statement STABLE coverage via unit and TESTED integration tests” DOCUMENTED “Literally nothing in Pyramid is undocumented”
  • 18.
    The Bad story
  • 19.
    Th e Custo mer ★ Large public sectore entity ★ > 1000 employees ★ Needs a complex intranet ★ Deadline: 2 years
  • 20.
    T he Team
  • 21.
    Th e Team ★ Mixed roles: Software architect Project Tester manager Developer ★ No development philosophy
  • 22.
    t ec hno lo g y ★ Temptation to be on the technological edge ★ The Learning Curve Effect everything is a “prototype” ★ Technical design debt is... ... more then average
  • 23.
    bad deci sions ★ Project manager as Software architect as Tester ★ Technology didn't fit in ★ no fun at all
  • 24.
  • 25.
    The Customer ★ . ★ Born as a startup ★ Offices in Miami, New York and Los Angeles
  • 26.
    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”
  • 29.
  • 31.
    paperless sale 1 CRM 2 Sales 3 Warehouse 4 E-commerce 5 Support
  • 32.
    paperless sale 1 CRM ★ Customer’s management (satisfaction, order status, etc.) 2 Sales ★ Reports (machine statistics, etc.) 3 Warehouse ★ Campaigns 4 E-commerce 5 Support
  • 33.
    paperless sale 1 CRM ★ Sales network management ★ Invoicing / accountancy 2 Sales ★ Revenue counter 3 Warehouse ★ Discount management 4 E-commerce 5 Support
  • 34.
    paperless sale 1 CRM ★ Catalog management ★ Warehouse management 2 Sales ★ Logistic tracking 3 Warehouse 4 E-commerce 5 Support
  • 35.
    paperless sale 1 CRM ★ Online shop (for beverages and accessories) 2 Sales ★ Machine configurator (interactive wizard) 3 Warehouse ★ Online payments 4 E-commerce 5 Support
  • 36.
    paperless sale 1 CRM ★ Machine maintenance (filter change) 2 Sales ★ Emergency services ★ Order / installation process 3 Warehouse 4 E-commerce 5 Support
  • 37.
    paperless sale 1 CRM ★ Machine maintenance (filter change) 2 Sales ★ Emergency services ★ Order / installation process 3 Warehouse 4 E-commerce 5 Support
  • 38.
    paperless sale Warehouse Support CRM E-commerce Sales
  • 39.
    paperless sale Intranet Extranet Warehouse Support CRM E-commerce Sales
  • 40.
  • 41.
  • 42.
    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
  • 43.
  • 44.
    The DEV TEAM ★ Software architect ★ database design ★ integration layer (data, authentication) ★ Developers ★ Plone team ★ Pyramid team
  • 45.
    Prototyping - the good way ★ Collecting specification and keeping docs up-to-date ★ Software development having fun
  • 46.
    Arc hi te ct u ral dec i si ons
  • 47.
  • 48.
    why ? ★ 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
  • 49.
    why ? ★ Pyramid CRUD ★ Multi-upload widget ★ Metric units widget ★ Autocomplete widget ★ Multi-relation widget ★ ... and more ★ 75% jQuery code
  • 50.
    why ? ★ The Best CMS ★ Enterprise ready ★ 1595 addons (and counting...) on plone.org/products
  • 51.
    why ? ★ The Best CMS ★ Enterprise ready ★ 1595 addons (and counting...) on plone.org/products ★ PloneFormGen ★ Poi ★ Diazo ★ LinguaPlone
  • 52.
    why ? ★ The Best CMS ★ Enterprise ready ★ 1595 addons (and counting...) on plone.org/products ★ PloneFormGen ★ Poi ★ Diazo ★ LinguaPlone
  • 53.
    why ? ★ The Best CMS ★ Enterprise ready ★ 1595 addons (and counting...) on plone.org/products ★ PloneFormGen ★ Poi ★ Diazo ★ LinguaPlone
  • 54.
    why ? ★ The Best CMS ★ Enterprise ready ★ 1595 addons (and counting...) on plone.org/products ★ PloneFormGen ★ Poi ★ Diazo ★ LinguaPlone
  • 55.
    why ? ★ The Best CMS ★ Enterprise ready ★ 1595 addons (and counting...) on plone.org/products ★ PloneFormGen ★ Poi ★ Diazo ★ LinguaPlone
  • 56.
    why ? ★ The Best CMS ★ Enterprise ready ★ 1595 addons (and counting...) on plone.org/products ★ PloneFormGen ★ Poi ★ Diazo ★ LinguaPlone
  • 57.
    why ? ★ The Best CMS ★ Enterprise ready ★ 1595 addons (and counting...) on plone.org/products ★ PloneFormGen ★ Poi ★ Diazo ★ LinguaPlone
  • 58.
    why ? ★ The Best CMS ★ Enterprise ready ★ 1595 addons (and counting...) on plone.org/products ★ PloneFormGen ★ Poi ★ Diazo ★ LinguaPlone
  • 59.
    I nt egr at i o n
  • 60.
    SQL A lchemy aeterna.models PostgreSQL
  • 61.
    authentication - authorization auth storage Request pas.plugins.sa repoze.who PostgreSQL
  • 62.
    authentication - authorization auth storage single-sign-on ★ users ★ plone.session ★ repoze.who.plugins.auth_tkt ★ groups ★ roles mod_auth_tkt PostgreSQL
  • 63.
    buildout [intranet-plone] recipe = plone.recipe.zope2instance eggs= ${intranet-plone:eggs} aeterna.models [intranet-pyramid] recipe = zc.recipe.egg eggs = ${intranet-pyramid:eggs} aeterna.models
  • 64.
    The big picture extranet pas.plugins. sa ZODB Apache beaker PostgreSQL intranet repoze. who
  • 65.
    why not ot h er c o mpet i t o rs?
  • 66.
    d j ango : no! ★ less code more magic ★ not so flexible (specification is growing) ★ using SQLAlchemy could be tricky
  • 67.
    d r upal: no! ★ security problems (370 CVE entries) ★ integration is more difficult (PHP vs. Python) ★ missing features - workflow, complex ACL, etc.
  • 68.
    o pen erp: hmm ★ quite complex: CRM , sales, accounting and much more ★ not enough time to fully investigate it
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
    Pyramid CRUD ★ started from Sergey Volobuev Kelpie (repoze.bfg crud prototype) ★ using SQLAlchemy, Formalchemy and fa.jquery ★ known as pyramid_formalchemy
  • 74.
    Sprint summary ★ what is accomplished: ★ events hooks ★ view and action customizations ★ i18n support ★ autocomplete widget ★ paster templates ★ plans: ★ fanstatic integration
  • 75.
    paster template >>> $pip install pyramid_formalchemy >>> $ paster create -t pyramid_fa myapp more details: http://blog.redturtle.it/redturtle-blog/pyramid-crud-sprint-summary
  • 76.
    Sprint summary ★ sprinters: ★ Gaël Pasgrimaud [gawel] ★ Patrick Gerken [do3cc] ★ Me [amleczko] ★ new version of: ★ pyramid_formalchemy 0.4 ★ fa.jquery 0.9.4
  • 77.
  • 78.
    Credits ★ http://flickr.com/photos/mleczko ★ http://www.melaiphone.com/ ★ http://static.iphoneitalia.com ★ http://www.theapplelounge.com ★ http://www.nonconvenzionale.com ★ http://craziestgadgets.com/ ★ http://obsessivelystitching.blogspot.com/ ★ http://theclockblog.blogspot.com/ ★ http://www.scatoladeigiochi.altervista.org/ ★ http://wallpapers.brothersoft.com/ ★ www.prisionerodelpixel.com ★ http://jawaexpress.com/ ★ http://mikehenneke.mvourtown.com/ ★ http://android-apps.com/