Repository navigation
Wayline: a full-stack ride-hailing sample, its CI and an Initializr template - #5984
shai-almog wants to merge 23 commits into
Conversation
…emplate scripts/wayline is one Maven project in one language: a Codename One app styled with CSS, and a Codename One Backend server. The role the server gives an account decides what it opens on: a rider's map, a driver's screen or an administrator's console, on a phone, on the desktop and hosted by the server itself in a browser. The server keeps its data in ORM entities behind repositories, with transactional services and Flyway-style migrations, and runs on SQLite, PostgreSQL, MySQL and MariaDB. It has sign-in through the built-in authorization server, phone verification, driver applications, matching, payments (simulated or Stripe), statistics and a live WebSocket channel. The app reports usage to Codename One analytics after consent. Tested like hellocodenameone: server tests on the JVM and as a native binary, simulator end-to-end tests with screenshots on phone and desktop, a headless-browser check of the hosted app, and a generated-project check (.github/workflows/wayline.yml). The Initializr offers it as a template, kept in step by scripts/sync-initializr-wayline.py, and the developer guide gains a user's and an implementor's chapter. Framework changes the sample needed or uncovered: - cn1:backend-webapp and the Gradle backendWebApp task build the app for the browser and let the server host it. - Shared-module contracts in an app reactor; ResponseStatusException; ConcurrencyFailureException for write conflicts and deadlocks, which MariaDB's snapshot isolation reports where other engines change no row. - Build-time weaving no longer exposes private types in generated code. - ParparVM: a receiver that escapes is no longer retired at frame exit. - Vector maps: tile queue with stand-ins, label collision grid, halos, road hierarchy, kinetic pan, zoom about the cursor. - JavaScript port: geolocation no longer blocks the EDT waiting for a position that never arrives; asynchronous XHR; coalesced accessibility refresh; released text layers. - JavaSE test runner retires each test's threads and listeners, and a killed test process is reported as such. - GridLayout preferred height counts implicit rows; GeneralPath grows geometrically; JavaSE mixed-font width uses advances. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 12 screenshots: 12 matched. |
|
@codex review |
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Cloudflare Preview
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6794d2d704
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Compared 206 screenshots: 206 matched. |
|
Compared 170 screenshots: 170 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 185 screenshots: 185 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in
Result: no regression |
Gradle: a project in Java and Kotlin failed in compileJava with two copies of one generated mapper. Kotlin's pass compiles the Java it has not seen yet only to resolve types, and that output was read as a dependency's, so a @mapped Java class was mapped by both passes. AnnotationProcessing now takes the class directories that are the module's own and offers nothing out of them. wayline.yml: the simulator job runs in the pr-ci-container image and the workflow could not pull it without packages: read. Sample server: - A refund is refused while a tip on the ride is still being charged, so a tip can no longer land on a ride that was refunded without it. - A ride left completed with its payment pending is settled by a scheduled pass; settling is safe to repeat. - The card limit is enforced where a card is saved, not only where a setup starts. - Two registrations racing for one e-mail answer 409, not a server error. - Changing an account's roles closes the live channel it has open. Sample client: tokens are stored under a name made from the server's address, and cleared when the address changes, so one server's tokens are never sent to another. Maps: a map removed while gliding is taken off the form that animates it, and a failed tile is asked for again when its delay runs out, without waiting for something else to repaint the map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 185 screenshots: 185 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in
Result: no regression |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
The vector map engine draws differently on this branch, so the four map screenshots are reseeded from this branch's CI captures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ght up The JavaScript port on this branch brings the ARIA overlay up to date after the screen goes quiet rather than on every change, so a bounds read 150ms after a wheel event could still describe the list part way through the scroll, and the click then selected a different sample. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…S 27 map baselines build-ios-app.sh checked that MAVEN_HOME holds a Maven and then ran ./mvnw regardless, so the Wayline iOS job failed with 'No such file or directory'. It now uses the application's wrapper where there is one and that Maven otherwise, as build-android-app.sh does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 163 screenshots: 163 matched. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed the macOS map baselines A name that follows a bend is drawn a straight stretch at a time. The stretches were laid out by each letter's width measured on its own, which a font with kerning sets wider than the same letters drawn together, so on iOS and Mac Catalyst a name read "Bro adway" where the road turned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e18980f1b5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Compared 185 screenshots: 185 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 185 screenshots: 185 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: AMD EPYC 7763 64-Core Processor (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in
Result: no regression |
|
Compared 185 screenshots: 185 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in
Result: no regression |
- A charge that fails without the processor saying whether it took the money leaves the ride pending and is asked for again under the same key; only a refused card is a failed payment. The same for a tip, which stays on the ride and can be sent again with the same amount. - A rider's two requests and two rides choosing one driver now take turns on the rider's and the driver's row, so neither ends in two rides. - The limit on guesses at a phone code is applied by the statement that counts the guess. - The driver role is not withdrawn from a driver who is on a ride. - A reconnect timer left over from before the live channel was restarted no longer opens a second connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wo prose fixes The template check built the generated app with no display, and the theme compiler opens a window; it now takes a virtual display from xvfb-run on a Linux machine without one, as server.sh does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # scripts/initializr/common/src/test/java/com/codename1/initializr/model/GeneratorModelMatrixTest.java
# Conflicts: # maven/codenameone-maven-plugin/src/main/java/com/codename1/maven/BackendPackageMojo.java
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 168 screenshots: 168 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 168 screenshots: 168 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 179 screenshots: 179 matched. Benchmark Results
Detailed Performance Metrics
ParparVM vs HotSpot (JDK 25): macOS arm64Runner CPU: Apple M1 (Virtual) (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in
Result: no regression |
…ld build does, and one prose fix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 167 screenshots: 167 matched. Benchmark Results
Detailed Performance Metrics
|
# Conflicts: # scripts/initializr/common/src/main/resources/common.zip
The CSS compiler no longer opens a window, so the virtual display the template check, server.sh and the web job arranged for it goes, along with the designer jar the simulator's pom passed along. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
…d retire proof Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dc66ed703
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// For an admin. A cash ride has nothing to return, and a ride is refunded | ||
| /// once. | ||
| public ReceiptDto refund(String rideId, String reason) throws IOException { | ||
| Ride ride = claimRefund(rideId); |
There was a problem hiding this comment.
Keep refunds retryable until processor completion
If the process stops after claimRefund() commits but before the provider call or keepRefund(), the ride remains permanently marked REFUNDED even though the money may never have been returned. Subsequent refund attempts cannot recover because claimRefund() only accepts PAID rides, and there is no scheduled reconciliation path for this state. Persist a retryable refund-pending state or allow incomplete refunds to resume idempotently.
Useful? React with 👍 / 👎.
| /// The last few destinations, the newest first. | ||
| public static List<PlaceDto> recents() { | ||
| List<PlaceDto> all = new ArrayList<PlaceDto>(); | ||
| for (int iter = 0; iter < RECENT_LIMIT; iter++) { | ||
| PlaceDto place = place(RECENTS + "." + iter); |
There was a problem hiding this comment.
Isolate recent destinations by signed-in account
When one user signs out and another signs in on the same device, these recent destinations are read from the same device-wide keys. Sign-out never clears them, and Account.changed() explicitly excludes RECENTS from server synchronization, so even a successful load of the new account leaves the previous rider's destinations and coordinates visible in place suggestions. Namespace these entries by account/server or clear them when the session changes.
Useful? React with 👍 / 👎.
| // Last: the tokens in hand stop working when the sign-in is gone. | ||
| users.deleteUser(username); |
There was a problem hiding this comment.
Prevent reuse of deleted account identifiers
When the same e-mail is registered again after deletion, removing the user record makes that username available while retained rides, receipts, and payouts remain keyed to it, so the new account inherits the previous account's history and financial state. An unexpired JWT issued before deletion also becomes valid again because API authorization resolves its subject against whichever user currently has that username. Preserve a tombstone or use a non-reusable internal principal, and detach retained records from the login identifier.
Useful? React with 👍 / 👎.
| if (!admin && username.equals(by)) { | ||
| throw new ResponseStatusException(400, "You cannot withdraw your own admin role"); |
There was a problem hiding this comment.
Serialize reciprocal admin-removal operations
When two admins concurrently revoke each other's admin role, each request targets a different account and therefore passes this self-removal guard; both updates can commit on separate user rows, leaving the service with no administrator. Concurrent reciprocal calls to suspend() have the same outcome. Enforce the at-least-one-active-admin invariant under a shared lock or other database-level serialization covering both operations.
Useful? React with 👍 / 👎.
| } catch (IOException failed) { | ||
| System.err.println("could not send a verification code: " + failed.getMessage()); | ||
| discard(username); | ||
| throw new ResponseStatusException(503, "We could not send the code. Try again shortly"); |
There was a problem hiding this comment.
Discard only the verification code whose send failed
If an SMS send remains in flight for longer than the 30-second resend interval, another request can store and successfully send a newer code before this first call fails. This unconditional discard(username) then deletes the newer valid code, so the user receives a code that the server will reject. Make the cleanup conditional on the stored hash or generation still matching the failed send.
Useful? React with 👍 / 👎.
| public static void unwatch(Watcher watcher) { | ||
| WATCHERS.remove(watcher); | ||
| } |
There was a problem hiding this comment.
Stop location updates after the last watcher leaves
When the final map screen is deinitialized, this removes only the application callback and leaves the platform LocationManager listener installed. Because started also remains true, the browser or device continues its geolocation watch indefinitely after navigating to a non-map screen or signing out, consuming battery and retaining location fixes with no consumer. Clear the platform listener and reset the search generation when WATCHERS becomes empty.
Useful? React with 👍 / 👎.
| @Override | ||
| public UserDto deleteAccount() throws Exception { | ||
| return accounts.close(Caller.name()); |
There was a problem hiding this comment.
Require reauthentication before permanent deletion
A bearer token alone can invoke this endpoint and irreversibly remove the account, including its profile, cards, and sign-in. In the borrowed or unattended-phone scenario that changePassword() explicitly protects against by checking the current password, an attacker with the unlocked session can instead delete the entire account without proving current credentials. Require the current password or another recent-authentication proof for deletion as well.
Useful? React with 👍 / 👎.
| .rateLimit("/api/account/password", | ||
| RateLimitKeys.firstOf(RateLimitKeys.principal(), RateLimitKeys.clientAddress()), | ||
| new InMemoryRateLimiter(10, 3600)) | ||
| .rateLimit("/api/driving/application/documents", | ||
| RateLimitKeys.firstOf(RateLimitKeys.principal(), RateLimitKeys.clientAddress()), | ||
| new InMemoryRateLimiter(60, 3600)) |
There was a problem hiding this comment.
Rate-limit outbound geocoding requests
Any authenticated account can call /api/geo/search and /api/geo/reverse without a limit, and every valid call makes an outbound request to the configured geocoder. A single cheaply registered account can therefore generate unbounded third-party traffic, exhaust a paid quota, or cause the default public Photon instance to block the service. Add a per-principal/client-address limiter for /api/geo/** alongside the other externally costly endpoints.
Useful? React with 👍 / 👎.
What this is
scripts/waylineis a modern successor to the ride-hailing app of "Create an Uber clone in 14 days": one Maven project in one language, a Codename One app styled with CSS and a Codename One Backend server. The roles the server gives an account decide what it opens on: a rider's map, a driver's screen or an administrator's console. It runs on phones, as a desktop app, and hosted by its own server in a browser.@Transactionalservices, Flyway-style migrations (per-engine variants where the SQL differs), matching, a ride state machine that settles races in the database, simulated or Stripe payments, a WebSocket live channel.scripts/sync-initializr-wayline.py(CI fails on drift). The grub and tweet templates are removed.Framework changes the sample needed or uncovered
cn1:backend-webappand the GradlebackendWebApptask: build the app for the browser and let the server host it.ResponseStatusException;ConcurrencyFailureExceptionfor write conflicts and deadlocks (MariaDB's snapshot isolation reports error 1020 where other engines change no row).FrameRetireLiveReceiverIntegrationTest).GridLayoutpreferred height counts implicit rows;GeneralPathgrows geometrically; JavaSE mixed-font width uses advances.Testing
Run locally on the merged tree:
scripts/wayline/screenshots.run-web-e2e.shin headless Chromium.Not verified:
.github/workflows/wayline.ymlhas never run on GitHub.🤖 Generated with Claude Code