Skip to content

feat: v3 rewrite on the typescript monorepo stack - #110

Merged
tuke307 merged 30 commits into
mainfrom
feat/v3-modules
Oct 29, 2026
Merged

tuke307 merged 30 commits into
mainfrom
feat/v3-modules

Conversation

@tuke307

@tuke307 tuke307 commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Complete rewrite of SimTuning (v3): the .NET MAUI app is replaced by a TypeScript monorepo on the
same stack and folder layout as luki-fitti, plus a native iOS app. The frozen .NET app stays on
branch v2. Plan: docs/v3-rewrite-plan.md, API contract: docs/sim-api.md, product and design
records: PRODUCT.md, DESIGN.md.

  • Monorepo (yarn workspaces + turbo): apps/{web,api,email-worker,apple},
    packages/{common,database,ui,logger,eslint-config,typescript-config}; .NET sources and tooling
    removed from main.
  • packages/common: units, engine/intake/exhaust/dyno logic and the audio dyno DSP (WAV, FFT,
    spectrogram, DBSCAN, polynomial fit) ported 1:1 from v2, with golden tests generated by running
    the real v2 .NET code — exact parity incl. the bundled demo recording (8336 RPM points, 15
    clusters in v2 order). Corrected wheel-power physics next to the v2-parity formula.
  • packages/database: Prisma 7 schema for the v2 entities (German names kept, base units),
    migrations, seed with the v2 starter vehicles/environments as shared read-only rows.
  • apps/api: NestJS auth (from luki-fitti) + vehicle, environment and dyno modules
    (ownership deny-by-default, partial nested PATCH, duplicate, series replace, JSON export/import).
  • apps/web: Next.js 16 PWA with guest mode (IndexedDB) and account mode behind one repository
    contract; modules Fahrzeuge, Motor, Einlass, Auslass, Dyno (audio analysis in a Web Worker, GPS
    runs, power diagnosis); EN/DE; guest data migration into the account after sign-in.
  • apps/apple: SwiftUI iOS 18 app + SimTuningKit (Swift port of the logic with the same golden
    fixtures → 3-way parity v2/TS/Swift), API client with Keychain tokens, offline store.
  • Redesign „Werkstattzeichnung" (DESIGN.md): dark-first drafting-table look with Simson enamel module colours, system fonts only (condensed headings, monospace tabular numbers), hairlines, title block (Schriftfeld) per module, numbered callouts linked to a parts list (Stückliste), dimension lines in the drawings — web and iOS together; replaces the luki-fitti look.
  • Infra: own dev compose project/DB/ports, CI for build/lint/tests/format + Swift tests,
    production deploy manual for now.

Test plan

  • yarn build, yarn lint (0 warnings), yarn test — common 25, api 38, web 67 tests green
  • Golden parity v2 ↔ TypeScript ↔ Swift (swift test, 17 parity tests)
  • Migrations + seed on a fresh Postgres; API request flow against a real DB (auth, read-only
    starters, duplicate, partial PATCH, dyno series, export/import, 20k points, 401 without token)
  • Playwright e2e per module in guest mode (vehicles, motor, einlass, auslass, dyno, shell)
  • iOS simulator build + UI tests
  • Email flows (verify / reset / delete) end to end via Mailpit
  • E2E against the full stack (signed in)
  • Redesign „Werkstattzeichnung" (DESIGN.md) on web and iOS; Playwright 42/45 (remaining: Mailpit lifecycle needs the full stack), iOS UI tests 7/7, impeccable detector clean except the intended diagram grid
  • Re-enable production deploy trigger after merge

Generated with Devin

tony-meissner and others added 25 commits October 28, 2026 22:48
Orphan root of the v3 line: full rewrite from .NET MAUI to the luki-fitti
monorepo stack (Next.js, NestJS, Prisma, Swift iOS).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Phase 0 of the v3 rewrite: replace the .NET MAUI app with the luki-fitti
turbo/yarn monorepo (Next.js 16 PWA, NestJS 12 API, BullMQ email worker,
Prisma 7, shared common/ui/logger/config packages). Gym-specific code is
removed; auth, email, i18n, PWA shell and settings are kept and rebranded.

- prisma: auth-only schema with SimTuning preferences (roundingAccuracy,
  roundOnUnitChange) and a fresh init migration
- web: home with module overview, profile & settings view, guest mode
- dev ports offset from luki-fitti (pg 5438, redis 6383, caddy 8083,
  web 3005, api 3006, mailpit 1026/8026)
- production workflow is manual-only until cutover
- fix inherited lint failures (set-state-in-effect hooks, any types,
  undeclared turbo env vars) and stop logging request headers/bodies

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…io dsp

Phase 1 of the v3 rewrite. Pure TypeScript ports of SimTuning.Core with
golden tests generated by running the real v2 .NET code on the same
inputs (incl. the bundled v2 dyno recording): exact parity for formulas,
expansion chamber, RPM points and DBSCAN cluster order.

- units: v2 quantity/unit lists, conversion and v2 rounding semantics
- logic: .NET half-even rounding and integer-division quirks kept on
  purpose; timing diagram and exhaust drawing return vector geometry
- audio: 16-bit WAV reader/writer, radix-2 FFT, spectrogram (port of
  swharden/Spectrogram, MIT), DBSCAN matching the v2 NuGet package,
  QR polynomial fit

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The v3 TypeScript monorepo replaces the .NET app on main. The frozen
v2 source stays on branch v2. Removes src/, global.json, csharpier,
stylecop, cspell, editorconfig, gitattributes and the npm lockfile, and
points docs and agent instructions at the v2 branch.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
compose.dev.yml now runs as project sim-tuning-dev with database
simtuning_dev, user simtuning and named volumes for Postgres and Redis,
so local data never mixes with other stacks. Host ports move to a
dedicated block: Postgres 5450, Redis 6390, Caddy 8090, web 3010,
api 3011, Mailpit 1030/8030. Samples, defaults and docs follow.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Phase 3 of the v3 rewrite. Prisma models for the v2 entities (vehicle,
motor, einlass/vergaser, auslass/auspuff, ueberstroemer, dyno with rpm,
ps and gps samples, environment) with German names kept and values in
field base units. Starter vehicles and environments from the v2 seed are
shared read-only rows keyed by systemKey. Shared Zod input schemas, DTOs
and a versioned JSON dyno export replace the v2 zip export.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Groundwork so the module phases can be built in parallel: a repository
contract (docs/sim-api.md) with an IndexedDB guest implementation and an
API implementation, SimDataProvider with the selected vehicle and unit
rounding, shared unit-aware fields and module layout, per-module i18n
files and navigation tabs for vehicles, motor, einlass, auslass, dyno.
Turbo agent guidance is disabled so AGENTS.md stays APM-generated.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Runs yarn build, lint, unit tests and prettier on pull requests and main,
plus SimTuningKit swift tests on macOS once the apple workspace exists.
Generated APM files, email templates and local helper checkouts are
excluded from prettier.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Phase 10. After signing in, vehicles, environments and dyno runs that a
guest created on this device are offered for migration into the account
(environments first so dynos keep them, starters map by systemKey). The
local copy is cleared only after a successful migration, or on discard.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Implements the docs/sim-api.md routes on top of the shared Zod contract. Ownership is enforced
in the services (own rows plus read-only starter rows; foreign rows 404, starter writes 403).
Nested vehicle writes, duplicates, imports and dyno series replacement run in transactions.
The JSON body limit is raised to 5 MB for dyno uploads. Bruno requests live in
bruno/vehicles, bruno/sim-environments (bruno/environments holds Bruno env files) and
bruno/dynos.

Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Aligns guest mode with the API: editing or deleting a starter environment
now raises ReadOnlyEnvironmentError (API: 403) instead of not-found, and
the contract documents partial vehicle PATCH bodies and 403 for starters.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port the v2 intake (Kanal, Vergaser) and exhaust (Theorie, Anwendung) views onto the shared
module shell. All calculations come from the golden-tested common logic; pure helpers handle
unit conversion, validation and the partial vehicle updates. The expansion chamber is drawn
as a responsive, accessible SVG from getAuspuffGeometry with a results table. Like v2, only
the one-stage diffusor is computed.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Vehicles: list with active selection, create dialog, master data and port editor,
duplicate (also for starters), delete with confirm and environment management.
Motor: Hubraum, Verdichtung, Steuerdiagramm (accessible SVG) and Umrechnung tabs built
on the golden-tested common logic, with optional apply-to-vehicle for own vehicles.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Quote the node --test glob so sh does not flatten lib/**/*.spec.ts (nested
module specs were silently skipped: 12 -> 43 tests). Skip the Playwright
webServer when PLAYWRIGHT_BASE_URL points at an already running server.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Port of the v2 dyno pages: Daten (create/edit, environment, JSON export/import,
delete), Audio (upload, recording, demo file; spectrogram + DBSCAN in a Web
Worker with progress and cancel; cluster pick, degree-5 fit, save as RPM curve),
Messung (guided GPS acceleration and coast-down run with optional engine-sound
recording) and Diagnose (power curve via getLeistung, saved as dynoPs).

Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
v2 GetLeistung multiplies by 60 instead of dividing and uses absolute time
as dt, which gave ~1e14 PS. It stays golden-tested for parity; the
diagnosis now uses getLeistungskurve (speed from gearing, acceleration by
central differences) and gives plausible moped figures. The
Permissions-Policy header blocked recording and GPS runs; allow both for
the own origin (camera stays off).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Native iOS 18 SwiftUI app mirroring the luki-fitti Apple workspace (XcodeGen project plus a
local Swift 6 package, iOS only).

SimTuningKit ports the shared packages/common logic (engine, intake, exhaust incl. chamber
geometry, dyno, units, .NET half-even rounding) and the audio dyno DSP (WAV, radix-2 FFT,
spectrogram, rotational speed, DBSCAN, QR polyfit). Golden tests reuse the v2 fixtures and
assert the same values as the TS specs, pinning v2 .NET, TypeScript and Swift to identical
numbers. It also adds Codable DTOs with validation, an async API client with Keychain tokens
and single-flight refresh rotation, and an offline guest repository seeded from the starter
catalog.

The app offers Fahrzeuge, Motor, Einlass, Auslass, Dyno (audio recording/import analysed off
the main actor, GPS runs, power diagnosis chart, JSON export/import) and Profil tabs with a
shared vehicle selection, DE/EN string catalogs and guest-mode UI tests.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@gitguardian

gitguardian Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
39232333 Triggered Generic Password dab604a apps/apple/Packages/SimTuningKit/Tests/SimTuningAPITests/APIClientTests.swift View secret
39232332 Triggered Generic Password aa93ed1 apps/apple/Packages/SimTuningKit/Tests/SimTuningAPITests/APIClientTests.swift View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

tony-meissner and others added 4 commits October 29, 2026 08:15
…ng tokens

Dark drafting-table and light Lichtpause themes per DESIGN.md, module colours named after
Simson enamel colours, chart and grid tokens, system font stacks (condensed headings,
monospace tabular numerals), 4px radius and no shadows, blur or glass in shared components.
Adds .drawing-grid, .font-display, .font-data, .unit-caps and the dimension draw-in motion.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Flat shell with condensed SIMTUNING wordmark and module-colour tab indicators, Schriftfeld
title block on every module (sheet number, vehicle, engine, date), Callout, Stueckliste and
DimensionLine signature components, timing diagram and exhaust drawing on the 5 mm grid with
numbered callouts linked to parts lists, dyno charts on chart tokens, home as a sheet index.
Dark is the default theme. The exhaust drawing now crops to the chamber; e2e assertions follow
the new value/unit columns and cropped viewBox.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Add the DESIGN.md tokens to the iOS app: adaptive dark/light colours with
Increase Contrast variants, Simson module colours, condensed SF Pro headings,
SF Mono values and small-caps units, 4 pt radius and hairlines instead of shadows.

Module screens open with a Schriftfeld (sheet number, vehicle, engine, date,
module-coloured top rule) and sit on grouped lists over the drafting-table
background. The timing diagram and the exhaust chamber are redrawn on the 5 mm
grid with port dash patterns, signal-coloured dimension lines, numbered
callouts and a linked Stückliste; the power chart gets a peak callout. The
dimension lines draw in once (200 ms, instant with Reduce Motion).

New installs default to the dark appearance; the Profil theme choice is kept.
UI tests cover both drawings in dark and light and can write screenshots.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@tuke307
tuke307 merged commit 50098b8 into main Oct 29, 2026
2 of 3 checks passed
@tuke307
tuke307 deleted the feat/v3-modules branch October 29, 2026 08:19
tuke307 added a commit that referenced this pull request Oct 29, 2026
feat: v3 rewrite on the typescript monorepo stack
tuke307 added a commit that referenced this pull request Oct 29, 2026
feat: v3 rewrite on the typescript monorepo stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants