Split backend: Ultraviolet on Vercel, ScramJet local desktop#11
Split backend: Ultraviolet on Vercel, ScramJet local desktop#11
Conversation
Co-authored-by: Kiya Rose Ren-Miyakari <kiya.rose@sillylittle.tech>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Kiya Rose Ren-Miyakari <kiya.rose@sillylittle.tech>
Co-authored-by: Kiya Rose Ren-Miyakari <kiya.rose@sillylittle.tech>
Co-authored-by: Kiya Rose Ren-Miyakari <kiya.rose@sillylittle.tech>
|
@copilot the app is still having a hard time loading and working properly, the web version that is, can you investigate and resolve this. |
Agent-Logs-Url: https://github.com/SillyLittleTech/JetVeil/sessions/2c9b4ebc-f553-4112-96dc-69ecc2934965 Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
The server has been restructured to match the ACProx Express pattern in commit Key changes made to
Smoke-tested locally: |
|
Bump |
There was a problem hiding this comment.
Pull request overview
This PR splits JetVeil’s backend architecture by platform: Ultraviolet + bare-server for web/Vercel deployments, and a dedicated local ScramJet backend for desktop runtime, with corresponding Flutter settings/defaults and documentation updates.
Changes:
- Replaced the Vercel
server/backend implementation with an Ultraviolet + bare-server setup (static assets + bare routing/upgrade handling) and added Vercel bundling config for runtime assets. - Added a new
desktop/scramjet-server/Node backend to preserve ScramJet behavior for desktop local use. - Updated Flutter settings/models/UI and docs/workflows to reflect platform-specific backend selection and defaults.
Reviewed changes
Copilot reviewed 27 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| web/manifest.json | Updates PWA description to reflect split Ultraviolet/ScramJet architecture. |
| web/index.html | Updates meta description to reflect split backend model. |
| server/vercel.json | Points Vercel entry to index.js and adds includeFiles for runtime assets. |
| server/src/index.js | Removes legacy ScramJet-oriented backend implementation under server/src/. |
| server/public/uv/uv.config.js | Adds Ultraviolet runtime configuration for the web backend UI. |
| server/public/index.html | Updates UI copy from ScramJet to Ultraviolet and loads UV bundle/config scripts. |
| server/public/browser.js | Reworks client bootstrap to register UV SW, defer transport setup, and navigate via UV. |
| server/package.json | Swaps server deps to Ultraviolet + Express + bare modules and updates scripts to index.js. |
| server/package-lock.json | Adds lockfile for updated server dependency tree. |
| server/index.js | Adds new Express + bare-server implementation intended as the Vercel/web backend entrypoint. |
| README.md | Updates architecture docs and local dev instructions for split backend model and hosting changes. |
| pubspec.yaml | Updates app description to reference Ultraviolet (web) and ScramJet (desktop local). |
| lib/widgets/setup_card.dart | Updates setup messaging to reference Ultraviolet deployment flow. |
| lib/services/settings_service.dart | Changes proxy defaults/loading behavior to use platform-aware defaults. |
| lib/services/local_scramjet_service.dart | Adds conditional export wrapper for IO vs web stub implementation. |
| lib/services/local_scramjet_service_stub.dart | Adds no-op LocalScramjetService for non-IO targets (web). |
| lib/services/local_scramjet_service_io.dart | Implements desktop-only local ScramJet process launcher and readiness checks. |
| lib/screens/settings_screen.dart | Reworks settings UI to support web URL + desktop local URL + preference toggle. |
| lib/screens/home_screen.dart | Displays the effective backend URL and updates footer copy to match split model. |
| lib/models/proxy_settings.dart | Replaces ScramJet prefix settings with desktop-local URL + preference + effective URL logic. |
| lib/main.dart | Starts local ScramJet backend on desktop during app initialization. |
| desktop/scramjet-server/src/index.js | Adds standalone local ScramJet + bare-server backend with static asset routing. |
| desktop/scramjet-server/public/styles.css | Adds styling for the desktop backend’s local browser UI. |
| desktop/scramjet-server/public/index.html | Adds desktop local UI shell for ScramJet-powered browsing. |
| desktop/scramjet-server/public/browser.js | Adds ScramJet bootstrap + bare-mux transport wiring for desktop local UI. |
| desktop/scramjet-server/package.json | Adds desktop backend Node package definition and dependencies. |
| desktop/scramjet-server/package-lock.json | Adds lockfile for desktop backend dependencies. |
| .gitignore | Adds **/node_modules/ ignore rule for Node subprojects. |
| .github/workflows/release.yml | Updates release workflow triggers and messaging to include desktop backend changes. |
| .github/workflows/pre-release.yml | Updates pre-release messaging to reflect split backend architecture. |
Files not reviewed (2)
- desktop/scramjet-server/package-lock.json: Language not supported
- server/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| server.listen({ port }); |
There was a problem hiding this comment.
server.listen() is called unconditionally. In Vercel’s @vercel/node runtime the entrypoint should export a request handler (and must not start a long-running listener), otherwise the function can hang or fail to deploy. Gate the listener behind !process.env.VERCEL (or similar) and export the handler/server for Vercel.
| if (!("serviceWorker" in navigator)) { | ||
| throw new Error("service workers are not supported in this browser"); | ||
| } | ||
| await navigator.serviceWorker.register("/uv/sw.js", { |
There was a problem hiding this comment.
The service worker is registered at /uv/sw.js, but the Ultraviolet config (and dist filenames) typically use uv.sw.js (e.g. /uv/uv.sw.js). Registering the wrong path will prevent the SW from installing and break navigation. Prefer registering __uv$config.sw (or update the path to match the actual file).
| await navigator.serviceWorker.register("/uv/sw.js", { | |
| await navigator.serviceWorker.register(__uv$config.sw, { |
| const normalised = normalize(decoded).replace(/^(\.\.(\/|\\|$))+/, ""); | ||
| const full = resolve(join(base, normalised)); | ||
| if (!full.startsWith(base + "/") && full !== base) return null; | ||
| return full; |
There was a problem hiding this comment.
safeJoin uses full.startsWith(base + "/") to detect traversal. On Windows, paths use backslashes, so this check can fail for valid in-base paths and cause all static file routes to 404 (or weaken traversal checks). Use a cross-platform approach like path.relative(base, full) (reject ..), or normalize separators before comparison.
Summary
server/into an Ultraviolet + bare-server backend optimized for Vercel, including UV asset serving and UV bootstrap routingdesktop/scramjet-server/Node backend that preserves ScramJet behavior for local desktop runtimeserver/src/index.jsstructure with legacy ACProx Vercel setup style (express static app + bare routing/upgrade handling)includeFilesfor UV/public/bare assets so serverless bundles include runtime filesKey changes
desktop/scramjet-server/src/index.jsdesktop/scramjet-server/public/*desktop/scramjet-server/package.jsonserver/:server/src/index.jsserver/public/browser.jsserver/public/index.htmlserver/public/uv/uv.config.jsserver/package.jsonserver/vercel.json(includeFilesfor runtime assets)lib/models/proxy_settings.dartlib/services/settings_service.dartlib/services/local_scramjet_service.dartlib/services/local_scramjet_service_io.dartlib/services/local_scramjet_service_stub.dartlib/main.dartlib/screens/settings_screen.dartlib/screens/home_screen.dartlib/widgets/setup_card.dartValidation plan executed
server/(Ultraviolet) anddesktop/scramjet-server/(ScramJet local)SillyLittleTech/acprox(index.js,vercel.json,package.json) and server refactor to match styleWalkthrough artifacts
Notes
desktop/scramjet-server/node_modulesTo show artifacts inline, enable in settings.