You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Christoph Marzell deb4e693ed add filters 1 month ago
.idea add fixes 11 months ago
app add filters 1 month ago
bin add new UI 1 month ago
config add filters 1 month ago
db add filters 1 month ago
frontend add filters 1 month ago
lib init commit 11 months ago
public init commit 11 months ago
vendor update to config map 10 months ago
.dockerignore add new UI 1 month ago
.gitattributes init commit 11 months ago
.gitignore init commit 11 months ago
.ruby-version init commit 11 months ago
Dockerfile add new UI 1 month ago
Gemfile add new UI 1 month ago
Gemfile.lock add new UI 1 month ago
MIGRATION_FEATURES.md add new UI 1 month ago
README.md add new UI 1 month ago
Rakefile init commit 11 months ago
config.ru init commit 11 months ago
docker-compose-dev.yml add mediation and cache 4 months ago
docker-compose.yml minor UI fixes 1 month ago
docker-entrypoint.sh add timer 11 months ago
package-lock.json update to config map 10 months ago
package.json update to config map 10 months ago
setup-env.ps1 add new UI 1 month ago

README.md

Ausbildungsnachweis

Die bisherige Rails-Webanwendung wurde in zwei klar getrennte Anwendungen umgebaut:

  • Rails 7.1 als JSON-API unter /api/v1
  • Angular 22 mit Angular Material im Ordner frontend/
  • PostgreSQL, Redis und Nginx über Docker Compose

Start mit Docker

cp .env.example .env
# CHANGE_ME-Werte in .env durch sichere Zufallswerte ersetzen
docker compose build
docker compose up -d
docker compose exec api bin/rails db:prepare

Unter Windows zuerst die .env mit sicheren Zufallswerten erzeugen:

powershell -ExecutionPolicy Bypass -File .\setup-env.ps1
docker compose up -d --build

Falls Port 13131 bereits verwendet wird, in .env beispielsweise Folgendes setzen:

FRONTEND_PORT=13132
FRONTEND_ORIGINS=http://localhost:13132

Frontend: http://localhost:13131
API: http://localhost:13000/api/v1
Healthcheck: http://localhost:13000/up

Ein Secret kann mit docker compose run --rm api bin/rails secret erzeugt werden.

Lokale Entwicklung

Backend:

bundle install
bin/rails db:prepare
bin/rails server

Frontend:

cd frontend
npm install
npm start

Der Angular-Devserver leitet /api über proxy.conf.json an Rails auf Port 3000 weiter.

API-Bereiche

  • auth: Login, Logout und aktueller Benutzer
  • entries: CRUD, Timer und CSV-Export
  • dashboard: Fortschritt, Kilometer und Kosten
  • calendar: Einträge für frei wählbare Datumsbereiche
  • monthly_report: Monatsauswertung
  • settings: Sollstunden, Wochenziele und Ausbildungsstatus
  • mileage_rates: Kilometersätze

csv ist im Gemfile ausdrücklich als Gem eingetragen und zusätzlich im Export-Controller sowie im Modell geladen.

Der vollständige Abgleich mit den Funktionen des ursprünglichen Rails-Projekts steht in MIGRATION_FEATURES.md.

E-Mail und Administration

In .env müssen insbesondere SMTP_USERNAME, SMTP_PASSWORD, FRONTEND_URL, ADMIN_EMAIL und die PgHero-Zugangsdaten gesetzt werden. Nach Änderungen an .env die Container neu erstellen:

docker compose up -d --build --force-recreate

Bestehende Daten

Die vorhandenen Tabellen und Modelle bleiben erhalten. Beim ersten Start wird nur api_token_digest an users ergänzt. Vor dem Upgrade sollte wie üblich ein PostgreSQL-Backup erstellt werden.