- Install the protobuf compiler using a package manager of your choice or using a binary from the github release page. The selected version has to match (or be older than) the version of protobuf-kotlin dependency used in build.gradle.kts.
- Install Java JDK 17. If you use a later version, it has to be compatible with the configured Gradle version. Check the Gradle Compatibility Matrix for details.
- Open the root project in IntelliJ.
- Install Android SDK via the Android plugin or Android Studio
- Install fvm (flutter version manager)
- Install flutter dependencies
cd frontend && fvm flutter pub get
- Open IntelliJ settings and
- Install the Android plugin and set the Android SDK path
- Install the Dart plugin and set the Dart SDK path
- Install the Flutter plugin and set the Flutter SDK path
- Install app-toolbelt
npm install --unsafe-perm -g https://github.com/digitalfabrik/app-toolbelt/archive/refs/heads/main.tar.gz
Note: IntelliJ needs access to environment variables to run these commands successfully.
- Forward ports. 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. The command has to be run every time a device is connected.
adb reverse tcp:8081 tcp:8081 && adb reverse tcp:8000 tcp:8000 && adb reverse tcp:5002 tcp:5002
- Run the app
- Bayern:
Run (env:local+buildConfig:bayern)
- Nuernberg:
Run (env:local+buildConfig:nuernberg)
- Koblenz:
Run (env:local+buildConfig:koblenz)
- Bayern:
- Create directory
administration/src/generated
mkdir administration/src/generated
- Install node_modules
npm install
Run Start administration (env:local+buildConfig:all)
from Intellij run configurations
- Install docker and docker-compose
- Setup docker-compose
docker-compose rm
docker-compose build
docker-compose up --force-recreate
- Open the IntelliJ "Project Structure" and set up the required SDK called "entitlementcard-jdk" and point it to your JDK installation.
- Run the backend migration (
Migrate DB
)
cd backend && ./gradlew run --args "migrate"
- Create a backend account with one of the run configurations or the following command:
./gradlew run --args="create-admin <project> <role> <email> <password> <region>"`
- Start
docker-compose
sudo docker-compose up --force-recreate
- Run the backend (
Run backend (env:local+buildConfig:all)
)
./gradlew run --args="execute"
The following setup is only necessary if you work with the corresponding services.
The backend configuration file config.yml is checked in git and should therefore not be modified for development purposes. Instead, you can create your own local copy:
- Copy config.yml to
~/.config/entitlementcard/config.yml
mkdir ~/.config/entitlementcard
cp backend/src/main/resources/config/config.yml ~/.config/entitlementcard
- Adjust config
- Clone the submodule inside
backend/ehrenamtskarte-maplibre-style
- Initialize all submodules by running
git submodule update --init --recursive
in the root directory
- Use the docker desktop client
- Set up the matomo instance http://localhost:5003. The public version is available at https://matomo-entitlementcard.tuerantuer.org
- Create an access token at localhost:5003/settings
- Add
localhost:5003
tomatomos trusted_hosts
at/var/www/html/config/config.ini.php
- Add your matomo config for each project as described in Local Backend Configuration
projects:
- id: ...
# ...
matomo:
siteId: 1
url: http://localhost:5003/matomo.php
accessToken: <matomo-access-token>
- Adminer: http://localhost:5001
The credentials are:
Property Value Host (within Docker) db-postgis Username postgres Password postgres Database ehrenamtskarte - 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!
- Map styles: http://localhost:5002/map.html
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.