Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.
/ gae-tap Public archive

It's a full stack framework for the Google App Engine -based. Let's finish the work quickly and go TAP BEER!

License

Notifications You must be signed in to change notification settings

michilu/gae-tap

Repository files navigation

Build Status wercker status Code Health

A full stack framework for the Google App Engine -based

Let's finish the work quickly and go TAP BEER!

Man's Beautiful Creation by Idoknow19, on Flickr

Looking for sponsors:

  1. $120 - I get 30L barrel beer!
  2. $60 - I get 15L barrel beer!
  3. $12 - I get a 1-pint beer!
  4. $6 - I get 1/2 pint beer!

Status

Features

Supports:

Low cost operating:

  • Google Drive Spreadsheets as a database via Google Visualization API
  • Google Drive Form-based feedback system
  • hosting as a proxy
    • DropBox
    • Google Drive
  • hostname-based multitenancy
    • supports robots.txt
  • just a few costs permanent caching and key-value store via taskqueue API
  • minimum OAuth accounting
  • redirecting to Google URL Shortener

Performance:

Coding:

Development:

Testing:

Utils:

  • CORS
  • CSRF guard
  • HMAC
  • e-mail reports of errors
  • fanstatic
  • handling taskqueue
  • managing cache records
  • memoize
  • ring buffer
  • token bucket

Continuous Integration Supports:

Set up

$ git clone --depth 1 https://github.com/MiCHiLU/gae-tap.git
$ cd gae-tap
$ bundle install
$ npm install
$ mkvirtualenv --python=`which python2.7` gae-tap
(gae-tap)$ pip install -r requirements.txt
(gae-tap)$ pip install -r requirements-gae.txt

Set environ

It need the GOOGLE_APPENGINE environ args. Default GOOGLE_APPENGINE as below:

GOOGLE_APPENGINE=$HOME/google-cloud-sdk/platform/google_appengine

If you want to set another path, define GOOGLE_APPENGINE in environ as below:

$ GOOGLE_APPENGINE=<path to your gae> make

Docker

Alternatively, Quickly set up environment via Docker:

$ docker pull michilu/gae-tap

First-time build

First, you must have been build core library:

(gae-tap)$ (cd gae/tap && make release)

Then, if you want to add templates of gae-tap to git repository:

$ git add \
  gae/site-packages/tap_templates_compiled.zip \
  gae/tap/static/js/admin_response_cache.js \
  gae/tap/static/js/admin_response_cache.min.js \
  gae/tap/static/js/error_page.js \
  gae/tap/static/js/error_page.min.js \
  gae/tap/static/js/utils.js \
  gae/tap/static/js/utils.min.js

Alternatively, update the core library from releases:

  1. Download gaetap-<release-number>.zip file from https://github.com/MiCHiLU/gae-tap/releases
  2. Then replace with files and directories in your repository.

If you want to start a new project with make scaffold, as below:

$ make scaffold
your project name, default 'gae-tap':     <type your project name>
your github user name, default 'MiCHiLU': <type your github user name>
your app-id, default 'gae-tap':           <type your app-id>

Build and Test

(gae-tap)$ make

Run development server

(gae-tap)$ make runserver

then access to:

iPython shell with the Google App Engine environment

First, you must be install iPython:

(gae-tap)$ pip install ipython

Then, type make shell command as below:

(gae-tap)$ make shell
Python 2.7.5 (default, Mar  9 2014, 22:15:05)
IPython 2.3.1 -- An enhanced Interactive Python.
Doctest mode is: ON
>>>

Access to the Datastore on the development environment in the iPython shell:

(gae-tap)$ make shell
>>> from google.appengine.ext import testbed
>>> tb = testbed.Testbed()
>>> tb.setup_env(app_id='dev~your-app-id')
>>> tb.activate()
>>> tb.init_datastore_v3_stub(datastore_file='../assets/tmp/datastore.db', use_sqlite=True)
>>> tb.init_memcache_stub()
>>> tb.init_taskqueue_stub()
>>> from your-app import model

Deploy

(gae-tap)$ make deploy

Auto deploy via Wercker CI:

If you want to auto-deploy to the Google App Engine, add an APP_ENGINE_TOKEN variable to Deploy pipeline of Deploy targets in your App on the Wercker CI. The APP_ENGINE_TOKEN value is a refresh_token of your $HOME/.appcfg_oauth2_tokens, like follow:

$ jq .refresh_token ~/.appcfg_oauth2_tokens
"1/ABCDEFGHIJKLMNOPQRSTUVWXYZ_1234567890"

then access to:

Dependencies

Optionals

Known issues

  • The `gcloud app Python Extensions component on the Google Cloud SDK does not include the Django package.

You can run a script:

$ ./assets/fetch_django-1.5.x.sh

You can patching to Google App Engine SDK:

$ patch -d $GOOGLE_APPENGINE -p0 -i $PWD/gae/tap/endpoints.patch

on GAE <1.9.27

You can patching to Google App Engine SDK:

$ patch -d $GOOGLE_APPENGINE -p0 -i $PWD/gae/tap/docker.patch

LICENSE

Licensed under the terms of the MIT.

Copyright (c) 2013 ENDOH takanao

About

It's a full stack framework for the Google App Engine -based. Let's finish the work quickly and go TAP BEER!

Resources

License

Stars

Watchers

Forks

Packages

No packages published