Slide 1

Slide 1 text

Web app prototypes with the App Engine Python SDK Vlad Filippov - PyCon Canada 2012

Slide 2

Slide 2 text

@vladikoff github.com/vladikoff

Slide 3

Slide 3 text

The Goals ● Build unique applications and features ● Quickly create experiences ● Well-defined and structured data store ● Epic test coverage The Problem ● Development time ● Repetitive tasks ● User experience, interface and interaction ● Setting up datastores, local development ● Developer teams, different projects

Slide 4

Slide 4 text

Prototype an application - gather.at example From https://gather.at ● Adding Entities ● Layout Views ● Filters ● Refresh UI ● ...

Slide 5

Slide 5 text

What is App Engine? How can it help?

Slide 6

Slide 6 text

Google App Engine and the Python SDK ● Ability to build and host web applications ● Preview in 2008, out of preview 2011 ○ latest release v. 1.7.3 - October 23, 2012 ● Supports Python (2.5, 2.7) ● Usage: ○ Pay for instance hours, bandwidth, storage, etc ○ Free quotas (usage limits per day) ● Over 20 built-in APIs ○ Channel (Sockets), Blobstore, Memcache .... ● Datastore ○ App Engine Datastore - NoSQL schema-less object store ○ Google Cloud SQL - relational SQL DB ○ Google Cloud Storage - storage for large objects

Slide 7

Slide 7 text

Prototyping with App Engine ● Try out application ideas ● Prepare for large projects ● Benefits of App Engine: ○ Datastore ○ Deployment - local test server & deployment server ○ User API - use Google Accounts as login ○ Saves time during setup and development ● Testing - get a head start! ● Give more time and realistic scenarios for UX

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Basic Datastore db.get([...]) db.delete([...]) db.put_async([...]) db.get_async([...])

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Things that will help you ● webapp2 ○ routing, controllers, templating ( jinja2 support ) ● appengine-rest-server ● Google Cloud Endpoints ● Import bulk data (CSV, based on your models) ● Use Google Accounts / OAuth2 ● Task Queues (background tasks) ● Appstats ● Development server ○ simulates App Engine ○ development console

Slide 14

Slide 14 text

appengine-rest-server ● Exposes your data model via a REST API ● Supports: ○ JSON (JSONP) & XML ○ individual properties /entity//property ) ○ basic filtering ○ limits results ○ metadata browsing ( /metadata/entity/ ) ● Open source! ● Great starting point

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

appengine-rest-server

Slide 18

Slide 18 text

Cloud Endpoints ● Allows you to build REST and RPC APIs ● Same infrastructure as Google APIs ○ Translate, Places, goo.gl and other APIs ● Supports OAuth2 ● Includes an API explorer ● * Ability to generate client libraries ○ JavaScript, iOS & Android ● * Tester only preview at the moment

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Cloud Endpoints - Define an API Server Define API Handlers / URLs (app.yaml)

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Prototype - Tests

Slide 24

Slide 24 text

Prototype - Sample Data

Slide 25

Slide 25 text

To conclude... ● Invest time into unique features ● Choose a workflow, optimize it ● Record the time you spend on repetitive tasks ● Reuse as much as possible in future projects ● App Engine ○ Easy to setup, great for exploring ideas! ○ Write API & UI tests, re-use ○ Basic data models, populate sample data ○ Gives the front-end team more time ○ * Helps you get into web apps & services

Slide 26

Slide 26 text

Thank you! git.io/dCeP9w @vladikoff github.com/vladikoff