- Java 46.5%
- TypeScript 30.5%
- HTML 20%
- CSS 3%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| frontend | ||
| sql | ||
| src | ||
| .gitignore | ||
| pom.xml | ||
| README.md | ||
hrtm-benko
Jakarta EE / TomEE application with an Angular frontend for analysing Austrian municipal finance data.
PostgreSQL
The application expects a TomEE JTA datasource named jdbc/hrtmBenko.
Example TomEE resource:
<Resource id="jdbc/hrtmBenko" type="DataSource">
JdbcDriver = org.postgresql.Driver
JdbcUrl = jdbc:postgresql://POSTGRES_LXC:5432/hrtm_benko
UserName = hrtm_benko
Password = hrtm_benko
JtaManaged = true
</Resource>
Create the first import table with:
psql "$DATABASE_URL" -f sql/001_schema.sql
Build
Backend only:
mvn clean verify
WAR with Angular frontend:
mvn clean package -Pfrontend
Documentation
The packaged WAR includes a static documentation page at /docs/. In production with the /hrtm-benko context path, it is available at /hrtm-benko/docs/ and linked from the public analysis page.
Import
The public Angular application is read-only. Imports are handled by a separate admin page:
- Admin UI:
/admin/import.html - Dashboard configuration UI:
/admin/configuration.html - Budget CSV upload endpoint:
POST /api/imports/csv - Transparenzportal budget HTML URL endpoint:
POST /api/imports/budget-html - Municipality revenue-sharing or population XLSX upload endpoint:
POST /api/imports/municipality-revenue-sharing - Multipart field:
file - Optional form field:
truncate=true
The HTML import accepts sourceUrl=https://transparenz.hrtm.net/council-manager/resources/finance/council/.../*.html.
HTML rows are treated as fallback data: the import replaces only existing HTML fallback rows for the same municipality/year/report type/household, refuses to overwrite primary CSV rows, and later CSV imports remove matching HTML fallback rows.
Protect /admin/*, /api/imports/* and /api/admin/* at the reverse proxy. Hiding the admin pages alone is not sufficient because the endpoints write data.
Example Caddy rule:
@benko_import path /hrtm-benko/admin/* /hrtm-benko/api/imports/* /hrtm-benko/api/admin/*
basicauth @benko_import {
admin $2a$14$REPLACE_WITH_HASHED_PASSWORD
}
Example nginx location:
location ~ ^/hrtm-benko/(admin/|api/imports/|api/admin/) {
auth_basic "HRTM Benko Import";
auth_basic_user_file /etc/nginx/htpasswd-hrtm-benko-import;
proxy_pass http://tomee_backend;
}