Skip to content

Nixiware/viper-skeleton-application

Repository files navigation

Viper skeleton application

Introduction

Serves as starting point for building applications using the nx.viper framework.

Requirements

  • Python 3.6

Optional

  • MySQL / MariaDB
  • SMTP server

Features

  • environment based configuration
  • HTTP REST API interface
  • support for building multiple interfaces including sockets, WebSockets and anything Twisted supports
  • CRUD example
  • model example with asynchronous database operations
  • background services with scheduled and recurring operations

Usage

  1. Create a virtual environment using virtualenv and activate it
  2. Install dependencies with pip install -r requirements.txt
  3. Duplicate config/local.json.dist to config/local.json
  4. Configure config/local.json
  5. optional - Create a new MySQL database with the contents of script/sql/base.sql and script/sql/up.sql

To start the application use twistd by running:

twistd -ny service.tac

Deployment

systemd can be used for deployment. Create a new service file for the application at /etc/systemd/system/viper-application.service with the following content:

[Unit]
Description=Viper application

[Service]
ExecStart=/path/to/viper/application/venv/bin/twistd -l log/application.log -y service.tac --nodaemon --pidfile=viper-application.pid

WorkingDirectory=/path/to/viper/application

User=nobody
Group=nobody

Restart=always

[Install]
WantedBy=multi-user.target

Replace any values to match your target deployment and make sure the application is not running as root.

More details can be found in the official Twisted documentation.

Notice

Viper is currently in Beta stage.

The roadmap before public release is:

  1. Documentation

About

Skeleton application for viper framework

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published