GoBD Logbook is a self-hostable, open-source digital mileage tracker designed to meet strict German tax office requirements (GoBD). It provides freelancers, businesses or organizations with a secure, tamper-proof way to log vehicle trips while ensuring full data sovereignty. Notes: * Currently mirrored from privat Gitlab Instance * Early development stages
  • PHP 51%
  • TypeScript 38.6%
  • CSS 6.4%
  • Python 1.8%
  • Shell 0.7%
  • Other 1.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel Böttner 98f2ddd2f3
All checks were successful
gitlab-ci GitLab CI Pipeline Passed
Merge branch 'dev' into 'main'
[Feature] Streamline Trip Logging: Two-Stage Draft & Confirmation Workflow, Single-Draft Integrity, and Inline Validation Feedback

See merge request daniel/gobd-logbook!33
2026-09-05 04:07:51 +00:00
.cache/composer feat: add .htaccess files to restrict access and create fake OCR script for testing 2026-07-08 11:14:34 +02:00
.config feat: implement multi-tenancy support with company isolation and context middleware 2026-07-10 14:04:46 +02:00
.devcontainer fix: hide system tenant from regular users 2026-08-31 17:12:02 +02:00
.forgejo ci: migrate primary CI/CD to GitLab and deactivate Forgejo triggers 2026-09-04 09:37:57 +02:00
.github feat: add AI agent safety rules and Git safety guidelines to documentation 2026-07-08 09:28:57 +02:00
.gitlab/ci feat(trips): streamline trip form workflow and minimal draft ergonomics 2026-09-04 15:43:03 +02:00
.local/share/composer feat: add .htaccess files to restrict access and create fake OCR script for testing 2026-07-08 11:14:34 +02:00
app feat: add geolocation source transparency and tiered GoBD timeliness reminders (Milestone 4) 2026-09-04 20:19:19 +02:00
bootstrap feat: add reliable evidence handling 2026-09-02 21:04:10 +02:00
client feat: add geolocation source transparency and tiered GoBD timeliness reminders (Milestone 4) 2026-09-04 20:19:19 +02:00
config fix(geo,ui): configure geo contact email and ensure dark theme contrast for alerts and chips 2026-09-04 16:02:24 +02:00
database feat: add geolocation source transparency and tiered GoBD timeliness reminders (Milestone 4) 2026-09-04 20:19:19 +02:00
deploy feat: add Portainer deployment configuration and update documentation 2026-08-25 13:10:18 +02:00
docker fix: include public storage link in production image 2026-08-26 17:11:20 +02:00
docs feat(trips): implement mobile route-timeline UI (concept 1) and documentation 2026-09-04 17:16:44 +02:00
public feat: add favicon.ico to public frontend 2026-06-17 14:13:14 +02:00
reports feat: Add comprehensive security tooling and make Docker reusable 2026-06-05 20:04:06 +02:00
resources feat: add geolocation source transparency and tiered GoBD timeliness reminders (Milestone 4) 2026-09-04 20:19:19 +02:00
routes feat: add geolocation source transparency and tiered GoBD timeliness reminders (Milestone 4) 2026-09-04 20:19:19 +02:00
scripts style: format import pipeline files 2026-08-25 12:00:40 +02:00
storage feat: add .htaccess files to restrict access and create fake OCR script for testing 2026-07-08 11:14:34 +02:00
tests feat: add geolocation source transparency and tiered GoBD timeliness reminders (Milestone 4) 2026-09-04 20:19:19 +02:00
.antigravityrules feat: add AI agent safety rules and Git safety guidelines to documentation 2026-07-08 09:28:57 +02:00
.betterleaks.toml feat: Add comprehensive security tooling and make Docker reusable 2026-06-05 20:04:06 +02:00
.cursorrules feat: add AI agent safety rules and Git safety guidelines to documentation 2026-07-08 09:28:57 +02:00
.dockerignore fix: include public storage link in production image 2026-08-26 17:11:20 +02:00
.editorconfig initial 2026-06-05 16:08:15 +02:00
.env.example test(mail): integrate mailpit test mail server into local compose stack 2026-09-04 20:22:40 +02:00
.gitignore feat: add reliable evidence handling 2026-09-02 21:04:10 +02:00
.gitlab-ci.yml ci: refactor pipeline into modular 3-tier architecture 2026-09-04 10:17:35 +02:00
.pre-commit-config.yaml feat: Add comprehensive security tooling and make Docker reusable 2026-06-05 20:04:06 +02:00
.syft.yaml feat: bump version to 0.2.0, upgrade to PHP 8.4, update license to AGPL-3.0, and refine odometer validation logic 2026-06-17 09:12:16 +02:00
AGENTS.md Add dev Container for the project 2026-08-31 16:38:24 +02:00
artisan initial 2026-06-05 16:08:15 +02:00
CHANGELOG.md feat(geo): finalize tenant provider pools and OSM integration (resolves #1) 2026-09-04 10:54:35 +02:00
clean_spatie.php Refactor migration scripts and update composer dependencies 2026-08-03 13:01:51 +02:00
composer.json docs: add versioned OpenAPI contract 2026-09-01 08:21:12 +02:00
composer.lock fix(security): resolve composer audit advisories and openapi quote syntax 2026-09-03 13:14:19 +02:00
CONTRIBUTING.md ci: configure DOCKER_HOST socket and update documentation for GitLab CI/CD 2026-09-04 11:28:02 +02:00
docker-compose.ci.yml docs: translate documentation to English, rename FrauHerre references generically, and add AI/developer rules 2026-06-10 13:15:21 +02:00
docker-compose.override.yml.example test(mail): integrate mailpit test mail server into local compose stack 2026-09-04 20:22:40 +02:00
docker-compose.portainer.yml feat: add Portainer deployment configuration and update documentation 2026-08-25 13:10:18 +02:00
docker-compose.production.yml feat: Refactor DatabaseSeeder and update environment configurations 2026-08-25 11:08:41 +02:00
docker-compose.yml test(mail): integrate mailpit test mail server into local compose stack 2026-09-04 20:22:40 +02:00
LICENSE chore: change project license from proprietary to GNU AGPLv3 2026-06-05 17:00:58 +02:00
patch_admin.py feat: implement multi-tenancy support with company isolation and context middleware 2026-07-10 14:04:46 +02:00
patch_purpose.py feat: implement multi-tenancy support with company isolation and context middleware 2026-07-10 14:04:46 +02:00
phpcs.xml feat: Implement human-reviewed odometer OCR workflow and enhance related documentation 2026-06-18 17:35:12 +02:00
phpstan.neon fix: resolve dubious ownership in containers and remove incompatible enlightn package 2026-06-08 15:53:21 +02:00
phpunit.xml feat(trips): enforce single-draft vehicle integrity and auto-resumption (M2) 2026-09-04 18:04:27 +02:00
psalm.xml feat: bump version to 0.2.0, upgrade to PHP 8.4, update license to AGPL-3.0, and refine odometer validation logic 2026-06-17 09:12:16 +02:00
README.md test(mail): integrate mailpit test mail server into local compose stack 2026-09-04 20:22:40 +02:00
VERSION feat: bump version to 0.2.0, upgrade to PHP 8.4, update license to AGPL-3.0, and refine odometer validation logic 2026-06-17 09:12:16 +02:00

GoBD Logbook

OpenCommit GitLab CI Security Scans Version

PHP Version Laravel React Ionic

License: AGPL v3

Standalone logbook app aiming to be compliant with GoDB.

Logbook logo

Goal

Offer a way for smaller companies to have a compliant logbook.

  • Customers, projects, and invoices are read from InvoiceNinja and cached locally.
  • Business trips can be manually written back as InvoiceNinja expenses.
  • Vehicles, trips, photos, audit trail, period locks, and exports remain in the logbook.

Stack

  • Laravel API
  • Laravel Passport API Auth
  • Spatie Laravel-Permission (RBAC)
  • React/Ionic PWA shell
  • Docker Compose with MariaDB and Redis
  • Evidence-Exports as CSV/PDF/ZIP
  • Restic/Borg-compatible backup concept

Key Features

  • GoBD-Compliant Logging: Cryptographically secured audit trails, support for draft vs. finalized trips, and strict immutability rules.
  • Tenant-aware Role-Based Access Control: Users can belong to multiple companies with a separate role per tenant; global super-admin access is kept separate from normal tenant memberships.
  • InvoiceNinja Sync: Automated synchronization of customers and projects, with the ability to write back business trips as expenses.
  • Mobile-Ready PWA: Modular React/Ionic frontend with customizable global themes, responsive layouts, and offline capabilities.
  • Human-Reviewed Odometer OCR: Odometer photos can be analyzed for candidate readings, but users must inspect the crop/original image, correct if needed, and explicitly accept the value.
  • Reliable Evidence Handling: Trip photos and expense receipts retain their original filename, MIME type, size and SHA-256 fingerprint. Admins can inspect protected previews in the dedicated Nachweise area without loading all binaries at once.
  • Data Integrity: Soft deletions and validation workflows ensure historical records are preserved perfectly for tax audits.

Quick Start

Install Docker and a Dev Containers-capable editor, then open this repository and choose Reopen in Container. The Dev Container starts the full Compose stack and provides PHP, Composer, Node and pnpm inside /workspace; nothing needs to be installed on the host. Dependencies are stored in Docker volumes.

Copy .env.example to .env before the first start and set the required passwords/admin values. The initial container setup installs dependencies. From its terminal, use commands directly, for example php artisan test or cd client && pnpm run lint.

To add editor- or agent-specific, local instructions without committing them, edit .devcontainer/docker-compose.local.yml after its first creation. Its tracked .example documents a read-only AGENT_CONFIG_DIR mount.

Docker Compose fallback

cp .env.example .env
# Set LOGBOOK_SUPER_ADMIN_NAME, LOGBOOK_SUPER_ADMIN_EMAIL and LOGBOOK_SUPER_ADMIN_PASSWORD in .env
docker compose up -d --build
docker compose exec app php artisan key:generate
docker compose exec app php artisan migrate
docker compose exec app php artisan app:ensure-bootstrap

Docker user mapping

If you run the containers on your host you may encounter file permission issues. The example .env contains WWWUSER and WWWGROUP (defaults: 1000). Set these in your .env to match your host user's UID/GID so files created by the containers have matching ownership. The Dockerfiles and docker-compose.yml pass these values as build args and set the service user accordingly.

The Dev Container is the reference environment because no PHP/Composer/Node is assumed on the host. Direct Docker Compose remains available as a fallback. By default, the stack starts without Traefik and binds ports directly to the host (8088 for API, 5178 for frontend, 8025 für Mailpit Web-UI).

Mail-Testing (Mailpit)

Die lokale Entwicklungsumgebung beinhaltet Mailpit als Test-Mail-Server:

  • Web-UI: http://localhost:8025 (oder mail.<LOGBOOK_HOST> bei Traefik) zur Inspektion aller versendeten E-Mails
  • SMTP-Port: 1025 (Container-intern über mailpit:1025)
  • Alle versendeten System- und Erinnerungs-Mails (z. B. logbook:send-reminders, GoBD-Warnungen, Test-Mails) werden lokal abgefangen und können visuell geprüft werden.

Traefik Setup

If you are using Traefik as a reverse proxy:

  1. Copy the override file: cp docker-compose.override.yml.example docker-compose.override.yml
  2. Ensure you have a Traefik instance running and the external network exists (docker network create traefik-network).
  3. Run docker compose up -d.

Security Tooling

The project has comprehensive static analysis and security scanning built-in. Since no local PHP/Composer/Node is assumed on the host, all tools can be run via Docker containers.

PHP Tooling: Run these commands via the app container:

docker compose exec app composer run psalm        # Static analysis
docker compose exec app composer run psalm:taint  # Taint analysis for security
docker compose exec app composer run phpstan      # Larastan analysis
docker compose exec app composer run phpcs        # Code style & security audit
docker compose exec app composer run security     # Runs all security checks

JS Tooling: Run these commands via the frontend container:

docker compose exec frontend pnpm run lint        # ESLint with security rules
docker compose exec frontend pnpm run format      # Prettier formatting

Git Hooks: To prevent accidental secret commits and formatting failures, install the Git hooks. The installer adds a Betterleaks pre-commit hook and a formatting pre-push hook that runs Pint and Prettier checks before CI does. By default, the script will try to use the betterleaks docker image if you don't have it installed natively. You can also explicitly force it to use Docker:

USE_DOCKER=1 ./scripts/install-hooks.sh

CI/CD Pipeline

The project's primary CI/CD engine is GitLab CI (.gitlab-ci.yml), executed 24/7 on a dedicated server runner with the Docker executor:

  • Tier 1 (Branch Pushes): Fast developer loop (< 45s) running Laravel Pint, Prettier, OpenAPI validation, ShellCheck, PHPUnit, and Vitest.
  • Tier 2 (Merge Requests): Quality & security gate running Larastan/PHPStan, Psalm taint analysis, ESLint security rules, PHPCS audit, Gitleaks secret detection, and dependency audits.
  • Tier 3 (Scheduled & Releases): Weekly Trivy CVE scans, Syft SPDX SBOM generation, and production Docker container builds.
  • Mirror Sync: GitLab CI automatically reports verified commit status back to the public mirror on OpenCommit via the Forgejo status API.

Legacy Forgejo Actions workflows remain in .forgejo/workflows/ with automatic triggers deactivated to avoid runner contention, but are available for manual execution.

See docs/security-ci.md for the complete pipeline reference, runner setup, and tool catalogue.

The bootstrap command creates the super-admin from .env only. Set LOGBOOK_SUPER_ADMIN_NAME, LOGBOOK_SUPER_ADMIN_EMAIL, and LOGBOOK_SUPER_ADMIN_PASSWORD before first boot; there are no built-in admin credentials. Demo-vehicle, Demo-trips and Demo-InvoiceNinja-references can be disabled with LOGBOOK_SEED_DEMO=false.

InvoiceNinja credentials are stored in the Sync tab. Multiple connections can be created, e.g. local-test and live; the active record is used for syncing. The API token is stored encrypted in the invoice_ninja_connections table.

Documentation

The maintained narrative documentation is currently written in German. Future English translations belong in docs/en/ with the same relative file name; the documentation hub & language guide describes the translation and synchronization convention.

Project Documentation

Disclaimer

The app provides technical evidence for a revision-proof logbook. The final tax acceptance must be made by a tax advisor/payroll office.