Compare commits
20 commits
main
...
feature/we
| Author | SHA1 | Date | |
|---|---|---|---|
| a3c7dd3fef | |||
| 391c91d4b0 | |||
| 07fa837807 | |||
| 21a54da2e3 | |||
| 390785d3eb | |||
| 856559f830 | |||
| 02171e4cfe | |||
| a1e04773f4 | |||
| c20f3a73d0 | |||
| 8862a095c0 | |||
| 0dfb787d06 | |||
| 3230618596 | |||
| 0d35dc9d29 | |||
| ded828ddef | |||
| 7da1a10af2 | |||
| fdb6b0e70e | |||
| 82d4c910b2 | |||
| 562fa56228 | |||
| 6f706dfa49 | |||
| bef8574e07 |
12
.dockerignore
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
node_modules
|
||||
build
|
||||
.svelte-kit
|
||||
data
|
||||
.git
|
||||
.env
|
||||
.claude
|
||||
mobile
|
||||
tests
|
||||
playwright-report
|
||||
test-results
|
||||
.forgejo
|
||||
23
.env.example
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# Speicherort der SQLite-Datenbank und der Uploads
|
||||
DATA_DIR=./data
|
||||
|
||||
# Öffentliche URL der App (Pflicht in Produktion: Formulare, Links in E-Mails)
|
||||
ORIGIN=https://app.example.org
|
||||
|
||||
# Erster Admin-Zugang – wird beim ersten Start angelegt, falls noch kein Benutzer existiert
|
||||
ADMIN_EMAIL=admin@example.org
|
||||
ADMIN_PASSWORD=bitte-aendern
|
||||
|
||||
# E-Mail-Versand (für „Passwort vergessen“). Ohne SMTP_HOST steht der Link nur im Server-Log.
|
||||
SMTP_HOST=
|
||||
SMTP_PORT=587
|
||||
SMTP_SECURE=false
|
||||
SMTP_USER=
|
||||
SMTP_PASS=
|
||||
SMTP_FROM="Werkstatt-App <no-reply@example.org>"
|
||||
|
||||
# Push-Benachrichtigungen: Schlüssel werden beim ersten Start automatisch erzeugt und
|
||||
# in der Datenbank gespeichert. Nur setzen, wenn eigene Schlüssel verwendet werden sollen
|
||||
# (erzeugen mit: npx web-push generate-vapid-keys).
|
||||
VAPID_PUBLIC_KEY=
|
||||
VAPID_PRIVATE_KEY=
|
||||
52
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# Prüft Pull Requests und main: Typen, Unit-Tests, Build, Ende-zu-Ende-Tests mit Barrierefreiheit.
|
||||
name: Prüfen
|
||||
|
||||
# Pull Requests und main – nicht zusätzlich jeden Push auf PR-Branches (spart Speicher auf dem Runner)
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
pruefen:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.63.0-noble
|
||||
env:
|
||||
CI: 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
|
||||
- name: Build-Werkzeuge (better-sqlite3 wird für Node 24 kompiliert)
|
||||
run: apt-get update -qq && apt-get install -y -qq --no-install-recommends build-essential python3 >/dev/null
|
||||
|
||||
- name: Abhängigkeiten
|
||||
run: npm ci
|
||||
|
||||
- name: Typen prüfen
|
||||
run: npm run check
|
||||
|
||||
- name: Unit-Tests
|
||||
run: npm run test:unit
|
||||
|
||||
- name: Bauen
|
||||
run: npm run build
|
||||
|
||||
- name: Ende-zu-Ende-Tests (inkl. axe, WCAG 2.2 AA)
|
||||
run: npm run test:e2e
|
||||
|
||||
- name: Bericht bei Fehlern
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: playwright-bericht
|
||||
path: |
|
||||
playwright-report/
|
||||
test-results/
|
||||
retention-days: 14
|
||||
36
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# Veröffentlicht ein Docker-Image in der Forgejo-Registry, sobald ein Versions-Tag gepusht wird:
|
||||
# git tag v1.2.0 && git push origin v1.2.0
|
||||
# → git.loheide.cloud/friloo/werkstaetten-app:1.2.0 und :latest
|
||||
#
|
||||
# Voraussetzungen: ein Runner mit Docker (Label „docker“, Zugriff auf den Docker-Socket)
|
||||
# und das Repository-Secret REGISTRY_TOKEN (Zugangs-Token mit Berechtigung „package: write“).
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*.*.*']
|
||||
|
||||
jobs:
|
||||
image:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: docker:27-cli
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
steps:
|
||||
- name: Code holen
|
||||
run: |
|
||||
apk add --no-cache git
|
||||
git clone --depth 1 --branch "${GITHUB_REF_NAME}" "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" .
|
||||
|
||||
- name: Image bauen und hochladen
|
||||
env:
|
||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||
run: |
|
||||
REGISTRY="${GITHUB_SERVER_URL#https://}"
|
||||
IMAGE="${REGISTRY}/$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]')"
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
echo "$REGISTRY_TOKEN" | docker login "$REGISTRY" -u "$GITHUB_ACTOR" --password-stdin
|
||||
docker build --build-arg APP_VERSION="$VERSION" -t "$IMAGE:$VERSION" -t "$IMAGE:latest" .
|
||||
docker push "$IMAGE:$VERSION"
|
||||
docker push "$IMAGE:latest"
|
||||
13
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
/data/*
|
||||
!/data/.gitkeep
|
||||
.DS_Store
|
||||
vite.config.*.timestamp-*
|
||||
/playwright-report
|
||||
/test-results
|
||||
1
.npmrc
Normal file
|
|
@ -0,0 +1 @@
|
|||
engine-strict=true
|
||||
30
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Änderungen
|
||||
|
||||
Versionsnummern nach [Semantic Versioning](https://semver.org/lang/de/). Eine neue Version entsteht
|
||||
mit einem Git-Tag (`v1.2.0`); daraus baut Forgejo das Docker-Image.
|
||||
|
||||
## 0.2.0 – 2026-10-09
|
||||
|
||||
### Neu
|
||||
- **Speiseplan** mit Wochenansicht, Linien, Standorten, Kennzeichnung und Allergenen (LMIV);
|
||||
„Heute gibt es“ auf der Startseite; Pflege in der Redaktion inkl. „Vorwoche übernehmen“
|
||||
- **Übersetzungen per KI** in acht Sprachen für Meldungen und Seiten – gekennzeichnet, mit Original-Ansicht,
|
||||
Rechts-nach-links-Satz und Vorlesen in der jeweiligen Sprache
|
||||
- **Statistik** mit anonymen Aufrufzahlen (ohne Cookies, ohne IP-Adressen)
|
||||
- **Erscheinungsbild je Einrichtung:** Vorlagen Kreis, Klar und Kacheln, vier Schriften, drei Eckenformen,
|
||||
Farbprüfung auf Lesbarkeit; Checkliste „Erste Schritte“
|
||||
- **Betrieb:** `/health`, Fehlermeldungen per E-Mail (`ALERT_EMAIL`), Version in der Redaktion,
|
||||
Skripte für mehrere Einrichtungen (`deploy/`), Apps je Einrichtung (`mobile/kunden/`)
|
||||
- **Tests und CI:** Vitest und Playwright (inkl. axe), Forgejo-Workflows für Prüfung und Release
|
||||
|
||||
### Verbessert
|
||||
- Markenfarben greifen zuverlässig; die dunkle Darstellung leitet sich aus der Hauptfarbe ab
|
||||
- Schalter in der Redaktion werden als Schalter angesagt; Logo-Link und Kalender-Einträge nennen den
|
||||
sichtbaren Text zuerst (WCAG 2.5.3)
|
||||
- Datenschutzerklärung nummeriert ihre Abschnitte automatisch
|
||||
|
||||
## 0.1.0 – 2026-10-03
|
||||
|
||||
Erste Version: App für Leser (Meldungen, Seiten, Termine, Ansprechpartner, Suche, Merkliste, Vorlesen,
|
||||
Leichte Sprache, Push), Redaktion mit Redaktionskalender, Sicherheit (2FA, Sperren, CSP),
|
||||
rechtliche Vorlagen, native Apps für iOS und Android.
|
||||
30
Dockerfile
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# ── Build ────────────────────────────────────────────────────────────────────
|
||||
FROM node:24-slim AS build
|
||||
WORKDIR /app
|
||||
# better-sqlite3 wird für Node 24 aus dem Quellcode gebaut
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ && rm -rf /var/lib/apt/lists/*
|
||||
COPY package.json package-lock.json .npmrc ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
# Version für /health und die Redaktion (aus dem Git-Tag, siehe .forgejo/workflows/release.yml)
|
||||
ARG APP_VERSION
|
||||
ENV APP_VERSION=${APP_VERSION}
|
||||
RUN npm run build && npm prune --omit=dev
|
||||
|
||||
# ── Laufzeit ─────────────────────────────────────────────────────────────────
|
||||
FROM node:24-slim
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production \
|
||||
PORT=3000 \
|
||||
DATA_DIR=/data \
|
||||
BODY_SIZE_LIMIT=30M
|
||||
COPY --from=build /app/build ./build
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/package.json ./
|
||||
COPY drizzle ./drizzle
|
||||
COPY scripts ./scripts
|
||||
COPY src/lib/server/db/schema.ts ./src/lib/server/db/schema.ts
|
||||
VOLUME /data
|
||||
EXPOSE 3000
|
||||
USER node
|
||||
CMD ["node", "build"]
|
||||
185
README.md
|
|
@ -1,2 +1,185 @@
|
|||
# werkstaetten-app
|
||||
# Werkstatt-App
|
||||
|
||||
Eine moderne, werbefreie Info-App für Werkstätten für Menschen mit Behinderung (WfbM) –
|
||||
mit einfachem Redaktions-Backend. Läuft als installierbare Web-App (PWA) auf Handy,
|
||||
Tablet und Desktop.
|
||||
|
||||
## Funktionen
|
||||
|
||||
**App (öffentlich)**
|
||||
|
||||
- Startseite je nach Vorlage – z. B. großes Titelbild mit Akzentkreis und umlaufendem Text –, Hinweis-Fahne (Schließzeit oder
|
||||
angeheftete Meldung), Suche, Bereichen, Neuigkeiten und Terminen
|
||||
- Meldungen mit Titelbild, Galerie, Video (datensparsam erst nach Klick), Dateien und Ansprechpartnern
|
||||
- Infoseiten in beliebiger Tiefe (z. B. „Dienste → Sozialer Dienst“)
|
||||
- Termine & Schließzeiten, gruppiert nach Monat, mit Kalender-Abo (`/termine.ics`)
|
||||
- **Speiseplan** pro Woche mit Linien (z. B. „Menü 1“), Standorten, Kennzeichnung (vegan, vegetarisch,
|
||||
Fisch …) und den 14 Allergenen nach LMIV; „Heute gibt es“ auf der Startseite
|
||||
- **Andere Sprachen per KI:** Meldungen und Seiten auf Englisch, Türkisch, Arabisch, Ukrainisch, Russisch,
|
||||
Polnisch, Rumänisch oder Persisch – für Angehörige; gekennzeichnet, mit „Original anzeigen“,
|
||||
Arabisch/Persisch von rechts nach links, Vorlesen in der jeweiligen Sprache
|
||||
- Ansprechpartner-Verzeichnis, Kontaktformular, Volltextsuche
|
||||
- **Barrierearm:** klare Schrift (selbst gehostet, wählbar), 3 Schriftgrößen, Hell/Dunkel,
|
||||
**Leichte Sprache** pro Seite/Meldung – geprüfte Fassung (auch als KI-Entwurf erstellt) oder, wenn so
|
||||
eingestellt, automatisch per KI übertragen (gekennzeichnet, mit „Fehler melden“)
|
||||
- **Vorlesen** jeder Seite (Knopf in der Kopfzeile) oder eines Artikels: satzweise, der gelesene Satz
|
||||
wird markiert und mitgescrollt, mit Pause, Satz vor/zurück und langsamem Tempo
|
||||
- **Push-Benachrichtigungen** zu Neuigkeiten und Schließzeiten (Themen frei wählbar, jederzeit abbestellbar)
|
||||
- Merkliste (lokal auf dem Gerät), Teilen, offline lesbar, als App installierbar
|
||||
- Seite **Barrierefreiheit** mit Erklärung und Formular „Barriere melden“
|
||||
- Keine Werbung, kein Tracking, keine externen Schriften oder CDNs
|
||||
|
||||
**Redaktion (`/admin`)**
|
||||
|
||||
- **Redaktionskalender** fürs Team: Planungen mit Status (Idee → In Arbeit → Zur Freigabe → Geplant →
|
||||
Erledigt), Zuständigkeit, Frist, Notizen und Kommentaren; Monatsansicht mit Meldungen und Terminen,
|
||||
Board nach Status, Liste; Ziehen & Ablegen (mit Tastatur-Alternative), Ideenspeicher,
|
||||
„Meldung daraus erstellen“, „Meine Aufgaben“ auf der Übersicht
|
||||
- **Ansprechpartner** einmal anlegen und in beliebig vielen Seiten und Meldungen verwenden – mit Suche,
|
||||
Reihenfolge, Anlegen direkt aus dem Auswahlfeld und „Verwendet in“
|
||||
- Meldungen (Entwurf, geplante Veröffentlichung, anheften), Seitenbaum, Termine,
|
||||
Startseiten-Bereiche, Mediathek, Postfach
|
||||
- Text-Editor mit Formatierungen, Links und Bildern
|
||||
- **Leichte Sprache per KI** (Einstellungen): Anbieter Anthropic (Claude), OpenAI, Mistral (EU), DeepSeek oder Ollama,
|
||||
Modell wählbar, Schlüssel verschlüsselt gespeichert, Verbindungstest, Tageslimit. Arbeitsweise
|
||||
**„Mit Prüfung“** (Knopf „Mit KI erstellen“ → Entwurf prüfen → speichern) oder **„Automatisch für Leser“**
|
||||
- Bilder werden automatisch gedreht, verkleinert und als WebP gespeichert
|
||||
- **Speiseplan** pflegen: Wochenansicht, Gericht per Dialog, „Vorwoche übernehmen“, Linien und Standorte
|
||||
- **Statistik:** anonyme Aufrufzahlen (ohne Cookies und IP-Adressen) – Verlauf, meistgelesene Inhalte,
|
||||
Anteil App/Web, Nutzung von Leichter Sprache und Übersetzungen
|
||||
- **Benachrichtigungen:** beim Erscheinen einer Meldung (auch zeitgesteuert), automatisch am Vortag einer
|
||||
Schließzeit, oder von Hand – mit Vorschau und Verlauf
|
||||
- **Rechtliches:** Impressum und Datenschutzerklärung aus Vorlagen, die genau beschreiben, was die App
|
||||
verarbeitet (bitte trotzdem prüfen lassen); Erklärung zur Barrierefreiheit; Barriere-Meldungen im Postfach
|
||||
- **Sicherheit:** Zwei-Faktor-Anmeldung (Authenticator-App, Wiederherstellungscodes, für Admins
|
||||
verpflichtend schaltbar), „Passwort vergessen“ per E-Mail, dauerhafte Sperren gegen Durchprobieren,
|
||||
Content-Security-Policy
|
||||
- Rollen: **Redakteur** (Inhalte) und **Administrator** (zusätzlich Benutzer & Einstellungen)
|
||||
- **Erscheinungsbild** je Einrichtung: drei Vorlagen (*Kreis*, *Klar*, *Kacheln*) mit Feinschliff –
|
||||
Hausfarben mit Kontrastprüfung („Farbe anpassen“ dunkelt zu helle Töne ab), vier gut lesbare
|
||||
Schriften (u. a. Atkinson Hyperlegible), eckig/rund/sehr rund. Das App-Symbol wird daraus erzeugt.
|
||||
- Checkliste **„Erste Schritte“** im Dashboard führt neue Einrichtungen durch die Einrichtung
|
||||
|
||||
## Native Apps (iOS und Android)
|
||||
|
||||
Im Ordner [`mobile/`](mobile/README.md) liegt die Capacitor-Hülle für App Store und Play Store – mit
|
||||
Push-Nachrichten über Firebase, nativem Vorlesen, App-Links und Symbolen aus den Einstellungen.
|
||||
Gebaut wird auf einem Mac mit Xcode bzw. Android Studio; die Schritte stehen in
|
||||
[`mobile/README.md`](mobile/README.md). Die Apps laden die Inhalte von der Web-App, neue Inhalte
|
||||
brauchen also kein App-Update.
|
||||
|
||||
## Barrierefreiheit
|
||||
|
||||
App und Redaktion werden mit [axe-core](https://github.com/dequelabs/axe-core) gegen WCAG 2.2 AA geprüft
|
||||
(hell und dunkel, Handy und Desktop) – aktuell ohne Befund. Dazu u. a.: Sprunglinks zum Inhalt,
|
||||
sichtbarer Tastaturfokus, beschriftete Bedienelemente, Ansagen für Screenreader bei Änderungen,
|
||||
Tastatur-Alternativen zu Ziehen & Ablegen, `prefers-reduced-motion`, Kontrast ≥ 4,5 : 1.
|
||||
Schriftgröße und Farbschema lassen sich auch in der Redaktion einstellen (Mein Konto).
|
||||
|
||||
## Tests
|
||||
|
||||
```bash
|
||||
npm run test:unit # Vitest: Logik und Server-Funktionen mit eigener Test-Datenbank
|
||||
npm run build
|
||||
npm run test:e2e # Playwright: Leser (Handy) und Redaktion (Desktop) inkl. axe-Prüfung, hell und dunkel
|
||||
```
|
||||
|
||||
Die Ende-zu-Ende-Tests starten die gebaute App mit frischer Demo-Datenbank und einem nachgebauten
|
||||
KI-Dienst (`tests/e2e/`). Einmalig `npx playwright install chromium` – oder mit `PW_CHROMIUM=/pfad/zu/chrome`
|
||||
ein vorhandenes Chromium nutzen.
|
||||
|
||||
**Forgejo Actions:** `.forgejo/workflows/ci.yml` prüft jeden Push (Typen, Unit-Tests, Build, Ende-zu-Ende).
|
||||
`.forgejo/workflows/release.yml` baut bei einem Tag `v1.2.0` das Docker-Image und legt es als
|
||||
`git.loheide.cloud/friloo/werkstaetten-app:1.2.0` (und `:latest`) in die Registry. Dafür braucht es einen
|
||||
Forgejo-Runner mit dem Label `docker` (für den Release-Job mit Zugriff auf den Docker-Socket) und das
|
||||
Repository-Secret `REGISTRY_TOKEN` (Token mit „package: write“). Änderungen stehen in [`CHANGELOG.md`](CHANGELOG.md).
|
||||
|
||||
## Technik
|
||||
|
||||
SvelteKit 2 (Svelte 5) · Tailwind CSS 4 · SQLite (better-sqlite3) mit Drizzle ORM · sharp · Tiptap.
|
||||
Bewusst schlank: ein Node-Prozess, eine SQLite-Datei, ein Upload-Ordner (~200 MB RAM im Betrieb).
|
||||
|
||||
## Loslegen (Entwicklung)
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run db:seed # Demo-Inhalte (fiktive „Lindenhof Werkstätten“)
|
||||
npm run user:create -- admin@example.org ein-langes-passwort admin "Vorname Name"
|
||||
npm run dev
|
||||
```
|
||||
|
||||
App: http://localhost:5173 · Redaktion: http://localhost:5173/admin
|
||||
|
||||
## Betrieb
|
||||
|
||||
```bash
|
||||
cp .env.example .env # ORIGIN, ADMIN_EMAIL, ADMIN_PASSWORD setzen
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
Alle Daten (Datenbank + Uploads) liegen in `./data` – das ist das Einzige, was gesichert werden muss.
|
||||
Der Container lauscht auf `127.0.0.1:3000`; davor einen Reverse-Proxy mit HTTPS (z. B. Caddy) setzen.
|
||||
Ohne Docker: `npm ci && npm run build && ORIGIN=https://… BODY_SIZE_LIMIT=30M node build`.
|
||||
|
||||
**Überwachung:** `GET /health` antwortet mit Status, Version und Datenbank-Zustand (HTTP 503 bei
|
||||
Problemen) – geeignet für Uptime-Kuma, Healthchecks o. ä. Unerwartete Fehler landen im Log und, mit
|
||||
`ALERT_EMAIL`, im Postfach der Betreuung. Die Version steht unten in der Seitenleiste der Redaktion.
|
||||
|
||||
| Variable | Bedeutung |
|
||||
| --------------------------------- | --------------------------------------------------------------- |
|
||||
| `ORIGIN` | Öffentliche URL (Pflicht in Produktion, sonst schlagen Formulare fehl) |
|
||||
| `DATA_DIR` | Ordner für `app.db` und `uploads/` (Standard `./data`) |
|
||||
| `ADMIN_EMAIL` / `ADMIN_PASSWORD` | Erster Admin, wird angelegt, solange es noch keinen Benutzer gibt |
|
||||
| `APP_NAME`, `ORG_NAME`, `BRAND_COLOR`, `ACCENT_COLOR` | Optionale Startwerte beim allerersten Start |
|
||||
| `BODY_SIZE_LIMIT` | Max. Upload-Größe (im Docker-Image auf 30M gesetzt) |
|
||||
| `ALERT_EMAIL` | Bekommt unerwartete Fehler per E-Mail (gleiche Fehler höchstens stündlich, max. 20/Tag; braucht SMTP) |
|
||||
| `APP_VERSION` | Beim Bauen: Versionsnummer für `/health` und die Redaktion (Standard: aus `package.json`) |
|
||||
| `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASS`, `SMTP_FROM` | E-Mail-Versand für „Passwort vergessen“. Ohne SMTP steht der Link im Server-Log |
|
||||
| `GOOGLE_TOKEN_URL`, `FCM_API_URL` | Nur für Tests: andere Adressen für Firebase |
|
||||
| `VAPID_PUBLIC_KEY` / `VAPID_PRIVATE_KEY` | Optional – sonst werden die Push-Schlüssel automatisch erzeugt und gespeichert |
|
||||
|
||||
## Mehrere Einrichtungen
|
||||
|
||||
Jede Werkstatt bekommt eine **eigene Installation**: eigener Container, eigene Datenbank, eigene
|
||||
Domain – Daten und Zugänge bleiben strikt getrennt, und jede Einrichtung gestaltet ihre App selbst
|
||||
(Vorlage, Farben, Schrift, Logo unter *Einstellungen → Erscheinungsbild*). Alle nutzen dasselbe Image.
|
||||
|
||||
```bash
|
||||
docker build -t werkstatt-app:latest . # einmal bzw. bei jedem Update
|
||||
|
||||
APP_NAME="Lindenhof-App" ORG_NAME="Lindenhof Werkstätten" BRAND_COLOR=#0f4c5c \
|
||||
deploy/neue-einrichtung.sh lindenhof app.lindenhof-werkstaetten.de it@lindenhof.de
|
||||
cd /srv/werkstatt-apps/lindenhof && docker compose up -d
|
||||
```
|
||||
|
||||
Das Skript legt `/srv/werkstatt-apps/<kurzname>/` mit `.env`, `compose.yml` und `data/` an, wählt
|
||||
einen freien Port, erzeugt ein Admin-Passwort und gibt den passenden Caddy-Block aus. `APP_NAME`,
|
||||
`ORG_NAME`, `BRAND_COLOR` und `ACCENT_COLOR` gelten nur für den allerersten Start (zu helle Farben
|
||||
werden automatisch abgedunkelt); danach zählt, was in den Einstellungen steht.
|
||||
|
||||
| Skript | Zweck |
|
||||
| ------ | ----- |
|
||||
| `deploy/neue-einrichtung.sh <kurzname> <domain> [admin-mail]` | Einrichtung anlegen |
|
||||
| `VERSION=1.2.0 deploy/aktualisieren.sh [kurzname …]` | Image aus der Registry holen (ohne `VERSION`: lokal bauen), Einrichtungen nacheinander neu starten und per `/health` prüfen – Migrationen laufen automatisch |
|
||||
| `deploy/uebersicht.sh` | Tabelle aller Einrichtungen: Container, App-Zustand, Version, letzte Sicherung (Rückgabewert 1, wenn eine ausfällt – für cron) |
|
||||
| `deploy/sichern.sh [kurzname …]` | Datenbank (konsistente Kopie im laufenden Container) und Uploads sichern, 14 Tage aufbewahren |
|
||||
|
||||
Jede Einrichtung braucht etwa 100–150 MB RAM (Limit 384 MB). Für eigene Apps im Store je
|
||||
Einrichtung siehe [`mobile/README.md`](mobile/README.md#mehrere-einrichtungen).
|
||||
|
||||
## Erweitern
|
||||
|
||||
- **Neues Feld / neuer Inhaltstyp:** `src/lib/server/db/schema.ts` ändern → `npm run db:generate`
|
||||
erzeugt eine Migration in `drizzle/`, die beim nächsten Start automatisch eingespielt wird.
|
||||
- **Admin-Bereiche** folgen alle demselben Muster: `src/routes/admin/(panel)/<bereich>/`
|
||||
mit Liste (`+page`) und Bearbeiten (`[id]/+page`, `neu` = anlegen). Bausteine liegen in `src/lib/admin/`.
|
||||
- **Icons** für Bereiche/Seiten: `src/lib/icons.ts`. **Farben** kommen aus den Einstellungen; alle übrigen
|
||||
Töne leitet `src/app.css` daraus ab.
|
||||
- **Design-Vorlagen, Schriften, Rundungen:** `src/lib/theme.ts`. Eine Vorlage bestimmt Kopfbereich
|
||||
(`src/lib/components/Hero*.svelte`), Bereichs-Kacheln (`Tile.svelte`) und Termine auf der Startseite;
|
||||
Rundungen wirken über `data-radius` an `<html>` und die `--radius-*`-Variablen in `src/app.css`.
|
||||
- **Öffentliche Seiten:** `src/routes/(app)/`, Datenabfragen gebündelt in `src/lib/server/content.ts`.
|
||||
|
||||
## Ideen für später
|
||||
|
||||
E-Mail-Weiterleitung des Kontaktformulars, Umfragen, Bedienoberfläche in weiteren Sprachen.
|
||||
|
|
|
|||
0
data/.gitkeep
Normal file
44
deploy/aktualisieren.sh
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env bash
|
||||
# Bringt alle Einrichtungen auf eine neue Version. Die Datenbank wird beim Start
|
||||
# jeder Einrichtung automatisch migriert.
|
||||
#
|
||||
# deploy/aktualisieren.sh lokal bauen, alle Einrichtungen
|
||||
# deploy/aktualisieren.sh lindenhof nur diese
|
||||
# VERSION=1.2.0 deploy/aktualisieren.sh fertiges Image aus der Registry holen (empfohlen)
|
||||
#
|
||||
# REGISTRY_IMAGE: Image ohne Version (Standard: git.loheide.cloud/friloo/werkstaetten-app)
|
||||
# Vorher sichern: deploy/sichern.sh
|
||||
set -euo pipefail
|
||||
|
||||
BASIS="${BASIS:-/srv/werkstatt-apps}"
|
||||
REPO="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
REGISTRY_IMAGE="${REGISTRY_IMAGE:-git.loheide.cloud/friloo/werkstaetten-app}"
|
||||
|
||||
if [[ -n "${VERSION:-}" ]]; then
|
||||
export IMAGE="$REGISTRY_IMAGE:${VERSION#v}"
|
||||
echo "→ Image holen: $IMAGE"
|
||||
docker pull "$IMAGE"
|
||||
else
|
||||
export IMAGE="werkstatt-app:latest"
|
||||
echo "→ Image lokal bauen"
|
||||
docker build --build-arg APP_VERSION="$(git -C "$REPO" describe --tags --always 2>/dev/null | sed "s/^v//" || echo dev)" -t "$IMAGE" "$REPO"
|
||||
fi
|
||||
|
||||
ordner=("$BASIS"/*/)
|
||||
[[ $# -gt 0 ]] && ordner=("${@/#/$BASIS/}")
|
||||
|
||||
# Nacheinander, damit der Speicher reicht – und nach jedem Start prüfen, ob die App antwortet
|
||||
for d in "${ordner[@]}"; do
|
||||
[[ -f "$d/compose.yml" ]] || continue
|
||||
k=$(basename "$d")
|
||||
echo "→ $k"
|
||||
docker compose -f "$d/compose.yml" --project-directory "$d" up -d
|
||||
port=$(sed -n 's/^PORT=//p' "$d/.env")
|
||||
for _ in $(seq 1 30); do
|
||||
curl -sf -m 2 "http://127.0.0.1:$port/health" >/dev/null && break
|
||||
sleep 1
|
||||
done
|
||||
curl -sf -m 2 "http://127.0.0.1:$port/health" >/dev/null && echo " läuft ($(curl -s "http://127.0.0.1:$port/health" | sed -n 's/.*"version":"\([^"]*\)".*/\1/p'))" || { echo " ✘ antwortet nicht – Logs: docker logs werkstatt-$k" >&2; exit 1; }
|
||||
done
|
||||
docker image prune -f >/dev/null
|
||||
echo "Fertig."
|
||||
16
deploy/compose.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Vorlage für eine Einrichtung (eine Werkstatt). Wird von neue-einrichtung.sh in
|
||||
# den Ordner der Einrichtung kopiert. Alle Einrichtungen nutzen dasselbe Image;
|
||||
# jede hat ihre eigene .env und ihren eigenen data-Ordner.
|
||||
services:
|
||||
app:
|
||||
image: ${IMAGE:-werkstatt-app:latest}
|
||||
container_name: werkstatt-${KUNDE}
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
environment:
|
||||
PORT: 3000 # im Container immer 3000; PORT in der .env ist der Port auf dem Server
|
||||
ports:
|
||||
- '127.0.0.1:${PORT}:3000'
|
||||
volumes:
|
||||
- ./data:/data
|
||||
mem_limit: 384m
|
||||
98
deploy/neue-einrichtung.sh
Executable file
|
|
@ -0,0 +1,98 @@
|
|||
#!/usr/bin/env bash
|
||||
# Legt eine neue Einrichtung an: eigener Ordner mit .env, compose.yml und data/.
|
||||
#
|
||||
# deploy/neue-einrichtung.sh <kurzname> <domain> [admin-e-mail]
|
||||
#
|
||||
# Beispiel:
|
||||
# deploy/neue-einrichtung.sh lindenhof app.lindenhof-werkstaetten.de it@lindenhof.de
|
||||
#
|
||||
# Umgebung (optional):
|
||||
# BASIS Ordner für alle Einrichtungen (Standard: /srv/werkstatt-apps)
|
||||
# APP_NAME Name der App beim ersten Start
|
||||
# ORG_NAME Name der Einrichtung beim ersten Start
|
||||
# BRAND_COLOR Hauptfarbe (#rrggbb), ACCENT_COLOR Akzentfarbe
|
||||
# ALERT_EMAIL Adresse für Fehlermeldungen (Betreuung)
|
||||
set -euo pipefail
|
||||
|
||||
KUNDE="${1:-}"
|
||||
DOMAIN="${2:-}"
|
||||
ADMIN_EMAIL="${3:-admin@${DOMAIN}}"
|
||||
BASIS="${BASIS:-/srv/werkstatt-apps}"
|
||||
HIER="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
if [[ -z "$KUNDE" || -z "$DOMAIN" ]]; then
|
||||
sed -n '2,13p' "$0" | sed 's/^# \{0,1\}//'
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! "$KUNDE" =~ ^[a-z0-9][a-z0-9-]{1,30}$ ]]; then
|
||||
echo "Kurzname nur aus Kleinbuchstaben, Ziffern und Bindestrich (z. B. lindenhof)." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ZIEL="$BASIS/$KUNDE"
|
||||
if [[ -e "$ZIEL" ]]; then
|
||||
echo "$ZIEL gibt es schon – nichts verändert." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Nächsten freien Port ab 3001 wählen (belegte stehen in den .env der anderen Einrichtungen)
|
||||
PORT=3001
|
||||
belegt=$(cat "$BASIS"/*/.env 2>/dev/null | sed -n 's/^PORT=//p' || true)
|
||||
while grep -qx "$PORT" <<<"$belegt"; do PORT=$((PORT + 1)); done
|
||||
|
||||
PASSWORT=$(head -c 18 /dev/urandom | base64 | tr -d '/+=' | head -c 20)
|
||||
|
||||
mkdir -p "$ZIEL/data"
|
||||
cp "$HIER/compose.yml" "$ZIEL/compose.yml"
|
||||
umask 077
|
||||
cat >"$ZIEL/.env" <<EOF
|
||||
# Einrichtung: $KUNDE – angelegt am $(date +%F)
|
||||
KUNDE=$KUNDE
|
||||
PORT=$PORT
|
||||
ORIGIN=https://$DOMAIN
|
||||
|
||||
# Erster Admin-Zugang (nur beim allerersten Start). Nach dem ersten Login ändern
|
||||
# und diese beiden Zeilen löschen.
|
||||
ADMIN_EMAIL=$ADMIN_EMAIL
|
||||
ADMIN_PASSWORD=$PASSWORT
|
||||
|
||||
# Startwerte – danach im Admin-Bereich unter „Einstellungen“ änderbar
|
||||
APP_NAME="${APP_NAME:-}"
|
||||
ORG_NAME="${ORG_NAME:-}"
|
||||
BRAND_COLOR=${BRAND_COLOR:-}
|
||||
ACCENT_COLOR=${ACCENT_COLOR:-}
|
||||
|
||||
# Betreuer der Installation: bekommt Fehlermeldungen per E-Mail (braucht SMTP)
|
||||
ALERT_EMAIL=${ALERT_EMAIL:-}
|
||||
|
||||
# E-Mail-Versand (für „Passwort vergessen“ und Fehlermeldungen)
|
||||
SMTP_HOST=
|
||||
SMTP_PORT=587
|
||||
SMTP_SECURE=false
|
||||
SMTP_USER=
|
||||
SMTP_PASS=
|
||||
SMTP_FROM="${APP_NAME:-Werkstatt-App} <no-reply@$DOMAIN>"
|
||||
EOF
|
||||
# Der Container läuft als Benutzer „node“ (UID 1000) und muss in data/ schreiben dürfen
|
||||
chown 1000:1000 "$ZIEL/data" 2>/dev/null || chmod 777 "$ZIEL/data"
|
||||
|
||||
cat <<EOF
|
||||
|
||||
Einrichtung „$KUNDE“ angelegt in $ZIEL
|
||||
|
||||
Adresse: https://$DOMAIN (intern Port $PORT)
|
||||
Admin: $ADMIN_EMAIL
|
||||
Passwort: $PASSWORT
|
||||
|
||||
Nächste Schritte:
|
||||
1. Starten: cd $ZIEL && docker compose up -d
|
||||
2. Caddy: folgenden Block in die Caddyfile übernehmen und Caddy neu laden
|
||||
|
||||
$DOMAIN {
|
||||
encode zstd gzip
|
||||
reverse_proxy 127.0.0.1:$PORT
|
||||
}
|
||||
|
||||
3. SMTP-Zugang in $ZIEL/.env eintragen, danach: docker compose up -d
|
||||
4. Unter https://$DOMAIN/admin anmelden – die Checkliste „Erste Schritte“ führt durch den Rest.
|
||||
EOF
|
||||
27
deploy/sichern.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
# Sichert Datenbank und Uploads aller Einrichtungen (oder der genannten).
|
||||
#
|
||||
# deploy/sichern.sh [kurzname …]
|
||||
#
|
||||
# Die Einrichtungen müssen laufen. Ablage: $SICHERUNG (Standard: /srv/werkstatt-apps-sicherung), 14 Tage aufbewahrt.
|
||||
set -euo pipefail
|
||||
|
||||
BASIS="${BASIS:-/srv/werkstatt-apps}"
|
||||
SICHERUNG="${SICHERUNG:-/srv/werkstatt-apps-sicherung}"
|
||||
stamp=$(date +%F-%H%M)
|
||||
mkdir -p "$SICHERUNG"
|
||||
|
||||
ordner=("$BASIS"/*/)
|
||||
[[ $# -gt 0 ]] && ordner=("${@/#/$BASIS/}")
|
||||
|
||||
for d in "${ordner[@]}"; do
|
||||
d="${d%/}"
|
||||
[[ -f "$d/data/app.db" ]] || continue
|
||||
k=$(basename "$d")
|
||||
# Konsistente Kopie der laufenden SQLite-Datenbank – im Container, dort ist better-sqlite3 vorhanden
|
||||
docker exec "werkstatt-$k" node -e "require('better-sqlite3')('/data/app.db').backup('/data/sicherung.db').then(() => process.exit(0), (e) => { console.error(e); process.exit(1); })"
|
||||
tar -czf "$SICHERUNG/$k-$stamp.tar.gz" -C "$d" .env data/uploads data/sicherung.db
|
||||
rm "$d/data/sicherung.db"
|
||||
echo "→ $k gesichert"
|
||||
done
|
||||
find "$SICHERUNG" -name '*.tar.gz' -mtime +14 -delete
|
||||
27
deploy/uebersicht.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
# Übersicht aller Einrichtungen: läuft der Container, antwortet die App, welche Version.
|
||||
#
|
||||
# deploy/uebersicht.sh
|
||||
#
|
||||
# Rückgabewert 1, wenn eine Einrichtung nicht läuft – geeignet für cron oder Monitoring.
|
||||
set -uo pipefail
|
||||
|
||||
BASIS="${BASIS:-/srv/werkstatt-apps}"
|
||||
SICHERUNG="${SICHERUNG:-/srv/werkstatt-apps-sicherung}"
|
||||
fehler=0
|
||||
|
||||
printf '%-18s %-34s %-10s %-10s %-9s %s\n' EINRICHTUNG ADRESSE CONTAINER APP VERSION 'LETZTE SICHERUNG'
|
||||
for d in "$BASIS"/*/; do
|
||||
[[ -f "$d/.env" ]] || continue
|
||||
k=$(basename "$d")
|
||||
port=$(sed -n 's/^PORT=//p' "$d/.env")
|
||||
origin=$(sed -n 's/^ORIGIN=//p' "$d/.env")
|
||||
container=$(docker inspect -f '{{.State.Status}}' "werkstatt-$k" 2>/dev/null || echo fehlt)
|
||||
health=$(curl -s -m 5 "http://127.0.0.1:$port/health" 2>/dev/null)
|
||||
app=$(sed -n 's/.*"status":"\([^"]*\)".*/\1/p' <<<"$health")
|
||||
version=$(sed -n 's/.*"version":"\([^"]*\)".*/\1/p' <<<"$health")
|
||||
sicherung=$(ls -t "$SICHERUNG/$k"-*.tar.gz 2>/dev/null | head -1 | sed 's/.*-\([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\)-\([0-9]\{2\}\)\([0-9]\{2\}\).*/\1 \2:\3/')
|
||||
[[ "$container" == running && "$app" == ok ]] || fehler=1
|
||||
printf '%-18s %-34s %-10s %-10s %-9s %s\n' "$k" "${origin#https://}" "$container" "${app:-keine Antwort}" "${version:--}" "${sicherung:-–}"
|
||||
done
|
||||
exit $fehler
|
||||
19
docker-compose.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
services:
|
||||
app:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- '127.0.0.1:3000:3000'
|
||||
environment:
|
||||
ORIGIN: ${ORIGIN:-http://localhost:3000}
|
||||
ADMIN_EMAIL: ${ADMIN_EMAIL:-}
|
||||
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-}
|
||||
SMTP_HOST: ${SMTP_HOST:-}
|
||||
SMTP_PORT: ${SMTP_PORT:-587}
|
||||
SMTP_SECURE: ${SMTP_SECURE:-false}
|
||||
SMTP_USER: ${SMTP_USER:-}
|
||||
SMTP_PASS: ${SMTP_PASS:-}
|
||||
SMTP_FROM: ${SMTP_FROM:-}
|
||||
volumes:
|
||||
- ./data:/data
|
||||
mem_limit: 384m
|
||||
8
drizzle.config.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { defineConfig } from 'drizzle-kit';
|
||||
|
||||
export default defineConfig({
|
||||
schema: './src/lib/server/db/schema.ts',
|
||||
out: './drizzle',
|
||||
dialect: 'sqlite',
|
||||
dbCredentials: { url: process.env.DATABASE_PATH ?? 'data/app.db' }
|
||||
});
|
||||
135
drizzle/0000_init.sql
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
CREATE TABLE `contacts` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`role` text DEFAULT '' NOT NULL,
|
||||
`location` text DEFAULT '' NOT NULL,
|
||||
`email` text DEFAULT '' NOT NULL,
|
||||
`phone` text DEFAULT '' NOT NULL,
|
||||
`photo_id` integer,
|
||||
`listed` integer DEFAULT true NOT NULL,
|
||||
`sort_order` integer DEFAULT 0 NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
FOREIGN KEY (`photo_id`) REFERENCES `media`(`id`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `events` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`title` text NOT NULL,
|
||||
`kind` text DEFAULT 'event' NOT NULL,
|
||||
`start_date` text NOT NULL,
|
||||
`end_date` text DEFAULT '' NOT NULL,
|
||||
`start_time` text DEFAULT '' NOT NULL,
|
||||
`end_time` text DEFAULT '' NOT NULL,
|
||||
`location` text DEFAULT '' NOT NULL,
|
||||
`description` text DEFAULT '' NOT NULL,
|
||||
`published` integer DEFAULT true NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `events_start_idx` ON `events` (`start_date`);--> statement-breakpoint
|
||||
CREATE TABLE `media` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`filename` text NOT NULL,
|
||||
`thumbnail` text,
|
||||
`original_name` text NOT NULL,
|
||||
`mime_type` text NOT NULL,
|
||||
`size` integer NOT NULL,
|
||||
`width` integer,
|
||||
`height` integer,
|
||||
`alt` text DEFAULT '' NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `media_filename_unique` ON `media` (`filename`);--> statement-breakpoint
|
||||
CREATE TABLE `messages` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`message` text NOT NULL,
|
||||
`read` integer DEFAULT false NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `pages` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`parent_id` integer,
|
||||
`title` text NOT NULL,
|
||||
`slug` text NOT NULL,
|
||||
`teaser` text DEFAULT '' NOT NULL,
|
||||
`icon` text DEFAULT 'file-text' NOT NULL,
|
||||
`color` text DEFAULT 'sky' NOT NULL,
|
||||
`cover_id` integer,
|
||||
`content` text DEFAULT '' NOT NULL,
|
||||
`content_easy` text DEFAULT '' NOT NULL,
|
||||
`attachments` text DEFAULT '[]' NOT NULL,
|
||||
`contact_ids` text DEFAULT '[]' NOT NULL,
|
||||
`sort_order` integer DEFAULT 0 NOT NULL,
|
||||
`published` integer DEFAULT true NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
FOREIGN KEY (`parent_id`) REFERENCES `pages`(`id`) ON UPDATE no action ON DELETE set null,
|
||||
FOREIGN KEY (`cover_id`) REFERENCES `media`(`id`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `pages_slug_idx` ON `pages` (`slug`);--> statement-breakpoint
|
||||
CREATE INDEX `pages_parent_idx` ON `pages` (`parent_id`);--> statement-breakpoint
|
||||
CREATE TABLE `posts` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`title` text NOT NULL,
|
||||
`slug` text NOT NULL,
|
||||
`teaser` text DEFAULT '' NOT NULL,
|
||||
`cover_id` integer,
|
||||
`content` text DEFAULT '' NOT NULL,
|
||||
`content_easy` text DEFAULT '' NOT NULL,
|
||||
`video_url` text DEFAULT '' NOT NULL,
|
||||
`gallery` text DEFAULT '[]' NOT NULL,
|
||||
`attachments` text DEFAULT '[]' NOT NULL,
|
||||
`contact_ids` text DEFAULT '[]' NOT NULL,
|
||||
`pinned` integer DEFAULT false NOT NULL,
|
||||
`published` integer DEFAULT true NOT NULL,
|
||||
`published_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
FOREIGN KEY (`cover_id`) REFERENCES `media`(`id`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `posts_slug_idx` ON `posts` (`slug`);--> statement-breakpoint
|
||||
CREATE INDEX `posts_published_idx` ON `posts` (`published_at`);--> statement-breakpoint
|
||||
CREATE TABLE `sessions` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`user_id` integer NOT NULL,
|
||||
`expires_at` integer NOT NULL,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `settings` (
|
||||
`key` text PRIMARY KEY NOT NULL,
|
||||
`value` text NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `tiles` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`label` text NOT NULL,
|
||||
`icon` text DEFAULT 'star' NOT NULL,
|
||||
`color` text DEFAULT 'sky' NOT NULL,
|
||||
`href` text NOT NULL,
|
||||
`sort_order` integer DEFAULT 0 NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `users` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`password_hash` text NOT NULL,
|
||||
`role` text DEFAULT 'editor' NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);
|
||||
33
drizzle/0001_redaktionskalender.sql
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
CREATE TABLE `editorial_comments` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`item_id` integer NOT NULL,
|
||||
`user_id` integer,
|
||||
`body` text NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
FOREIGN KEY (`item_id`) REFERENCES `editorial_items`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `editorial_comments_item_idx` ON `editorial_comments` (`item_id`);--> statement-breakpoint
|
||||
CREATE TABLE `editorial_items` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`title` text NOT NULL,
|
||||
`notes` text DEFAULT '' NOT NULL,
|
||||
`kind` text DEFAULT 'post' NOT NULL,
|
||||
`status` text DEFAULT 'idea' NOT NULL,
|
||||
`assignee_id` integer,
|
||||
`date` text DEFAULT '' NOT NULL,
|
||||
`due_date` text DEFAULT '' NOT NULL,
|
||||
`post_id` integer,
|
||||
`page_id` integer,
|
||||
`created_by` integer,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
FOREIGN KEY (`assignee_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null,
|
||||
FOREIGN KEY (`post_id`) REFERENCES `posts`(`id`) ON UPDATE no action ON DELETE set null,
|
||||
FOREIGN KEY (`page_id`) REFERENCES `pages`(`id`) ON UPDATE no action ON DELETE set null,
|
||||
FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `editorial_date_idx` ON `editorial_items` (`date`);--> statement-breakpoint
|
||||
CREATE INDEX `editorial_assignee_idx` ON `editorial_items` (`assignee_id`);
|
||||
48
drizzle/0002_sicherheit_push_recht.sql
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
CREATE TABLE `password_resets` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`user_id` integer NOT NULL,
|
||||
`expires_at` integer NOT NULL,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `push_messages` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`topic` text NOT NULL,
|
||||
`title` text NOT NULL,
|
||||
`body` text DEFAULT '' NOT NULL,
|
||||
`url` text DEFAULT '/' NOT NULL,
|
||||
`recipients` integer DEFAULT 0 NOT NULL,
|
||||
`failures` integer DEFAULT 0 NOT NULL,
|
||||
`sent_by` integer,
|
||||
`automatic` integer DEFAULT false NOT NULL,
|
||||
`dedupe_key` text,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
FOREIGN KEY (`sent_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `push_messages_dedupe_key_unique` ON `push_messages` (`dedupe_key`);--> statement-breakpoint
|
||||
CREATE TABLE `push_subscriptions` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`endpoint` text NOT NULL,
|
||||
`p256dh` text NOT NULL,
|
||||
`auth` text NOT NULL,
|
||||
`topics` text DEFAULT '[]' NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `push_subscriptions_endpoint_unique` ON `push_subscriptions` (`endpoint`);--> statement-breakpoint
|
||||
CREATE TABLE `rate_limits` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`key` text NOT NULL,
|
||||
`at` integer NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `rate_limits_key_idx` ON `rate_limits` (`key`,`at`);--> statement-breakpoint
|
||||
ALTER TABLE `messages` ADD `kind` text DEFAULT 'contact' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `messages` ADD `page_url` text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `posts` ADD `notify` integer DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `posts` ADD `notified_at` integer;--> statement-breakpoint
|
||||
ALTER TABLE `users` ADD `totp_secret` text;--> statement-breakpoint
|
||||
ALTER TABLE `users` ADD `totp_enabled` integer DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `users` ADD `recovery_codes` text DEFAULT '[]' NOT NULL;
|
||||
8
drizzle/0003_leichte_sprache_auto.sql
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE `pages` ADD `content_easy_auto` text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `pages` ADD `content_easy_auto_hash` text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `pages` ADD `content_easy_auto_model` text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `pages` ADD `content_easy_auto_at` integer;--> statement-breakpoint
|
||||
ALTER TABLE `posts` ADD `content_easy_auto` text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `posts` ADD `content_easy_auto_hash` text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `posts` ADD `content_easy_auto_model` text DEFAULT '' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `posts` ADD `content_easy_auto_at` integer;
|
||||
10
drizzle/0004_native_apps.sql
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
CREATE TABLE `native_push_tokens` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`token` text NOT NULL,
|
||||
`platform` text NOT NULL,
|
||||
`topics` text DEFAULT '[]' NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `native_push_tokens_token_unique` ON `native_push_tokens` (`token`);
|
||||
40
drizzle/0005_speiseplan_uebersetzung_statistik.sql
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
CREATE TABLE `meals` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`date` text NOT NULL,
|
||||
`location` text DEFAULT '' NOT NULL,
|
||||
`line` text DEFAULT '' NOT NULL,
|
||||
`title` text NOT NULL,
|
||||
`description` text DEFAULT '' NOT NULL,
|
||||
`allergens` text DEFAULT '[]' NOT NULL,
|
||||
`labels` text DEFAULT '[]' NOT NULL,
|
||||
`price` text DEFAULT '' NOT NULL,
|
||||
`position` integer DEFAULT 0 NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
||||
`updated_at` integer DEFAULT (unixepoch()) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `meals_date_idx` ON `meals` (`date`);--> statement-breakpoint
|
||||
CREATE TABLE `page_views` (
|
||||
`day` text NOT NULL,
|
||||
`path` text NOT NULL,
|
||||
`client` text DEFAULT 'web' NOT NULL,
|
||||
`variant` text DEFAULT 'normal' NOT NULL,
|
||||
`views` integer DEFAULT 0 NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `page_views_key_idx` ON `page_views` (`day`,`path`,`client`,`variant`);--> statement-breakpoint
|
||||
CREATE INDEX `page_views_day_idx` ON `page_views` (`day`);--> statement-breakpoint
|
||||
CREATE TABLE `translations` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`kind` text NOT NULL,
|
||||
`ref_id` integer NOT NULL,
|
||||
`lang` text NOT NULL,
|
||||
`hash` text NOT NULL,
|
||||
`title` text NOT NULL,
|
||||
`teaser` text DEFAULT '' NOT NULL,
|
||||
`html` text NOT NULL,
|
||||
`model` text DEFAULT '' NOT NULL,
|
||||
`created_at` integer DEFAULT (unixepoch()) NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `translations_ref_lang_idx` ON `translations` (`kind`,`ref_id`,`lang`);
|
||||
946
drizzle/meta/0000_snapshot.json
Normal file
|
|
@ -0,0 +1,946 @@
|
|||
{
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "7a4d026d-cee9-4282-bf2f-d13c3a24cb7a",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"tables": {
|
||||
"contacts": {
|
||||
"name": "contacts",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"role": {
|
||||
"name": "role",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"location": {
|
||||
"name": "location",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"email": {
|
||||
"name": "email",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"phone": {
|
||||
"name": "phone",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"photo_id": {
|
||||
"name": "photo_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"listed": {
|
||||
"name": "listed",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": true
|
||||
},
|
||||
"sort_order": {
|
||||
"name": "sort_order",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"contacts_photo_id_media_id_fk": {
|
||||
"name": "contacts_photo_id_media_id_fk",
|
||||
"tableFrom": "contacts",
|
||||
"tableTo": "media",
|
||||
"columnsFrom": [
|
||||
"photo_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"events": {
|
||||
"name": "events",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"kind": {
|
||||
"name": "kind",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'event'"
|
||||
},
|
||||
"start_date": {
|
||||
"name": "start_date",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"end_date": {
|
||||
"name": "end_date",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"start_time": {
|
||||
"name": "start_time",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"end_time": {
|
||||
"name": "end_time",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"location": {
|
||||
"name": "location",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"published": {
|
||||
"name": "published",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": true
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"events_start_idx": {
|
||||
"name": "events_start_idx",
|
||||
"columns": [
|
||||
"start_date"
|
||||
],
|
||||
"isUnique": false
|
||||
}
|
||||
},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"media": {
|
||||
"name": "media",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"filename": {
|
||||
"name": "filename",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"thumbnail": {
|
||||
"name": "thumbnail",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"original_name": {
|
||||
"name": "original_name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"mime_type": {
|
||||
"name": "mime_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"size": {
|
||||
"name": "size",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"width": {
|
||||
"name": "width",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"height": {
|
||||
"name": "height",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"alt": {
|
||||
"name": "alt",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"media_filename_unique": {
|
||||
"name": "media_filename_unique",
|
||||
"columns": [
|
||||
"filename"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"messages": {
|
||||
"name": "messages",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"email": {
|
||||
"name": "email",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"message": {
|
||||
"name": "message",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"read": {
|
||||
"name": "read",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"pages": {
|
||||
"name": "pages",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"parent_id": {
|
||||
"name": "parent_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"slug": {
|
||||
"name": "slug",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"teaser": {
|
||||
"name": "teaser",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"icon": {
|
||||
"name": "icon",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'file-text'"
|
||||
},
|
||||
"color": {
|
||||
"name": "color",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'sky'"
|
||||
},
|
||||
"cover_id": {
|
||||
"name": "cover_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"content_easy": {
|
||||
"name": "content_easy",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"attachments": {
|
||||
"name": "attachments",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'[]'"
|
||||
},
|
||||
"contact_ids": {
|
||||
"name": "contact_ids",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'[]'"
|
||||
},
|
||||
"sort_order": {
|
||||
"name": "sort_order",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"published": {
|
||||
"name": "published",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": true
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"pages_slug_idx": {
|
||||
"name": "pages_slug_idx",
|
||||
"columns": [
|
||||
"slug"
|
||||
],
|
||||
"isUnique": true
|
||||
},
|
||||
"pages_parent_idx": {
|
||||
"name": "pages_parent_idx",
|
||||
"columns": [
|
||||
"parent_id"
|
||||
],
|
||||
"isUnique": false
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"pages_parent_id_pages_id_fk": {
|
||||
"name": "pages_parent_id_pages_id_fk",
|
||||
"tableFrom": "pages",
|
||||
"tableTo": "pages",
|
||||
"columnsFrom": [
|
||||
"parent_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"pages_cover_id_media_id_fk": {
|
||||
"name": "pages_cover_id_media_id_fk",
|
||||
"tableFrom": "pages",
|
||||
"tableTo": "media",
|
||||
"columnsFrom": [
|
||||
"cover_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"posts": {
|
||||
"name": "posts",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"slug": {
|
||||
"name": "slug",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"teaser": {
|
||||
"name": "teaser",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"cover_id": {
|
||||
"name": "cover_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"content_easy": {
|
||||
"name": "content_easy",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"video_url": {
|
||||
"name": "video_url",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "''"
|
||||
},
|
||||
"gallery": {
|
||||
"name": "gallery",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'[]'"
|
||||
},
|
||||
"attachments": {
|
||||
"name": "attachments",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'[]'"
|
||||
},
|
||||
"contact_ids": {
|
||||
"name": "contact_ids",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'[]'"
|
||||
},
|
||||
"pinned": {
|
||||
"name": "pinned",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": false
|
||||
},
|
||||
"published": {
|
||||
"name": "published",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": true
|
||||
},
|
||||
"published_at": {
|
||||
"name": "published_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"posts_slug_idx": {
|
||||
"name": "posts_slug_idx",
|
||||
"columns": [
|
||||
"slug"
|
||||
],
|
||||
"isUnique": true
|
||||
},
|
||||
"posts_published_idx": {
|
||||
"name": "posts_published_idx",
|
||||
"columns": [
|
||||
"published_at"
|
||||
],
|
||||
"isUnique": false
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"posts_cover_id_media_id_fk": {
|
||||
"name": "posts_cover_id_media_id_fk",
|
||||
"tableFrom": "posts",
|
||||
"tableTo": "media",
|
||||
"columnsFrom": [
|
||||
"cover_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"sessions": {
|
||||
"name": "sessions",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"user_id": {
|
||||
"name": "user_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"expires_at": {
|
||||
"name": "expires_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"sessions_user_id_users_id_fk": {
|
||||
"name": "sessions_user_id_users_id_fk",
|
||||
"tableFrom": "sessions",
|
||||
"tableTo": "users",
|
||||
"columnsFrom": [
|
||||
"user_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"settings": {
|
||||
"name": "settings",
|
||||
"columns": {
|
||||
"key": {
|
||||
"name": "key",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"value": {
|
||||
"name": "value",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"tiles": {
|
||||
"name": "tiles",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"label": {
|
||||
"name": "label",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"icon": {
|
||||
"name": "icon",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'star'"
|
||||
},
|
||||
"color": {
|
||||
"name": "color",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'sky'"
|
||||
},
|
||||
"href": {
|
||||
"name": "href",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sort_order": {
|
||||
"name": "sort_order",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"users": {
|
||||
"name": "users",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"email": {
|
||||
"name": "email",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"password_hash": {
|
||||
"name": "password_hash",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"role": {
|
||||
"name": "role",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'editor'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "(unixepoch())"
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"users_email_unique": {
|
||||
"name": "users_email_unique",
|
||||
"columns": [
|
||||
"email"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
}
|
||||
},
|
||||
"views": {},
|
||||
"enums": {},
|
||||
"_meta": {
|
||||
"schemas": {},
|
||||
"tables": {},
|
||||
"columns": {}
|
||||
},
|
||||
"internal": {
|
||||
"indexes": {}
|
||||
}
|
||||
}
|
||||
1203
drizzle/meta/0001_snapshot.json
Normal file
1527
drizzle/meta/0002_snapshot.json
Normal file
1589
drizzle/meta/0003_snapshot.json
Normal file
1652
drizzle/meta/0004_snapshot.json
Normal file
1922
drizzle/meta/0005_snapshot.json
Normal file
48
drizzle/meta/_journal.json
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"version": "7",
|
||||
"dialect": "sqlite",
|
||||
"entries": [
|
||||
{
|
||||
"idx": 0,
|
||||
"version": "6",
|
||||
"when": 1790710683402,
|
||||
"tag": "0000_init",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "6",
|
||||
"when": 1790780351202,
|
||||
"tag": "0001_redaktionskalender",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
"version": "6",
|
||||
"when": 1790788599464,
|
||||
"tag": "0002_sicherheit_push_recht",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 3,
|
||||
"version": "6",
|
||||
"when": 1791006046542,
|
||||
"tag": "0003_leichte_sprache_auto",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 4,
|
||||
"version": "6",
|
||||
"when": 1791010254817,
|
||||
"tag": "0004_native_apps",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 5,
|
||||
"version": "6",
|
||||
"when": 1791570610795,
|
||||
"tag": "0005_speiseplan_uebersetzung_statistik",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
12
mobile/.env.example
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Adresse, unter der die Web-App läuft (HTTPS). Die Apps laden Inhalte von dort.
|
||||
APP_URL=https://app.example.org
|
||||
|
||||
# Eindeutige App-ID (Bundle-ID bei Apple, Paketname bei Google) – später nicht mehr änderbar!
|
||||
# Dieselbe in der Redaktion unter Einstellungen → Apps eintragen.
|
||||
APP_ID=org.example.werkstattapp
|
||||
|
||||
# Name unter dem Symbol auf dem Handy
|
||||
APP_NAME=Werkstatt-App
|
||||
|
||||
# Markenfarbe (Startbildschirm, Symbol-Hintergrund)
|
||||
BRAND_COLOR=#2e2672
|
||||
13
mobile/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
node_modules
|
||||
.env
|
||||
# erzeugt von `npm run sync` bzw. `npm run assets`
|
||||
www/offline.html
|
||||
assets/
|
||||
# zeigt absolut auf node_modules – wird auf jedem Rechner neu angelegt
|
||||
ios/App/CapApp-SPM/symlinks/
|
||||
# Firebase-Konfiguration: projektspezifisch, nicht ins Repository
|
||||
android/app/google-services.json
|
||||
ios/App/App/GoogleService-Info.plist
|
||||
# Einrichtungen (je Kunde .env und Firebase-Dateien) – nicht ins Repository
|
||||
kunden/*
|
||||
!kunden/beispiel/
|
||||
2
mobile/.npmrc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Das Firebase-Plugin verlangt das Firebase-Web-SDK nur für den Browser – in der App nicht nötig
|
||||
legacy-peer-deps=true
|
||||
190
mobile/README.md
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
# Native Apps (iOS und Android)
|
||||
|
||||
Die Apps sind eine **Capacitor-Hülle** um die Web-App: Sie laden die Inhalte von eurem Server
|
||||
(`APP_URL`). Was die Redaktion veröffentlicht, erscheint sofort in Web, iPhone und Android –
|
||||
ohne App-Update. Dazu kommen native Funktionen:
|
||||
|
||||
- **Push-Nachrichten** über Firebase Cloud Messaging (Android) bzw. Apple Push über Firebase (iPhone) –
|
||||
dieselben Themen, Zeitpläne und „Benachrichtigung senden“ wie im Browser
|
||||
- **Vorlesen** mit der Sprachausgabe des Geräts (Android-WebViews haben keine eigene)
|
||||
- **App-Links**: Links zu `APP_URL` öffnen direkt die App (außer `/admin`)
|
||||
- natives Teilen, Zurück-Taste (Android), Statusleiste passend zum Farbschema, Startbildschirm,
|
||||
Offline-Seite, Symbol aus Logo und Markenfarbe der Redaktion
|
||||
|
||||
Ein App-Update braucht ihr nur, wenn sich am nativen Teil etwas ändert (neue Plugins, neue
|
||||
Capacitor-Version, neues Symbol).
|
||||
|
||||
---
|
||||
|
||||
## Einmalig vorbereiten
|
||||
|
||||
### Das braucht ihr
|
||||
|
||||
| Was | Wofür | Kosten |
|
||||
| --- | --- | --- |
|
||||
| Mac mit aktuellem **Xcode** | iOS-App bauen | – |
|
||||
| **Android Studio** (auch auf dem Mac) | Android-App bauen | – |
|
||||
| **Node.js 22** oder neuer | Skripte | – |
|
||||
| **Apple Developer Program** (möglichst als Organisation) | App Store, Push auf dem iPhone | 99 € / Jahr |
|
||||
| **Google Play Console** | Play Store | einmalig 25 $ |
|
||||
| **Firebase-Projekt** | Push-Nachrichten | kostenlos |
|
||||
| Web-App läuft unter einer **HTTPS-Adresse** | Die Apps laden die Inhalte von dort | – |
|
||||
|
||||
### 1. Projekt einrichten
|
||||
|
||||
```bash
|
||||
git clone git.loheide.cloud:friloo/werkstaetten-app.git
|
||||
cd werkstaetten-app/mobile
|
||||
npm install
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
In `mobile/.env` eintragen:
|
||||
|
||||
- `APP_URL` – Adresse der Web-App, z. B. `https://app.lindenhof.de`
|
||||
- `APP_ID` – eindeutige Kennung, z. B. `org.lindenhof.app`. **Vor dem ersten Hochladen festlegen –
|
||||
danach nicht mehr änderbar.**
|
||||
- `APP_NAME` – Name unter dem Symbol (kurz halten, max. ca. 12 Zeichen sichtbar)
|
||||
- `BRAND_COLOR` – Markenfarbe für Startbildschirm und Symbol
|
||||
|
||||
Dann Symbole und Startbildschirm erzeugen (holt Logo und Farbe von der laufenden Web-App) und die
|
||||
Projekte vorbereiten:
|
||||
|
||||
```bash
|
||||
npm run assets
|
||||
npm run sync
|
||||
```
|
||||
|
||||
`npm run sync` überträgt die Werte aus `.env` in beide Projekte und richtet Push und App-Links ein.
|
||||
Es kann beliebig oft ausgeführt werden – **nach jeder Änderung an `.env` erneut ausführen.**
|
||||
|
||||
### 2. Firebase (Push-Nachrichten)
|
||||
|
||||
1. [Firebase-Konsole](https://console.firebase.google.com) → **Projekt hinzufügen** (Google Analytics wird nicht gebraucht).
|
||||
2. **Android-App hinzufügen** – Paketname = `APP_ID` → `google-services.json` herunterladen →
|
||||
nach `mobile/android/app/google-services.json` legen.
|
||||
3. **iOS-App hinzufügen** – Bundle-ID = `APP_ID` → `GoogleService-Info.plist` herunterladen →
|
||||
nach `mobile/ios/App/App/GoogleService-Info.plist` legen **und in Xcode** (`npm run open:ios`) aus dem
|
||||
Finder in den Ordner **App/App** ziehen („Copy items if needed“ aus, Ziel **App** angehakt).
|
||||
4. **Apple-Push-Schlüssel**: Im [Apple-Developer-Konto](https://developer.apple.com/account/resources/authkeys/list)
|
||||
unter *Keys* einen Schlüssel mit **Apple Push Notifications service (APNs)** erstellen, `.p8` herunterladen.
|
||||
In Firebase: *Projekteinstellungen → Cloud Messaging → Apple-App-Konfiguration →
|
||||
APNs-Authentifizierungsschlüssel* hochladen (mit Key-ID und Team-ID).
|
||||
5. **Dienstkonto für den Server**: *Projekteinstellungen → Dienstkonten → Neuen privaten Schlüssel
|
||||
generieren*. Die JSON-Datei in der Redaktion unter **Einstellungen → Apps** hochladen
|
||||
(wird verschlüsselt gespeichert). Die Datei danach vom Rechner löschen.
|
||||
|
||||
Die beiden Firebase-Dateien aus 2. und 3. sind absichtlich nicht im Git-Repository.
|
||||
|
||||
### 3. In der Redaktion eintragen
|
||||
|
||||
**Einstellungen → Apps (iOS und Android):**
|
||||
|
||||
- **App-ID** = `APP_ID`
|
||||
- **Apple Team-ID** (Apple-Developer-Konto → *Membership*)
|
||||
- **Android SHA-256**: nach dem ersten Hochladen in die Play Console unter
|
||||
*Einrichten → App-Integrität → App-Signaturschlüsselzertifikat*. Für Tests mit eigenen Builds
|
||||
zusätzlich den Fingerabdruck eures Upload-Schlüssels (eine Zeile pro Fingerabdruck).
|
||||
- **Store-Links**, sobald die Apps veröffentlicht sind – dann weist die Website auf die Apps hin
|
||||
und Safari zeigt das App-Banner.
|
||||
|
||||
Prüfen, ob die App-Links-Nachweise ausgeliefert werden:
|
||||
|
||||
```bash
|
||||
curl https://app.lindenhof.de/.well-known/apple-app-site-association
|
||||
curl https://app.lindenhof.de/.well-known/assetlinks.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## iOS bauen
|
||||
|
||||
```bash
|
||||
npm run sync
|
||||
npm run open:ios
|
||||
```
|
||||
|
||||
In Xcode:
|
||||
|
||||
1. Ziel **App** → **Signing & Capabilities** → *Team* wählen.
|
||||
2. Prüfen, dass diese Fähigkeiten aktiv sind (sie stehen bereits in `App.entitlements` bzw.
|
||||
`Info.plist`; falls Xcode sie nicht anzeigt, mit **+ Capability** hinzufügen):
|
||||
**Push Notifications**, **Background Modes → Remote notifications**, **Associated Domains**
|
||||
(`applinks:<eure Domain>`).
|
||||
3. Auf einem **echten iPhone** testen (Push ist im Simulator nur eingeschränkt möglich).
|
||||
4. Veröffentlichen: **Product → Archive → Distribute App → App Store Connect** → in
|
||||
App Store Connect über **TestFlight** testen, dann zur Prüfung einreichen.
|
||||
|
||||
`aps-environment` steht auf `development`; beim Archivieren für den App Store setzt Xcode
|
||||
automatisch `production`.
|
||||
|
||||
## Android bauen
|
||||
|
||||
```bash
|
||||
npm run sync
|
||||
npm run open:android
|
||||
```
|
||||
|
||||
In Android Studio:
|
||||
|
||||
1. Mit einem Android-Handy (USB-Debugging) oder Emulator **Run ▶** – zum Testen.
|
||||
2. Veröffentlichen: **Build → Generate Signed App Bundle** → neuen Schlüsselspeicher (Keystore)
|
||||
anlegen. **Keystore und Passwörter sicher aufbewahren** – ohne sie keine Updates.
|
||||
3. Das `.aab` in der **Play Console** hochladen (zuerst „Interner Test“), *Play App Signing*
|
||||
aktiviert lassen. Danach den SHA-256 aus der Play Console in der Redaktion eintragen (siehe oben).
|
||||
|
||||
---
|
||||
|
||||
## Prüfung durch Apple und Google
|
||||
|
||||
- **Apple (Richtlinie 4.2 „Minimum Functionality“)**: Reine Website-Hüllen lehnt Apple ab. In die
|
||||
Prüfnotizen schreiben, was die App nativ kann: Push-Nachrichten zu Schließzeiten und Neuigkeiten,
|
||||
Vorlesen mit der Sprachausgabe des Geräts, Leichte Sprache, Teilen, Offline-Hinweis.
|
||||
Ein Testzugang ist nicht nötig – die App hat keine Anmeldung.
|
||||
- **Datenschutzangaben** (App Store „App Privacy“ / Google „Datensicherheit“):
|
||||
erhoben wird nur eine **Gerätekennung für Push-Nachrichten** (nicht mit einer Person verknüpft,
|
||||
kein Tracking). Inhalte aus Kontakt- und Barriere-Formular: Name, E-Mail (optional), Nachricht –
|
||||
nur zur Bearbeitung der Anfrage. Keine Werbung, keine Analyse.
|
||||
- Als Datenschutzerklärung `APP_URL/datenschutz` angeben; als Support-Adresse `APP_URL/kontakt`.
|
||||
|
||||
## Updates
|
||||
|
||||
- **Inhalte**: kein App-Update nötig.
|
||||
- **Native Teile** (Plugins, Capacitor, Symbol, Name): im Ordner `mobile/`
|
||||
`npm install`, ggf. `npm run assets`, dann `npm run sync`, neu bauen und hochladen.
|
||||
Für jede neue Version in Xcode *Version/Build* bzw. in `android/app/build.gradle`
|
||||
`versionCode`/`versionName` erhöhen.
|
||||
|
||||
## Mehrere Einrichtungen
|
||||
|
||||
Jede Werkstatt bekommt ihre eigene App im Store (eigene App-ID, eigener Name, eigenes Symbol,
|
||||
eigenes Firebase-Projekt). Statt `mobile/.env` gibt es dann je Einrichtung einen Ordner:
|
||||
|
||||
```
|
||||
mobile/kunden/lindenhof/.env ← wie .env.example
|
||||
mobile/kunden/lindenhof/google-services.json ← Firebase, Android
|
||||
mobile/kunden/lindenhof/GoogleService-Info.plist ← Firebase, iOS
|
||||
```
|
||||
|
||||
Gebaut wird immer eine Einrichtung nach der anderen:
|
||||
|
||||
```bash
|
||||
KUNDE=lindenhof npm run assets # Symbole aus deren Web-App holen
|
||||
KUNDE=lindenhof npm run sync # ID, Name, Farbe, Firebase-Dateien übernehmen
|
||||
npm run open:ios # bzw. open:android → bauen und hochladen
|
||||
```
|
||||
|
||||
`npm run sync` kopiert die Firebase-Dateien der Einrichtung an die richtige Stelle und entfernt
|
||||
die einer anderen – Push-Anmeldungen landen so nie im falschen Projekt. Stammen die Symbole noch
|
||||
von einer anderen Einrichtung, gibt es einen Hinweis. Der Ordner `kunden/` wird nicht eingecheckt
|
||||
(Vorlage: `kunden/beispiel/`). Signier-Schlüssel (Android-Keystore, Apple-Zertifikate) je
|
||||
Einrichtung sicher aufbewahren.
|
||||
|
||||
## Wenn etwas nicht klappt
|
||||
|
||||
| Problem | Prüfen |
|
||||
| --- | --- |
|
||||
| Keine Push-Nachrichten | Firebase-Dateien vorhanden? APNs-Schlüssel in Firebase? Dienstkonto in der Redaktion? In der App unter *Einstellungen → Benachrichtigungen* eingeschaltet? |
|
||||
| Links öffnen den Browser statt der App | `.well-known`-Dateien abrufbar (siehe oben)? Team-ID / SHA-256 korrekt? Android: *Einstellungen → Apps → App → Standardmäßig öffnen*. |
|
||||
| „Keine Verbindung“ obwohl online | Läuft die Web-App unter `APP_URL` mit gültigem HTTPS-Zertifikat? |
|
||||
| Android: Benachrichtigungssymbol ist ein weißes Quadrat | `npm run assets` ausführen, dann `npm run sync`. |
|
||||
101
mobile/android/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
|
||||
|
||||
# Built application files
|
||||
*.apk
|
||||
*.aar
|
||||
*.ap_
|
||||
*.aab
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
# Uncomment the following line in case you need and you don't have the release build type files in your app
|
||||
# release/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/gradle.xml
|
||||
.idea/assetWizardSettings.xml
|
||||
.idea/dictionaries
|
||||
.idea/libraries
|
||||
# Android Studio 3 in .gitignore file.
|
||||
.idea/caches
|
||||
.idea/modules.xml
|
||||
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
|
||||
.idea/navEditor.xml
|
||||
|
||||
# Keystore files
|
||||
# Uncomment the following lines if you do not want to check your keystore files in.
|
||||
#*.jks
|
||||
#*.keystore
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
.cxx/
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
# google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
|
||||
# fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
fastlane/readme.md
|
||||
|
||||
# Version control
|
||||
vcs.xml
|
||||
|
||||
# lint
|
||||
lint/intermediates/
|
||||
lint/generated/
|
||||
lint/outputs/
|
||||
lint/tmp/
|
||||
# lint/reports/
|
||||
|
||||
# Android Profiling
|
||||
*.hprof
|
||||
|
||||
# Cordova plugins for Capacitor
|
||||
capacitor-cordova-android-plugins
|
||||
|
||||
# Copied web assets
|
||||
app/src/main/assets/public
|
||||
|
||||
# Generated Config files
|
||||
app/src/main/assets/capacitor.config.json
|
||||
app/src/main/assets/capacitor.plugins.json
|
||||
app/src/main/res/xml/config.xml
|
||||
2
mobile/android/app/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/build/*
|
||||
!/build/.npmkeep
|
||||
54
mobile/android/app/build.gradle
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
namespace = "org.example.werkstattapp"
|
||||
compileSdk = rootProject.ext.compileSdkVersion
|
||||
defaultConfig {
|
||||
applicationId "org.example.werkstattapp"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
||||
ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir{
|
||||
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
||||
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
||||
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
||||
implementation project(':capacitor-android')
|
||||
testImplementation "junit:junit:$junitVersion"
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
||||
implementation project(':capacitor-cordova-android-plugins')
|
||||
}
|
||||
|
||||
apply from: 'capacitor.build.gradle'
|
||||
|
||||
try {
|
||||
def servicesJSON = file('google-services.json')
|
||||
if (servicesJSON.text) {
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
}
|
||||
} catch(Exception e) {
|
||||
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
|
||||
}
|
||||
24
mobile/android/app/capacitor.build.gradle
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
|
||||
|
||||
android {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
||||
dependencies {
|
||||
implementation project(':capacitor-community-text-to-speech')
|
||||
implementation project(':capacitor-firebase-messaging')
|
||||
implementation project(':capacitor-app')
|
||||
implementation project(':capacitor-share')
|
||||
implementation project(':capacitor-splash-screen')
|
||||
implementation project(':capacitor-status-bar')
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (hasProperty('postBuildExtras')) {
|
||||
postBuildExtras()
|
||||
}
|
||||
21
mobile/android/app/proguard-rules.pro
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.getcapacitor.myapp;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
|
||||
assertEquals("com.getcapacitor.app", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
47
mobile/android/app/src/main/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation|density"
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/title_activity_main"
|
||||
android:theme="@style/AppTheme.NoActionBarLaunch"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<!-- werkstatt:applinks:start -->
|
||||
<intent-filter android:autoVerify="true">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="https" android:host="app.example.org" />
|
||||
</intent-filter>
|
||||
<!-- werkstatt:applinks:end -->
|
||||
</activity>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
<!-- werkstatt:push:start -->
|
||||
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_stat_notify" />
|
||||
<meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/werkstatt_brand" />
|
||||
<!-- werkstatt:push:end -->
|
||||
</application>
|
||||
|
||||
<!-- Permissions -->
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package org.example.werkstattapp;
|
||||
|
||||
import com.getcapacitor.BridgeActivity;
|
||||
|
||||
public class MainActivity extends BridgeActivity {}
|
||||
BIN
mobile/android/app/src/main/res/drawable-hdpi/ic_stat_notify.png
Normal file
|
After Width: | Height: | Size: 156 B |
BIN
mobile/android/app/src/main/res/drawable-land-hdpi/splash.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
mobile/android/app/src/main/res/drawable-land-ldpi/splash.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
mobile/android/app/src/main/res/drawable-land-mdpi/splash.png
Normal file
|
After Width: | Height: | Size: 4 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 4 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 50 KiB |
BIN
mobile/android/app/src/main/res/drawable-land-xhdpi/splash.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
mobile/android/app/src/main/res/drawable-land-xxhdpi/splash.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
mobile/android/app/src/main/res/drawable-land-xxxhdpi/splash.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
mobile/android/app/src/main/res/drawable-mdpi/ic_stat_notify.png
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
mobile/android/app/src/main/res/drawable-night/splash.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
mobile/android/app/src/main/res/drawable-port-hdpi/splash.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
mobile/android/app/src/main/res/drawable-port-ldpi/splash.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
mobile/android/app/src/main/res/drawable-port-mdpi/splash.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 51 KiB |
BIN
mobile/android/app/src/main/res/drawable-port-xhdpi/splash.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
mobile/android/app/src/main/res/drawable-port-xxhdpi/splash.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
mobile/android/app/src/main/res/drawable-port-xxxhdpi/splash.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
|
|
@ -0,0 +1,34 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="78.5885"
|
||||
android:endY="90.9159"
|
||||
android:startX="48.7653"
|
||||
android:startY="61.0927"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1" />
|
||||
</vector>
|
||||
|
After Width: | Height: | Size: 158 B |
|
After Width: | Height: | Size: 177 B |
|
After Width: | Height: | Size: 199 B |
|
|
@ -0,0 +1,170 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillColor="#26A69A"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
</vector>
|
||||
BIN
mobile/android/app/src/main/res/drawable/splash.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
12
mobile/android/app/src/main/res/layout/activity_main.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<WebView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background>
|
||||
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
|
||||
</background>
|
||||
<foreground>
|
||||
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background>
|
||||
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
|
||||
</background>
|
||||
<foreground>
|
||||
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||
BIN
mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 333 B |
|
After Width: | Height: | Size: 913 B |
|
After Width: | Height: | Size: 1,016 B |
|
After Width: | Height: | Size: 1.1 KiB |
BIN
mobile/android/app/src/main/res/mipmap-ldpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 160 B |
|
After Width: | Height: | Size: 334 B |
|
After Width: | Height: | Size: 395 B |
|
After Width: | Height: | Size: 521 B |
BIN
mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 564 B |
|
After Width: | Height: | Size: 637 B |
|
After Width: | Height: | Size: 710 B |
BIN
mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 496 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
BIN
mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 883 B |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
BIN
mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 4.6 KiB |