MasserFront is a React and Flask-based UI application for Masserstein mass spectrometry result analysis.
- Clone the repository with submodules
git clone https://gitlab.mimuw.edu.pl/ag181044/masserfront.git --recurse-submodules
cd masserfront/- Initialize the default SQLite database
./ctl flask db upgradeTo run a development server:
$ ./ctl run
INFO:runlib:Calling command: run with args:
...
INFO:app.classes:Registering blueprint: base
* Serving Flask app 'app'
* Debug mode: off
INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:5000
INFO:werkzeug:Press CTRL+C to quitTo run a server on a specified host/port:
$ ./ctl run --host 0.0.0.0 -p 18000
INFO:runlib:Calling command: run with args: host: '0.0.0.0' port: '18000'
...To start a uWSGI server with a HTTP interface:
$ ./ctl uwsgi start -s 0.0.0.0:18000
INFO:runlib:Calling command: uwsgi with args: start socket: '0.0.0.0:18000' plugin: 'python3'
[uWSGI] getting INI configuration from config.ini
INFO:runlib:UWSGI process started and daemonizedLogfile can be found in ./var/log/uwsgi.log.
To start a uWSGI server with Unix domain socket interface (for proxying from Apache, nginx or other HTTP server with uWSGI support):
$ ./ctl uwsgi start -s /path/to/socker
INFO:runlib:Calling command: uwsgi with args: start socket: '0.0.0.0:18000' plugin: 'python3'
[uWSGI] getting INI configuration from config.ini
INFO:runlib:UWSGI process started and daemonizedTo stop uWSGI server:
$ ./ctl uwsgi stop
INFO:runlib:Calling command: uwsgi with args: stop
INFO:runlib:UWSGI process stoppedTo run a development docker compose (with app/ and web/ bind-mounted inside, requires updating web/node_modules by npm ci/npm i run in web/):
docker compose -f docker-compose.yml -f docker-compose.dev.yml upTo run production docker instances:
docker compose upLast two calls may require adding a --build option or running docker builder prune to get rid of build cache if significant changes were introduced.
To add (or upgrade) a pip package:
./ctl env add <package>To remove a pip package:
./ctl env rm <package>List env packages:
./ctl env listTo upgrade existing packages (those without version specified):
./ctl env upgradeTo freeze packages at currently installed versions:
./ctl env freezeTo enter virtual env shell:
./ctl envTo execute a flask command:
./ctl flask <command>To enter Python flask shell with initialized app:
$ ./ctl flask shell
INFO:runlib:Calling command: flask with args: "shell"
(...)
INFO:app.classes:Registering blueprint: base
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
App: app.classes
Instance: /home/students/inf/a/ag181044/projects/masserfront/instance
>>> app
<App 'app.classes'>To create a migration in migrations/versions/ after changes to a SQLAlchemy Python model:
./ctl flask db migrate
To upgrade database to the newest schema version:
./ctl flask db upgrade
Antoni Goldstein Antoni Moszyński
GNU General Public License v2
Production