Skip to content

Commit

Permalink
Bootstrap project
Browse files Browse the repository at this point in the history
- Basic Flask app
- 3 views Home, Login, Secret using ui.router
  • Loading branch information
nguyenkims committed Dec 12, 2015
1 parent 00b4de3 commit 602924e
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
@@ -0,0 +1,11 @@
# pycharm
.idea/

# database
*.sqlite

# bower dependencies
bower_components/

# virtualenv
venv/
22 changes: 22 additions & 0 deletions README.md
@@ -0,0 +1,22 @@
This webapp requires these programs:

- Python 2.7.*
- pip
- virtualenv
- bower

Activate virtualenv

> virtualenv venv
> source venv/bin/activate
Install all required Python libraries

> pip install -r requirements.txt
Install all required JS libraries

> cd static/
> bower install
Enjoy!
18 changes: 18 additions & 0 deletions app.py
@@ -0,0 +1,18 @@
import flask
from flask import Flask

app = Flask(__name__)


@app.route('/islive')
def islive():
return "it's live"


@app.route('/')
def index():
return flask.redirect('/static/index.html')


if __name__ == '__main__':
app.run(debug=True)
4 changes: 4 additions & 0 deletions requirements.txt
@@ -0,0 +1,4 @@
Flask==0.10.1
PyJWT==1.4.0
Flask-SQLAlchemy==1.0
requests==2.7.0
25 changes: 25 additions & 0 deletions static/bower.json
@@ -0,0 +1,25 @@
{
"name": "demo satellizer",
"version": "0.0.0",
"homepage": "https://github.com/nguyenkims/satellizer-demo",
"authors": [
"Son Nguyen Kim"
],
"description": "a simple webapp with regular and facebook login",
"keywords": [
"satellizer",
"angularjs"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": "angularjs#~1.4.8",
"angular-ui-router": "~0.2.15"
}
}
19 changes: 19 additions & 0 deletions static/index.html
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo Satellizer</title>
</head>
<body ng-app="DemoApp">

<a ui-sref="home">Home</a>
<a ui-sref="login">Login</a>
<a ui-sref="secret">Secret</a>

<div ui-view></div>

<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="main.js"></script>
</body>
</html>
21 changes: 21 additions & 0 deletions static/main.js
@@ -0,0 +1,21 @@
var app = angular.module('DemoApp', ['ui.router']);

app.config(function ($stateProvider, $urlRouterProvider) {

$stateProvider
.state('home', {
url: '/home',
templateUrl: 'partials/home.tpl.html'
})
.state('secret', {
url: '/secret',
templateUrl: 'partials/secret.tpl.html',
})
.state('login', {
url: '/login',
templateUrl: 'partials/login.tpl.html'
});

$urlRouterProvider.otherwise('/home');

});
1 change: 1 addition & 0 deletions static/partials/home.tpl.html
@@ -0,0 +1 @@
Home
1 change: 1 addition & 0 deletions static/partials/login.tpl.html
@@ -0,0 +1 @@
Login
1 change: 1 addition & 0 deletions static/partials/secret.tpl.html
@@ -0,0 +1 @@
Secret

0 comments on commit 602924e

Please sign in to comment.