This informational long-read is a digital version of the study "Innovationserhebung" which is conducted by the Technologiestiftung Berlin in german language. The study takes a look into data about business innovation since 2012 and was released in a print version since then.
The digital version now enhances the findings and data with interactive charts to enable viewers to find even more customised insights. The data of the study is based on the yearly published Innovationserhebung by the ZEW - Zentrum für Europäische Wirtschaftsforschung.
- Latest Python 3.11 version (i.e. 3.11.4, other versions might work as well) – You can e.g. use pyenv, see below.
- A Node version that’s defined in
.nvmrc
– You can e.g. use nvm to switch to the right version (withnvm use
ornvm install
).
- Create a
.env
file by copying the.env.example
file and filling out the variables. - Install npm dependencies:
npm install
- Run the
get-fonts
script to download the required font files (they will be placed in the/app/static/fonts
directory):npm run get-fonts
The following steps are not required but recommended. This will allow you to install packages in your isolated virtual environment instead of globally, reducing the risk of breaking system tools or other projects.
- Install pyenv and the pyenv-virtualenv plugin.
- Download the appropriate Python version with
pyenv install 3.11.4
in the command line. 3. Create a virtual environment with the appropriate Python version and name for your environment, for example
pyenv virtualenv 3.11.4 innovationserhebung
- Activate the environment with
pyenv activate innovationserhebung
Install the required libraries with the command line
pip install -r requirements.txt -r requirements-dev.txt
Install the pre-commit git hook
pre-commit install
- Run the server with the command line
uvicorn app.main:app --reload
- Your terminal should show something like:
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
If you need to change HTML templates or CSS, you should use the Tailwind watcher to automatically recompile the CSS:
- Move to the root directory
- Start the tailwind watcher:
npm run dev:tailwind
- After setting up the project according to the previous chapters, run
$ chmod +x run_dev.sh
from your root directory to give the bash file executable permission.
- Now you should be able to start a development server via
./run_dev.sh
This also runs the tailwind watcher
Taking an input XLSX file similar to the one in this repository, you can convert it to JSON by running
python -m app.xlsx2json
We are using pip-tools to handle the requirements and keep the dependencies updated.
In case you are updating or adding some dependencies, do so in the requirements.*.in
files and don't forget to compile the new requirements.*.txt
files running:
pip-compile requirements.in
pip-compile requirements-dev.in
To update the packages, following the version pinning defined in the
requirements*.in
files, run:
pip-compile --upgrade requirements.in
pip-compile --upgrade requirements-dev.in
To keep your environment in sync, run:
pip-sync requirements.txt requirements-dev.txt
To deploy the app, these commands should be run (in the root directory) to build the app:
pip install -r requirements.txt && npm install && npm run build
Afterwards, the app can be started with these commands:
uvicorn app.main:app --host 0.0.0.0 --port $PORT
These environment variables should be set:
Variable | Value |
---|---|
FONTS_URL | |
PORT | 8000 |
PYTHON_VERSION | 3.11.4 |
Texts and content available as CC-BY-SA.
A project by:
|
Supported by:
|