- Make sure you have installed Protobuf Compiler:
- The simplest way to install it is to download a pre-built binary from GitHub release page.
In the downloads section of each release, you can find pre-built binaries in zip packages:
protoc-$VERSION-$PLATFORM.zip
. ❕ The selected version should match (or may be older than) the version of protobuf-kotlin dependency used in build.gradle.kts.
- The simplest way to install it is to download a pre-built binary from GitHub release page.
In the downloads section of each release, you can find pre-built binaries in zip packages:
- Make sure you have JDK installed (at least JDK 17 LTS). If you go for a later version, it should be compatible with the configured Gradle version. Check Gradle Compatibility Matrix for details.
This short guide focuses on setting up the project using IntelliJ instead of Android Studio:
- Install Flutter
- You can take a look at README.md for a simpler guide which uses Flutter Version Manager (recommended)
- Or use this guide to install Flutter and the tools needed to work with it. If you go for this option, make sure to use the version configured in the environment section of pubspec.yaml
- Dart SDK should be installed automatically from the Flutter Engine in the previous step (just check it with
dart --version
). Otherwise, it can be installed using this guide.- On Arch Linux you can just do:
pacman -S dart
- On Arch Linux you can just do:
- Install Android SDK via IntelliJ or Android Studio
- Open the root project in IntelliJ
- Install the Android extension in IntelliJ and set the SDK path in the settings of IntelliJ
- Install the Dart extension in IntelliJ and set the SDK path in the settings of IntelliJ
- Install the Flutter extension in IntelliJ and set the SDK path in the settings of IntelliJ
- Run
fvm flutter pub get
infrontend/
(if you use Flutter Version Manager) orflutter pub get
(otherwise) - Execute the "Run (env:local+buildConfig:bayern)" run configuration from within IntelliJ
- Install app-toolbelt:
npm install --unsafe-perm -g https://github.com/digitalfabrik/app-toolbelt/archive/refs/heads/main.tar.gz
- Set build config:
fvm flutter pub run build_runner build --define "df_build_config=name=bayern"
Note: If 8.
fails with message app-toolbelt: command not found
, you might have to set the build config differently first,
e.g. to nuernberg
and only then set the desired build config.
Note: Your Intellij needs access to environment variables to run these commands successfully.
As there are several services running and interacting some ports need to be forwarded. This includes the backend port 8000 and the map tiles port at 5002. For this run:
adb reverse tcp:5002 tcp:5002
adb reverse tcp:8000 tcp:8000
- Install docker and docker-compose
sudo docker-compose rm
sudo docker-compose build
sudo docker-compose up --force-recreate
- Open Adminer: http://localhost:5001
The credentials are:
Property Value Host (within Docker) db-postgis Username postgres Password postgres Database ehrenamtskarte - Open the IntelliJ "Project Structure" and set up the required SDK called "entitlementcard-jdk" and point it to your JDK installation.
- Clone the submodule inside
backend/ehrenamtskarte-maplibre-style
- Initialize all submodules by running
git submodule update --init --recursive
in the root directory - Run the backend migration:
cd backend && ./gradlew run --args "migrate"
- Run the backend:
./gradlew run --args="execute"
or.\backend\gradlew.bat run --args="execute"
on Windows - Create an admin account using
./gradlew run --args="create-admin <project> <role> <email> <password> <region>"
- Take a look at the martin endpoints: http://localhost:5002/tiles/accepting_stores/index.json and http://localhost:5002/tiles/accepting_stores/rpc/index.json. The data shown on the map is fetched from a hardcoded url and is not using the data from the local martin!
- Take a look at the style by viewing the test map: http://localhost:5002/map.html
- Set up the matomo instance http://localhost:5003 (The public version is available at https://matomo-entitlementcard.tuerantuer.org)
- (optional) Add your matomo config for each project to the backend config
projects:
- id: ...
# ...
matomo:
siteId: 1
url: http://localhost:5003/matomo.php
accessToken: <matomo-access-token>
You can find and generate an access token, when you visit localhost:5003/settings
and search for token there.
You might also need to update the matomo /var/www/html/config/config.ini.php
(you'll only have to do this once) to add localhost:5003 to matomos trusted_hosts.
To do that it is recommended to use the docker desktop client.
- Create directory
administration/src/generated
(might be optional) - Run
npm install
- Run
Start Administration
from Intellij run configurations
docker exec -ti <container_id> pg_dump -c -U postgres ehrenamtskarte > dump-$(date +%F).sql
To copy the dump to your local machine:
rsync root@ehrenamtskarte.app:dump-2020-12-23.sql .
To restore the dump
docker exec -i <container_id> psql ehrenamtskarte postgres < dump-$(date +%F).sql
ssh -L 5432:localhost:5432 -L 5001:localhost:5001 team@ehrenamtskarte.app
That way the Adminer and postgres will be available locally.