Skip to content

It's a simple multilingual application boilerplate for developer who interested in Canjs and Flask combination.

Notifications You must be signed in to change notification settings

kdsull/flask-canjs-i18n-boilerplate

 
 

Repository files navigation

Flask-Canjs-i18n-Boilerplate

Flask-Canjs-i18n-Boilerplate

It's a simple multilingual application boilerplate for developer who interested in Canjs and Python Flask combination. Flask part is inspired by Matt Wright's article.

Features

  • Flask/Canjs combination.
  • Internationalization ready.
  • Uesr CRUD implementation.
  • User following/followers function implementation.
  • Social connection implementation.
    1. facebook
    2. others (TODO)
  • RESTful API implementation.
  • Responsive web design.
  • Google's crawler friendly url('#!').
  • Generate document easily.(Sphinx)
  • Do testing easily. (nosetests)
  • Cross Browser Compatibility (IE7, IE8, IE9, IE10, Firefox, Chrome, Opera..)
  • Do you need more Features? Fork it and improve it! :D

Live application

http://flask-canjs-i18n-boilerplate.hp.af.cm/

  • Facebook connection not available. Because Facebook said 'Site URL has been been identified as malicious and/or abusive'.

How it works?

flask-canjs-i18n-boilerplate

Environment

Client side

  • Canjs, Client-side JavaScript Framework.
  • RequireJS, JavaScript file and module loader.
  • RequireJS Optimizer, Optimization tool of RequireJS.
  • Initializr, HTML5 templates generator.
  • Bootstrap, Front-end framework.
  • Bootstrap-ie7, Bootstrap 3 for IE7.
  • mustache, Logic-less templates.
  • i18next, JavaScript translating toolkit.
  • Font Awesome, It gives you scalable vector icons that can instantly be customized.
  • typeahead.js, It is a fast and fully-featured autocomplete library.
  • spin.js, It dynamically creates spinning activity indicators that can be used as resolution-independent replacement for AJAX loading GIFs.
  • Placeholders.js, It is a JavaScript polyfill for the HTML5 placeholder attribute.
  • Jade(pyjade), High performance port of Jade-lang for python.
  • jQuery, It is a fast, small, and feature-rich JavaScript library.
  • jQuery BBQ, It leverages the HTML5 hashchange event to allow simple, yet powerful bookmarkable #hash history.

Server side

  • Flask, Microframework for Python based on Werkzeug, Jinja 2 and good intentions.
  • Flask-Babel, Extension to Flask that adds i18n and l10n support to any Flask application.
  • Flask-Gravatar, It's small and simple integration gravatar into flask.
  • Flask-Security,It allows you to quickly add common security mechanisms to your Flask application.
  • Flask-Social, Oauth provider login and APIs for use with Flask-Security.
  • Flask-Assets, Flask-Assets helps you to integrate webassets into your Flask application.
  • Flask-SQLAlchemy, Extension for Flask that adds support for SQLAlchemy.
  • Flask-WTF, It offers simple integration with WTForms.
  • Flask-Cache, It helps you to integrate cache into your Flask appication.
  • Alembic, Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.
  • Celery, Celery is an asynchronous task queue/job queue based on distributed message passing.

Debugging & Testing

  • flask-debugtoolbar, It is a port of the excellent django-debug-toolbar for Flask applications.
  • nose, It is nicer testing for python.
  • BusterJS, JavaScript testing toolkit.

Documentation Generating

  • Sphinx, Sphinx is a tool that makes it easy to create intelligent and beautiful documentation.
  • JSDoc, An inline API documentation processor for JavaScript.

Installation

Install tools

  • virtualenv, It is a tool to create isolated Python environments.
  • virtualenvwrapper, It' provides a set of commands which makes working with virtual environments much more pleasant.

Clone the project

$ git clone https://github.com/dorajistyle/flask-canjs-i18n-boilerplate.git
$ cd flask-canjs-i18n-boilerplate.git

Create virtualenv for the project

$ mkvirtualenv flask-canjs-i18n-boilerplate

Install libraries

$ pip install -r requirements.txt

Migrate database

$ alembic revision --autogenerate -m "Alembic initilized boilerplate tables."
$ alembic upgrade head

Add administrator user

You can login with 'admin@github.com' and 'password'.

$ python manage.py init_user

Setting

You should set values properly.(database, mail, social providers...)
  • application/settings.py contain server side settings.
  • application/frontend/static/js/settings.js contain client side settings.
  • ./alembic.ini contain alembic settings.

Translation

  • Server side translations(Babel) in applications/frontend/translations
  • Client side translations(i18next) in applications/frontend/static/locales

Babel translations compile

$ python tr_compile.py

Usage

Run the application

$ python wsgi.py

Generate documents

$ python generate_documents.py

Optimize static folder

You should install Nodejs and RequireJS. If you want detail document, Click RequireJS Optimizer.

$ optimize_static.sh

Tests

$ nosetests

You can use test script as well.

$ python run_nosetests.py

Attributions

Flask-canjs-i18n-boilerplate is under the MIT license.

About

It's a simple multilingual application boilerplate for developer who interested in Canjs and Flask combination.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published