Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
compendium-v2
Commits
8d06ada9
Commit
8d06ada9
authored
Apr 12, 2023
by
Remco Tukker
Browse files
Options
Downloads
Patches
Plain Diff
update readmes and remove unused default secret key
parent
631fede9
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1
normalization of nrens including datamigration
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+20
-44
20 additions, 44 deletions
README.md
compendium_v2/__init__.py
+0
-1
0 additions, 1 deletion
compendium_v2/__init__.py
webapp/README.md
+1
-1
1 addition, 1 deletion
webapp/README.md
with
21 additions
and
46 deletions
README.md
+
20
−
44
View file @
8d06ada9
...
...
@@ -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
.
This diff is collapsed.
Click to expand it.
compendium_v2/__init__.py
+
0
−
1
View file @
8d06ada9
...
...
@@ -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
...
...
...
...
This diff is collapsed.
Click to expand it.
webapp/README.md
+
1
−
1
View file @
8d06ada9
...
...
@@ -5,7 +5,7 @@
From this folder, run:
```
bash
$
npm in
it
$
npm
in
stall
```
To run the webpack development server:
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment