cc4f3bb225
Neuer Settings-Tab mit manueller Update-Suche (ignoriert die Skip- Markierung), Zeitstempel der letzten Prüfung, Link zur Dokumentation auf rapport.kgva.ch. Update-Helper sind in src/utils/updater.js zentralisiert; UpdateNotifier schreibt jetzt auch beim Auto-Check das Datum der letzten Prüfung mit. Version 0.6.0 → 0.7.0 in package.json, tauri.conf.json, Cargo.toml und allen UI-Referenzen. Changelog-Eintrag 0.7 mit den drei Highlights dieses Releases ergänzt. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
137 lines
4.8 KiB
Markdown
Executable File
137 lines
4.8 KiB
Markdown
Executable File
# Rapport
|
|
|
|
Desktop-App auf Basis von **Tauri 2** und **React 19**, gebaut mit **Vite**. Daten liegen ausschliesslich lokal im Browser-`localStorage` — es gibt kein Backend.
|
|
|
|
## Voraussetzungen
|
|
|
|
| Tool | Version |
|
|
|---|---|
|
|
| Node.js | ≥ 20 (für Vite 8) |
|
|
| npm | ≥ 10 |
|
|
| Rust toolchain | ≥ 1.77.2 (`rustup`) |
|
|
| Plattform-Build-Tools | siehe [Tauri Prerequisites](https://v2.tauri.app/start/prerequisites/) |
|
|
|
|
Plattform-spezifisch zusätzlich:
|
|
- **macOS**: Xcode Command Line Tools (`xcode-select --install`)
|
|
- **Windows**: Microsoft C++ Build Tools, WebView2
|
|
- **Linux**: `webkit2gtk-4.1`, `librsvg2-dev`, `libayatana-appindicator3-dev`, `build-essential`
|
|
|
|
## Setup
|
|
|
|
```bash
|
|
git clone http://192.168.1.247:3000/karim/RAPPORT.git
|
|
cd RAPPORT
|
|
npm install
|
|
```
|
|
|
|
## Entwicklung
|
|
|
|
**Web-Modus** (HMR im Browser, schnellster Iteration-Loop für UI-Arbeit):
|
|
|
|
```bash
|
|
npm run dev # http://localhost:3000
|
|
```
|
|
|
|
**Native Window** (Tauri-Fenster mit echter Desktop-Integration):
|
|
|
|
```bash
|
|
npx tauri dev
|
|
```
|
|
|
|
Lint:
|
|
|
|
```bash
|
|
npm run lint
|
|
```
|
|
|
|
## Produktion-Build
|
|
|
|
**Nur Frontend** (statische Files für Web-Deployment):
|
|
|
|
```bash
|
|
npm run build # → dist/
|
|
```
|
|
|
|
**Desktop-Bundle** (vollständiges Installer-Paket):
|
|
|
|
```bash
|
|
npx tauri build
|
|
```
|
|
|
|
Output landet in `src-tauri/target/release/bundle/`:
|
|
|
|
| Plattform | Verzeichnis |
|
|
|---|---|
|
|
| macOS | `dmg/` und `macos/` (`.app`) |
|
|
| Windows | `msi/` (WiX) und `nsis/` |
|
|
| Linux | `deb/`, `appimage/`, `rpm/` |
|
|
|
|
Bundle-Name und -Version stammen aus [`src-tauri/tauri.conf.json`](src-tauri/tauri.conf.json) (`productName`, `version`).
|
|
|
|
## Versionierung
|
|
|
|
Beim Anheben der Version müssen drei Stellen synchron bleiben:
|
|
|
|
- [`package.json`](package.json) — `version`
|
|
- [`src-tauri/tauri.conf.json`](src-tauri/tauri.conf.json) — `version`
|
|
- [`src-tauri/Cargo.toml`](src-tauri/Cargo.toml) — `version`
|
|
|
|
Zusätzlich im UI-Changelog: [`src/App.jsx`](src/App.jsx) — Konstante `CHANGELOGS`, sowie `version`-Prop am `<Login>` und `localStorage`-Key `rapport_changelog_seen`.
|
|
|
|
## Projektstruktur
|
|
|
|
```
|
|
.
|
|
├── src/ Frontend (React)
|
|
│ ├── App.jsx Root-Komponente, Routing, Auth-State
|
|
│ ├── main.jsx React-Mount
|
|
│ ├── constants.js Default-Daten, SIA-Phasen, Statusfarben
|
|
│ ├── utils.js Hashing, Sanitizer, Formatter, Berechnungen
|
|
│ ├── components/UI.jsx Wiederverwendbare UI-Bausteine
|
|
│ ├── views/ Module (Dashboard, Time, Invoices, …)
|
|
│ └── print/ Print-Komponenten (PDF/QR-Rechnung)
|
|
├── src-tauri/ Tauri-Wrapper (Rust)
|
|
│ ├── src/ main.rs + lib.rs
|
|
│ ├── capabilities/ Permission-Definitionen
|
|
│ ├── icons/ App-Icons aller Plattformen
|
|
│ └── tauri.conf.json Window, Bundle, CSP
|
|
├── public/ Statische Assets (favicon, icons.svg)
|
|
├── index.html Vite-Entry
|
|
└── vite.config.js
|
|
```
|
|
|
|
## Daten & Persistenz
|
|
|
|
- Alles wird unter dem Key `rapport_data` in `localStorage` gehalten — siehe [`src/constants.js`](src/constants.js) → `STORAGE_KEY`.
|
|
- Beim ersten Start ohne Daten erscheint ein **Setup-Assistent** ([`src/views/Setup.jsx`](src/views/Setup.jsx)). Bestehende Daten ohne `setupCompleted`-Flag triggern den **Migrations-Screen** ([`src/views/MigrationScreen.jsx`](src/views/MigrationScreen.jsx)).
|
|
- Backup/Restore: **Einstellungen → Daten exportieren / importieren** — speichert/lädt den gesamten Store als JSON.
|
|
|
|
## Sicherheit
|
|
|
|
- **Passwörter**: PBKDF2-SHA-256 mit 100 000 Iterationen und zufälligem Salt; Verifikation in konstanter Zeit. Legacy-Klartext-Passwörter werden beim ersten erfolgreichen Login transparent zu Hashes migriert.
|
|
- **Login-Schutz**: 5 Fehlversuche → 60 s Sperre pro Tab (`sessionStorage`).
|
|
- **HTML-Sanitizer**: Brieftexte werden vor Print/Render durch eine Allowlist gefiltert (`sanitizeHtml` in [`src/utils.js`](src/utils.js)) — kein `javascript:`, kein `on*`-Handler.
|
|
- **Datenexport**: Legacy-Klartext-Passwörter werden beim Export gestrippt; nur Hashes verlassen die App.
|
|
- **CSP**: definiert in [`src-tauri/tauri.conf.json`](src-tauri/tauri.conf.json) — `default-src 'self'` plus Google-Fonts-Allowlist.
|
|
- **Tauri-Capabilities**: minimal (`core:default` + `core:webview:allow-print`) — siehe [`src-tauri/capabilities/default.json`](src-tauri/capabilities/default.json).
|
|
|
|
## Release-Workflow
|
|
|
|
```bash
|
|
# 1. Versionen anheben (package.json, tauri.conf.json, Cargo.toml)
|
|
# 2. Changelog in src/App.jsx ergänzen
|
|
# 3. Commit + Tag
|
|
git tag -a v0.7.0 -m "Rapport 0.7"
|
|
git push origin main v0.7.0
|
|
|
|
# 4. Bundle bauen
|
|
npx tauri build
|
|
|
|
# 5. Bundle als Release-Asset auf Gitea anhängen
|
|
# (nicht ins Repo committen)
|
|
```
|
|
|
|
## Lizenz
|
|
|
|
[GNU AGPL-3.0-or-later](https://www.gnu.org/licenses/agpl-3.0.html)
|