Serves as starting point for building applications using the nx.viper framework.
- Python 3.6
Optional
- MySQL / MariaDB
- SMTP server
- 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
- Create a virtual environment using virtualenv and activate it
- Install dependencies with
pip install -r requirements.txt
- Duplicate
config/local.json.dist
toconfig/local.json
- Configure
config/local.json
- optional - Create a new MySQL database with the contents of
script/sql/base.sql
andscript/sql/up.sql
To start the application use twistd by running:
twistd -ny service.tac
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.
Viper is currently in Beta stage.
The roadmap before public release is:
- Documentation