Skip to content
Snippets Groups Projects
Commit 8d06ada9 authored by Remco Tukker's avatar Remco Tukker
Browse files

update readmes and remove unused default secret key

parent 631fede9
Branches
Tags
1 merge request!1normalization of nrens including datamigration
......@@ -2,21 +2,18 @@
## Installation Process
```bash
$ git clone https://gitlab.geant.net/live-projects/compendium-v2.git
```
Clone this repository using your favorite method, then:
```bash
$ python3 -m venv compendium-v2
$ .compendium-v2/bin/activate
$ pip install -r requirements-dev.txt
$ cd compendium-v2
$ pip install -r requirements.txt
$ tox -e py39
```
## Overview
This module implements a skeleton Flask-based webservice
This module implements a Flask-based webservice
and in-browser React front-end.
The webservice communicates with the front end over HTTP.
......@@ -24,25 +21,18 @@ Responses to valid requests are returned as JSON messages.
The server will therefore return an error unless
`application/json` is in the `Accept` request header field.
HTTP communication and JSON grammar details are
beyond the scope of this document.
Please refer to [RFC 2616](https://tools.ietf.org/html/rfc2616)
and www.json.org for more details.
## Configuration
This app allows specification of a few
example configuration parameters. These
parameters should be stored in a file formatted
similarly to `config.json.example`, and the name
similarly to `config-example.json`, and the name
of this file should be stored in the environment
variable `SETTINGS_FILENAME` when running the service.
## Building the web application
The initial repository doesn't contain the required web application.
For instructions on building this see `webapp/README.md`.
For instructions on building the React frontend see `webapp/README.md`.
## Running this module
......@@ -54,44 +44,30 @@ For example, the application could be launched as follows:
```bash
$ export FLASK_APP=compendium_v2.app
$ export SETTINGS_FILENAME=config-example.json
$ flask db upgrade
$ flask run
```
See https://flask.palletsprojects.com/en/2.1.x/deploying/
for best practices about running in production environments.
### resources
Any non-empty responses are JSON formatted messages.
#### /data/version
* /version
The response will be an object
containing the module and protocol versions of the
running server and will be formatted as follows:
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"api": {
"type": "string",
"pattern": r'\d+\.\d+'
},
"module": {
"type": "string",
"pattern": r'\d+\.\d+'
}
},
"required": ["api", "module"],
"additionalProperties": False
}
## Importing the historical data
Pip install can use the setup.py file to register the click cli commands:
```bash
pip install --editable .
survey-publisher-v1
survey-publisher-2022
```
## Creating a db migration after editing the sqlalchemy models
```bash
cd compendium_v2
alembic revision --autogenerate -m "description"
```
#### /test/test1
Then go to the created migration file to make any necessary additions, for example to migrate data.
Also see https://alembic.sqlalchemy.org/en/latest/autogenerate.html#what-does-autogenerate-detect-and-what-does-it-not-detect
The response will be some json data, as an example ...
Note that starting the application applies all upgrades.
......@@ -34,7 +34,6 @@ def create_app() -> Flask:
app = Flask(__name__)
CORS(app)
app.secret_key = 'super secret session key'
app.config['CONFIG_PARAMS'] = app_config
from compendium_v2.routes import default
......
......
......@@ -5,7 +5,7 @@
From this folder, run:
```bash
$ npm init
$ npm install
```
To run the webpack development server:
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment