Skip to content

Application Templates

Lucas Rebscher edited this page Feb 1, 2021 · 13 revisions

Choosing Templates

If you create a new application, you can choose templates that are used to generate the application scaffold.

Running harness-application --help will list the currently available templates:

usage: harness-application [-h] [-t TEMPLATES] name

Creates a new Application.

positional arguments:
  name                  Application name

optional arguments:
  -h, --help            show this help message and exit
  -t TEMPLATES, --template TEMPLATES
                        Add a template name. Available templates: - base (backend flask app based on openapi, always included) - webapp (webapp including backend and frontend) - db-postgres - db-neo4j - db-mongo

Available Templates

Base

  • The base template is always included and used as foundation for any other template.
  • It consists of a single backend, a Python Flask application.
  • The Connexion library maps the OpenAPI definition to Flask routing.
  • Per default, Gunicorn serves the Flask app with 2 synchronous workers. Depending on the application requirements, you can update the number of workers or choose a different worker type.

Webapp

  • The webapp template consists builds upon the base template extends it by a React frontend application.
  • The generated frontend bundle is served by the Python backend.
  • Per default, React is used as a frontend application, but you are free to choose a different frontend technology.

Databases

Additionally, you can choose one of the following database templates:

  • db-postgres - PostgreSQL, a relational database
  • db-neo4j- Neo4J, a graph database
  • db-mongo - MongoDB, a NoSQL document-based database