glanzlicht / MACHWEIS

Mach’s. Beleg’s. Rechne es ab. MACHWEIS ist eine Local-First-Flutter-App für schnelle, kontrollierbare Leistungsnachweise im Handwerk. Die Oberfläche läuft auf iOS, Android und im Web und ist vollständig deutschsprachig.

Verified secure showcase
180 Files 605 KB Public size 26 Redacted Dart · PHP · SQL · Markdown · XML · PLIST

Project overview

MACHWEIS is a verified code showcase with 180 visible project entries across 8 top-level modules. The primary detected language is Dart; protected files remain visible in the structure while their contents stay private.

README

MACHWEIS

Mach’s. Beleg’s. Rechne es ab.

Produktansicht

MACHWEIS Dashboard auf Laptop und Smartphone

MACHWEIS ist eine Local-First-Flutter-App für schnelle, kontrollierbare Leistungsnachweise im Handwerk. Die Oberfläche läuft auf iOS, Android und im Web und ist vollständig deutschsprachig.

Aktueller Funktionsumfang

  • lokale Firmen-, Kunden-, Auftrags- und Mitarbeiterdaten (SQLite auf Android/iOS, Browser-Speicher im Web)
  • mobile Stammdaten-Synchronisation für Kunden, Baustellen, Aufträge, Mitarbeiterprofile und Auftragszuweisungen über die serverseitigen Push-/Pull-Endpunkte
  • atomare lokale Änderungen mit Outbox, Cursor, Retry, sichtbaren Konflikten und einer ausdrücklichen Importentscheidung bei der ersten Verbindung
  • unveränderliche Berichtsversionen mit sichtbarem Prüfverlauf
  • persistente Offline-Synchronisationswarteschlange mit Retry-Strategie
  • lokale Fotodokumentation per Kamera, Galerie oder Web-Dateiauswahl
  • gebrandete PDF-Leistungsnachweise mit Unterschrift, Fotodokumentation und vorbereitetem Teilen per E-Mail
  • prüfpflichtiger KI-Assistent für Baustellennotizen mit OpenAI, Google Gemini oder eigenem Proxy
  • Rollen: Inhaber, Büro, Bauleiter und Monteur
  • strukturierte Arbeitszeit mit Leistungsdatum, Pause und Nettozeit
  • mehrere Leistungs- und Materialpositionen
  • Zusatzaufträge mit Kundenbestätigung
  • Vollständigkeitsprüfung vor Unterschrift
  • digitale Kundenunterschrift und unveränderlicher Abschluss
  • CSV-Export und vorbereitete PDF-Renderer-Schnittstelle
  • responsive Smartphone- und Webnavigation
  • aktuelle App-Version und Build-Nummer dauerhaft am unteren Rand der Navigation

Lokale Entwicklung

flutter pub get
flutter analyze
flutter test
flutter run -d chrome

Produktkontext und technische Leitplanken stehen in [docs/PRODUCT_BRIEF.md](docs/PRODUCT_BRIEF.md). Architektur und Serververtrag der KI-Unterstützung beschreibt [docs/AI_INTEGRATION.md](docs/AI_INTEGRATION.md).

Die Stammdaten-Synchronisation ist ausschließlich für iOS und Android aktiviert. Sie verwendet das Access-Token der mobilen Anmeldung und erneuert es bei Bedarf über die bestehende Authentifizierung. Im Web bleibt die Synchronisation bewusst deaktiviert.

Backend-Grundgerüst

Das separate PHP-8.4-REST-Grundgerüst liegt in [backend/](backend/README.md). Es enthält in diesem Stand ausschließlich Infrastruktur und den Health-Endpunkt; Login, Fachlogik und KI sind noch nicht enthalten.

backend/src/ServerPdfRenderer.phpPHP
<?php
declare(strict_types=1);
namespace Machweis\Backend;
/** Minimal dependency-free PDF renderer for immutable finalized report snapshots. */
final class ServerPdfRenderer
{
/** @param array<string,mixed> $payload */
public function render(array $payload, int $version): string
{
$lines = [
'MACHWEIS – Leistungsnachweis',
'',
'Kunde: ' . $this->text($payload['customer'] ?? ''),
'Baustelle: ' . $this->text($payload['site'] ?? ''),
'Leistungsdatum: ' . substr($this->text($payload['date'] ?? ''), 0, 10),
'Arbeitszeit: ' . $this->time($payload, 'startHour', 'startMinute') . ' – ' . $this->time($payload, 'endHour', 'endMinute') . ' Uhr',
'Pause: ' . max(0, (int) ($payload['breakMinutes'] ?? 0)) . ' Minuten',
'',
'Leistungen:',
];
$activities = is_array($payload['activityItems'] ?? null) ? $payload['activityItems'] : [$payload['activity'] ?? ''];
foreach ($activities as $index => $activity) {
$value = $this->text($activity);
if ($value !== '') $lines[] = ($index + 1) . '. ' . $value;
}
$materials = is_array($payload['materialItems'] ?? null) ? $payload['materialItems'] : [];
if ($materials !== []) {
$lines[] = '';
$lines[] = 'Material:';
foreach ($materials as $material) {
if (!is_array($material)) continue;
$lines[] = trim($this->text($material['quantity'] ?? '1') . ' ' . $this->text($material['unit'] ?? 'Stk.') . ' · ' . $this->text($material['name'] ?? ''));
}
}
$additional = $this->text($payload['additionalOrder'] ?? '');
if ($additional !== '') { $lines[] = ''; $lines[] = 'Zusatzauftrag: ' . $additional; }
$lines[] = '';
$lines[] = 'Unterschrieben · unveränderliche Version V' . $version;
return $this->pdf($lines);
}
/** @param array<string,mixed> $payload */
private function time(array $payload, string $hour, string $minute): string
{
return str_pad((string) max(0, min(23, (int) ($payload[$hour] ?? 0))), 2, '0', STR_PAD_LEFT) . ':' . str_pad((string) max(0, min(59, (int) ($payload[$minute] ?? 0))), 2, '0', STR_PAD_LEFT);
}
private function text(mixed $value): string
{
$text = trim(is_scalar($value) ? (string) $value : '');
$encoded = function_exists('iconv') ? iconv('UTF-8', 'Windows-1252//TRANSLIT//IGNORE', $text) : $text;
return is_string($encoded) ? $encoded : '';
}
/** @param list<string> $lines */
private function pdf(array $lines): string
{
$content = "BT\n/F1 16 Tf\n50 790 Td\n";
foreach ($lines as $index => $line) {
if ($index > 0) $content .= "0 -20 Td\n";
$content .= '(' . str_replace(['\\', '(', ')'], ['\\\\', '\\(', '\\)'], $line) . ") Tj\n";
}
$content .= "ET\n";
$objects = [
'<< /Type /Catalog /Pages 2 0 R >>',
'<< /Type /Pages /Kids [3 0 R] /Count 1 >>',
'<< /Type /Page /Parent 2 0 R /MediaBox [0 0 595 842] /Resources << /Font << /F1 4 0 R >> >> /Contents 5 0 R >>',
'<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>',
'<< /Length ' . strlen($content) . " >>\nstream\n" . $content . 'endstream',
];
$pdf = "%PDF-1.4\n"; $offsets = [0];
foreach ($objects as $number => $object) { $offsets[] = strlen($pdf); $pdf .= ($number + 1) . " 0 obj\n" . $object . "\nendobj\n"; }
$xref = strlen($pdf); $pdf .= 'xref' . "\n0 " . (count($objects) + 1) . "\n0000000000 65535 f \n";
foreach (array_slice($offsets, 1) as $offset) $pdf .= str_pad((string) $offset, 10, '0', STR_PAD_LEFT) . " 00000 n \n";
return $pdf . 'trailer' . "\n<< /Size " . (count($objects) + 1) . " /Root 1 0 R >>\nstartxref\n" . $xref . "\n%%EOF\n";
}
}

Architecture

High-level modules detected from the verified public snapshot. Protected implementation details are intentionally omitted.

backendmodule
libmodule
iosmodule
testmodule
androidmodule
docsmodule
webmodule
assetsmodule

Technology stack

DartPHPLOCKPBXPROJSQLMarkdownFlutter / Dart
Dart66.7%
PHP14.5%
LOCK4.0%
PBXPROJ3.8%
SQL3.1%
Markdown1.3%
XML0.9%
YAML0.9%