Git Product home page Git Product logo

greatformsoffire's Introduction

Great Forms Of Fire

Simple sample application to show the use of Parenchym.

It also shows how an AngularJS application can be integrated into the Mako templates of the Python application, based on Google's Angular Material Start (slightly changed and corrected).

We setup a complete environment to develop JavaScript code comfortably: compile SASS, concat and minify JavaScript, reload the browser etc with gulp.

Being a simple sample, we hard-wire the resource tree. If you want to use the prepared resource tree from Parenchym in the database (as you must if you want authentication, ACLs etc.), use Parenchym's root factory instead. See comments in greatformsoffire/__init__.py and greatformsoffire/res/models.py for details.

Installation

Python Virtual Environment

Create one and activate it:

pyvenv greatformsoffire-py3.4-venv
source greatformsoffire-py3.4-venv/bin/activate
     # or: workon greatformsoffire-py3.4-venv

pip install -U pip

Clone this repository and install it in development mode:

git clone https://github.com/dmdm/GreatFormsOfFire
cd GreatFormsOfFire
pip install -e .

For the remaining installation steps, make sure you are in the project directory GreatFormsOfFire!

Directories and Permissions

Configure bin/setup_dirs to your needs and run it (maybe use sudo).

Create and init Database

We use PostgreSQL by default. Change these steps to match your server.

  1. Run SQL script install/db/create_database.sql to create an user account and the database itself.

  2. Create a subdirectory for the configuration of your host in etc/, e.g. by duplicating etc/Morrigan and create a file rcsecrets.yaml in the appropriate directory for your environment. See etc/Morrigan/development/rcsecrets.yaml-sample for an example. Adjust the SQLAlchemy URL.

  3. Run pym-init-db -c development.ini

Running

Development

Run the development server with

$VENV/bin/pserve development.ini

It listens to 0.0.0.0:6543 which you directly can access in your browser at http://localhost:6543.

If you want to use file watchers to automatically compile SASS etc. and reload the browser, in another console run

gulp serve

Production

Run the production server with

$VENV/bin/pserve production.ini

It listens to 127.0.0.1:7100 which you directly can access in your browser at http://localhost:6543.

You may want to build the distribution version of the client app (e.g. concatenated and minified JavaScript etc) with

gulp serve:dist

In case you want for production a different web server than Waitress, e.g. gunicorn, look at etc/Morrigan for sample configuration.

Misc Hints

1/

Add static files, like images etc to client/src/assets/img, and not to greatformsoffire/static. The latter is a symlink that points to the former and changes for production/development.

2/

You may use this simple sample as a starter for your own project. Perform global search and replace on "GreatFormsOfFire", "greatformsoffire" and "gfof".

TODO

Setup testing environment, behave, karma etc.

greatformsoffire's People

Watchers

James Cloos avatar Dirk Makowski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.