HTTPS SSH

Synopses Server

Initial backend for an electronic patient record management system, based on Python / Flask / SQLAlchemy.

See http://synopses.ch and https://bitbucket.org/loleg/synopses-app/

Deployment

The framework for this backend server includes

Installation

0) Prerequisites

  • git
  • pip
  • fabric
  • sqlite
  • virtualenv
  • nginx with WSGI support
  • mysqllib:

sudo apt-get install libmysqlclient-dev

1) Set up environment

fab setup

2) Activate the environment

. venv/bin/activate

3) Set up the configuration

cp synopses/config.default synopses/config.py

4) Start debugger

fab d

Open http://127.0.0.1:5000 in your browser.

The database will be cleared each time in this mode. Create a new user.

Deployment (WSGI)

Set up permissions

sudo chown `whoami` -R synopses

Set up virtual host

TBD

Install

fab setup

Configure

  • Change INSTANCE_FOLDER_PATH in utils.py.
  • Put production.cfg under INSTANCE_FOLDER_PATH.

Project outline

├── app.wsgi                (mod_wsgi wsgi config)
├── CHANGES
├── fabfile.py              (fabric file)
├── synopses                (main app)
│   ├── api                 (api module)
│   ├── app.py              (create flask app)
│   ├── config.py           (config module)
│   ├── decorators.py
│   ├── extensions.py       (init flask extensions)
│   ├── frontend            (frontend module)
│   ├── __init__.py
│   ├── settings            (settings module)
│   ├── static
│   │   ├── css
│   │   ├── favicon.png
│   │   ├── humans.txt
│   │   ├── img
│   │   ├── js
│   │   └── robots.txt
│   ├── templates
│   │   ├── errors
│   │   ├── frontend
│   │   ├── index.html
│   │   ├── layouts
│   │   ├── macros
│   │   ├── settings
│   │   └── user
│   ├── translations        (i18n)
│   ├── user                (user module)
│   │   ├── constants.py
│   │   ├── forms.py        (wtforms)
│   │   ├── __init__.py
│   │   ├── models.py
│   │   ├── views.py
│   ├── utils.py
├── LICENSE
├── manage.py               (manage via flask-script)
├── MANIFEST.in
├── README.markdown
├── screenshots
├── setup.py
└── tests                   (unit tests, run via `nosetest`)

License

See LICENSE file.

Acknowledgement

Thanks to Python, Flask, its extensions, to Wilson Xu and community behind all dependencies of the open source platform.