Integreat - The mobile guide for newcomers. Multilingual. Offline. Open Source.
This content management system helps local integration experts to provide multilingual information for newcomers.
This section provides a brief overview of setting up the development environment. We support various environments: you can set up everything locally using your preferred package manager, use it as a devcontainer, or utilize the nix-flake. Please clone the repository with the following snippet before starting to setup your development environment.
git clone git@github.com:digitalfabrik/integreat-cms.git
cd integreat-cms
From the three provided development setup options, choose yours based on personal preference and familiarity with the used tools. If you are unsure, the following might help you make a decision. Please note that these are only suggestions.
nix
or do not want to install docker? → Nix FlakeTo configure your development environment on your system, please follow these steps carefully.
npm
version 7 or laternodejs
version 18 or laterpython3
version 3.11 or laterpython3-pip
(Debian-based distributions) / python-pip
(Arch-based distributions)python3-venv
(only on Debian-based distributions)gettext
for translation featurespostgresql
or docker
to run a local database servertools/install.sh
to download all dependencies.tools/migrate.sh
to apply all database schema migrations.tools/loadtestdata.sh
to apply a predefined set of test data.To configure your development container, please follow these steps carefully.
The perfect is the enemy of the good; thus, this section illuminates aspects of our evolving development setup.
A known limitation exists where certain versions of Visual Studio Code (VSCode) may not copy the user's .gitconfig
file correctly into the Devcontainer environment. In such cases, when you attempt to commit changes within the Devcontainer, you may be prompted to enter your Git username and email every time. This can be inconvenient and disrupt the workflow. However, there is a workaround for this issue. You can resolve it by appending the content of your personal .gitconfig
file, located at $HOME/.gitconfig
, to the end of the repository-specific .git/config
file, which in this case would be integreat-cms/.git/config
. By doing so, you ensure that the necessary Git configuration settings are correctly applied within the Devcontainer environment, allowing for a smoother development experience.
For more information, refer to this issue in the VSCode Remote Extension repository.
The user must be in the docker group on linux, VSCode does not allow to optionally enter sudo password.
To configure your development environment through the provided nix flake, follow these steps carefully.
nix
. Depending on your distribution or operating system, multiple ways might be available to do this; one recommended way is to use the install script provided by zero-to-nix.com:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
nix develop
inside your project directory. You should see nix
pulling in the required dependencies for running the project.tools/install.sh
to download and install all project dependencies.Please note that closing the shell in which you ran nix develop
will destroy your development environment,
i.e. any time you want to work on the project again, you will need to execute nix develop
beforehand,
and then start your code editor (code .
, nvim
,...) from within that same shell.
On MacOS, installing libmagic
separately through brew install libmagic
might be required.
After setup you will be able to run the cms with most of it's functionality. In order to use a couple of features like translations or the HIX value, you need to set some settings which can be defined in a configuration file. It should be located at /etc/integreat-cms.ini
. If you want to place the file at a different location, pass the absolute path via the environment variable INTEGREAT_CMS_CONFIG
. An example file is located at example-configs
in the project folder.
All these settings can also be configured via environment variables with the prefix INTEGREAT_CMS_
, e.g. INTEGREAT_CMS_SECRET_KEY
.
If you want to use a configuration file in your development container, pass the absolute path of the configuration file with setting the environment variable INTEGREAT_CMS_CONFIG
. All paths set in the configuration file must exist inside the workspace. If you want to configure the settings with environment variables you need to pass them via the .devcontainer/.env
file.
When using the example file as starting point for configuration, all ports need to be defined, even without defining the rest of the respective section.
Run the development server using /tools/run.sh
, then open your browser and go to http://localhost:8000
. The default login credentials are username: "root" and password: "root1234".
For detailed instructions, tutorials and the source code reference have a look at our great documentation:
:notebook: https://digitalfabrik.github.io/integreat-cms/
Alternatively, you can generate it yourself using the tools/make_docs.sh
script.
To better understand the overall intention it might also be helpful to look at the wiki for municipalities (GER) that teaches how to use our CMS.
Copyright © 2018 Tür an Tür - Digitalfabrik gGmbH and individual contributors. All rights reserved.
This project is licensed under the Apache 2.0 License, see LICENSE and NOTICE.md.