No description
- Java 46.9%
- TypeScript 30.3%
- HTML 17.3%
- CSS 5.5%
|
|
||
|---|---|---|
| .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. CSV imports are handled by a separate admin page:
- Admin UI:
/admin/import.html - Upload endpoint:
POST /api/imports/csv - Multipart field:
file - Optional form field:
truncate=true
Protect both /admin/* and /api/imports/* at the reverse proxy. Hiding the admin page alone is not sufficient because the upload endpoint writes data.
Example Caddy rule:
@benko_import path /hrtm-benko/admin/* /hrtm-benko/api/imports/*
basicauth @benko_import {
admin $2a$14$REPLACE_WITH_HASHED_PASSWORD
}
Example nginx location:
location ~ ^/hrtm-benko/(admin/|api/imports/) {
auth_basic "HRTM Benko Import";
auth_basic_user_file /etc/nginx/htpasswd-hrtm-benko-import;
proxy_pass http://tomee_backend;
}