Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
38b263f
chore(package): update uglify-js to version 2.8.13 (#627)
greenkeeper[bot] Mar 16, 2017
12484c7
Remove confusing main/__init__.py (#626)
rbubley Mar 18, 2017
ee42a1a
Pre-release version 5.8.1
lipis Mar 18, 2017
a17f0f6
chore(package): update uglify-js to version 2.8.14 (#628)
greenkeeper[bot] Mar 19, 2017
c08a54d
chore(package): update gulp-uglify to version 2.1.1 (#630)
greenkeeper[bot] Mar 21, 2017
b74d0c8
chore(package): update uglify-js to version 2.8.15 (#631)
greenkeeper[bot] Mar 23, 2017
3f09c12
chore(package): update uglify-js to version 2.8.16 (#632)
greenkeeper[bot] Mar 25, 2017
caecb94
chore(package): update uglify-js to version 2.8.17 (#635)
greenkeeper[bot] Mar 28, 2017
091a5a6
chore(package): update uglify-js to version 2.8.18 (#636)
greenkeeper[bot] Mar 28, 2017
4054097
chore(package): update gulp-sourcemaps to version 2.5.0 (#637)
greenkeeper[bot] Mar 29, 2017
278f6aa
Add Trusted Hosts (#634)
gmist Mar 29, 2017
e8fb36e
Version 5.8.2
lipis Mar 30, 2017
16e0da3
chore(package): update uglify-js to version 2.8.19 (#638)
greenkeeper[bot] Mar 31, 2017
dab230d
Update uglify to latest
lipis Mar 31, 2017
4d57dc0
Pre-release version 5.8.3
lipis Apr 1, 2017
8acf12e
Log the URL of the Error (#640)
lipis Apr 1, 2017
152abe8
Update jQuery/Moment
lipis Apr 1, 2017
4ffc6a6
chore(package): update gulp-sourcemaps to version 2.5.1 (#642)
greenkeeper[bot] Apr 3, 2017
02d9f13
chore(package): update uglify-js to version 2.8.21 (#641)
greenkeeper[bot] Apr 5, 2017
e668b01
Replace livereload with Browsersync (#639)
lipis Apr 5, 2017
609df8b
Version 5.9.0
lipis Apr 6, 2017
8842afa
Merge branch 'master' of github.com:gae-init/gae-init
lipis Apr 8, 2017
18329f2
Prettier
lipis Feb 22, 2018
a57315a
Sync with upstream
lipis Feb 22, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
env:
browser: true
node: true

plugins:
- prettier

extends:
- prettier

parserOptions:
ecmaVersion: 8
sourceType: module
ecmaFeatures:
jsx: true

rules:
curly: 2
dot-notation: 2
id-length: 2
no-const-assign: 2
no-dupe-class-members: 2
no-else-return: 2
no-inner-declarations: 2
no-lonely-if: 2
no-magic-numbers: [2, {ignore: [-1, 0, 1]}]
no-shadow: 2
no-unneeded-ternary: 2
no-unused-expressions: 2
no-unused-vars: [2, {args: none}]
no-useless-return: 2
no-var: 2
one-var: [2, never]
prefer-arrow-callback: 2
prefer-const: 2
prefer-promise-reject-errors: 2
prettier/prettier: 2
sort-imports: 2
sort-keys: [2, asc, {caseSensitive: true, natural: true}]
sort-vars: 2
strict: [2, global]
15 changes: 15 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bracketSpacing: false
jsxBracketSameLine: false
printWidth: 80
proseWrap: never
requirePragma: false
semi: true
singleQuote: true
tabWidth: 2
trailingComma: all
useTabs: false

overrides:
- files: "*.json"
options:
printWidth: 200
65 changes: 27 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,39 @@
gae-init-debug
==============
# gae-init-debug

[![Slack Status](https://gae-init-slack.herokuapp.com/badge.svg)](https://gae-init-slack.herokuapp.com)
[![Slack Status](https://gae-init-slack.herokuapp.com/badge.svg)](https://gae-init-slack.herokuapp.com) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

**gae-init-debug** is the easiest boilerplate to kick start new applications on Google
App Engine using Python, Flask, RESTful, Bootstrap, Flask Debug-toolbar, gae_mini_profiler
and tons of other cool features.
**gae-init-debug** is the easiest boilerplate to kick start new applications on Google App Engine using Python, Flask, RESTful, Bootstrap, Flask Debug-toolbar, gae_mini_profiler and tons of other cool features.

Read the [documentation][], where you can find a complete [feature list][],
a detailed [tutorial][], the [how to][] section and more..
Read the [documentation][], where you can find a complete [feature list][], a detailed [tutorial][], the [how to][] section and more..

The latest version is always accessible from
[http://debug.gae-init.appspot.com](http://debug.gae-init.appspot.com)
The latest version is always accessible from [http://debug.gae-init.appspot.com](http://debug.gae-init.appspot.com)

Requirements
------------
## Requirements

- [Google App Engine SDK for Python][]
- [Node.js][], [pip][], [virtualenv][]
- [macOS][] or [Linux][] or [Windows][]
* [Google App Engine SDK for Python][]
* [Node.js][], [pip][], [virtualenv][]
* [macOS][] or [Linux][] or [Windows][]

Make sure you have all of the above or refer to the docs on how to
[install the requirements](http://docs.gae-init.appspot.com/requirement/).
Make sure you have all of the above or refer to the docs on how to [install the requirements](http://docs.gae-init.appspot.com/requirement/).

Running the Development Environment
-----------------------------------
## Running the Development Environment

```bash
$ cd /path/to/project-name
$ gulp
```

To test it visit `http://localhost:8080/` in your browser.
To test it visit `http://localhost:3000` in your browser.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---

For a complete list of commands:

```bash
$ gulp help
```

Initializing or Resetting the project
------------------------------------
## Initializing or Resetting the project

```bash
$ cd /path/to/project-name
Expand All @@ -58,16 +49,15 @@ $ npm install
$ gulp
```

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---

To install [Gulp][] as a global package:

```bash
$ npm install -g gulp
```

Deploying on Google App Engine
------------------------------
## Deploying on Google App Engine

```bash
$ gulp deploy
Expand All @@ -76,18 +66,17 @@ $ gulp deploy --project=foo --version=bar
$ gulp deploy --project=foo --version=bar --no-promote
```

Tech Stack
----------

- [Google App Engine][], [NDB][]
- [Jinja2][], [Flask][], [Flask-RESTful][], [Flask-WTF][]
- [CoffeeScript][], [Less][]
- [Bootstrap][], [Font Awesome][], [Social Buttons][]
- [jQuery][], [Moment.js][]
- [OpenID][] sign in (Google, Facebook, Twitter and more)
- [Python 2.7][], [pip][], [virtualenv][]
- [Gulp][], [Bower][]
- [Flask DebugToolbar][], [gae_mini_profiler][]
## Tech Stack

* [Google App Engine][], [NDB][]
* [Jinja2][], [Flask][], [Flask-RESTful][], [Flask-WTF][]
* [CoffeeScript][], [Less][]
* [Bootstrap][], [Font Awesome][], [Social Buttons][]
* [jQuery][], [Moment.js][]
* [OpenID][] sign in (Google, Facebook, Twitter and more)
* [Python 2.7][], [pip][], [virtualenv][]
* [Gulp][], [Bower][]
* [Flask DebugToolbar][], [gae_mini_profiler][]

[bootstrap]: http://getbootstrap.com/
[bower]: http://bower.io/
Expand Down
11 changes: 4 additions & 7 deletions bin/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
Command Line Scripts
====================
# Command Line Scripts

Requirements
------------
## Requirements

You can install the requirements easily by executing the following scripts using
`curl` & `bash`:
You can install the requirements easily by executing the following scripts using `curl` & `bash`:

### [Cloud Shell](https://cloud.google.com/shell/)
### [Cloud Shell](https://cloud.google.com/shell/)

All requirements are met, out of the box.

Expand Down
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "gae-init",
"dependencies": {
"bootstrap": "3.3.7",
"font-awesome": "4.7.0",
"jquery": "3.1.1",
"moment": "2.17.1"
"jquery": "3.3.1",
"moment": "2.20.1"
},
"name": "gae-init",
"overrides": {
"bootstrap": {
"main": ["less/**", "fonts/*", "js/*"]
Expand Down
2 changes: 2 additions & 0 deletions gulp/config.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
paths = require './paths'

config =
host: "127.0.0.1"
port: "8080"
ext: [
"#{paths.static.ext}/jquery/dist/jquery.js"
"#{paths.static.ext}/moment/moment.js"
Expand Down
7 changes: 7 additions & 0 deletions gulp/tasks/build.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
gulp = require('gulp-help') require 'gulp'
yargs = require 'yargs-parser'
$ = require('gulp-load-plugins')()
config = require '../config'
paths = require '../paths'


Expand Down Expand Up @@ -55,6 +56,12 @@ gulp.task 'run',
else
options_str += " -#{k} #{options[k]}"

if options['p']
config.port = options['p']
if options['o']
config.host = options['o']

gulp.start('browser-sync')
gulp.src('run.py').pipe $.start [{
match: /run.py$/
cmd: "python run.py #{options_str}"
Expand Down
1 change: 1 addition & 0 deletions gulp/tasks/script.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ gulp.task 'script', false, ->
.pipe $.plumber errorHandler: util.onError
.pipe $.if is_coffee, $.coffee()
.pipe $.concat 'script.js'
.pipe $.babel presets: ['es2015']
.pipe $.uglify()
.pipe $.size {title: 'Minified scripts'}
.pipe gulp.dest "#{paths.static.min}/script"
Expand Down
10 changes: 7 additions & 3 deletions gulp/tasks/watch.coffee
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
gulp = require('gulp-help') require 'gulp'
browserSync = require('browser-sync')
$ = require('gulp-load-plugins')()
config = require '../config'
paths = require '../paths'


gulp.task 'reload', false, ->
$.livereload.listen 35729
gulp.task 'browser-sync', false, ->
browserSync.init
proxy: "#{config.host}:#{config.port}"
notify: false
$.watch [
"#{paths.static.dev}/**/*.{css,js}"
"#{paths.main}/**/*.{html,py}"
], events: ['change'], (file) ->
$.livereload.changed file
browserSync.reload()


gulp.task 'ext_watch_rebuild', false, (callback) ->
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ $ = require('gulp-load-plugins')()
gulp.task 'default',
'Start the local server, watch for changes and reload browser automatically.
For available options refer to "run" task.',
$.sequence 'run', ['watch', 'reload']
$.sequence 'run', ['watch']
13 changes: 0 additions & 13 deletions main/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion main/api/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def make_response(data, marshal_table, cursors=None):
'status': 'success',
'count': len(data),
'now': datetime.utcnow().isoformat(),
'result': map(lambda l: flask_restful.marshal(l, marshal_table), data),
'result': [flask_restful.marshal(d, marshal_table) for d in data],
}
if cursors:
if isinstance(cursors, dict):
Expand Down
18 changes: 12 additions & 6 deletions main/appengine_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@

import os
import sys
import tempfile

from path_util import sys_path_insert

tempfile.SpooledTemporaryFile = tempfile.TemporaryFile

if os.environ.get('SERVER_SOFTWARE', '').startswith('Google App Engine'):
sys.path.insert(0, 'lib.zip')
sys_path_insert('lib.zip')
else:
if os.name == 'nt':
os.name = None
sys.platform = ''

import re
from google.appengine.tools.devappserver2.python import stubs
from google.appengine.tools.devappserver2.python import runtime

re_ = stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', '')
re_ = runtime.stubs.FakeFile._skip_files.pattern.replace('|^lib/.*', '')
re_ = re.compile(re_)
stubs.FakeFile._skip_files = re_
sys.path.insert(0, 'lib')
sys.path.insert(0, 'libx')
runtime.stubs.FakeFile._skip_files = re_
sys_path_insert('lib')

sys_path_insert('libx')


def webapp_add_wsgi_middleware(app):
Expand Down
3 changes: 2 additions & 1 deletion main/auth/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def current_user_id():


def current_user_key():
return flask_login.current_user.user_db.key if flask_login.current_user.user_db else None
return flask_login.current_user.user_db.key \
if flask_login.current_user.user_db else None


def current_user_db():
Expand Down
2 changes: 2 additions & 0 deletions main/auth/azure_ad.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# coding: utf-8

from __future__ import absolute_import

import flask
import jwt

Expand Down
2 changes: 2 additions & 0 deletions main/auth/bitbucket.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# coding: utf-8

from __future__ import absolute_import

import flask

import auth
Expand Down
2 changes: 2 additions & 0 deletions main/auth/dropbox.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# coding: utf-8

from __future__ import absolute_import

import flask

import auth
Expand Down
2 changes: 2 additions & 0 deletions main/auth/facebook.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# coding: utf-8

from __future__ import absolute_import

import flask

import auth
Expand Down
2 changes: 2 additions & 0 deletions main/auth/github.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# coding: utf-8

from __future__ import absolute_import

import flask

import auth
Expand Down
2 changes: 2 additions & 0 deletions main/auth/google.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# coding: utf-8

from __future__ import absolute_import

import flask

import auth
Expand Down
2 changes: 2 additions & 0 deletions main/auth/instagram.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# coding: utf-8

from __future__ import absolute_import

import flask

import auth
Expand Down
Loading