Skip to main content
Shipwide is a multi-platform starter kit: the shared foundation extracted from real production apps, packaged to be generic and reusable. It’s a starting point you build your product on — not a finished app.

How the parts connect

  • shipwide_api is the single backend. Both the app and the admin panel talk to it over HTTP; nothing else sits between them.
  • The app (VITE_BACKEND_URL) and the admin (VITE_API_URL) are separate origins — the admin reads everyone’s data, so it’s deployed and gated separately.
  • The app resolves its API origin once, through getAvailableServer() (src/helpers/apiServer.ts) — the single place every request gets its base URL. A self-hosted instance the user connected to wins over everything; otherwise it reads VITE_BACKEND_URL, upgrades a non-local origin to HTTPS (enforceHttps), and caches the choice for the session. Set VITE_BACKEND_FALLBACK too and it health-checks both and fails over to the backup; leave it empty and a single backend is used directly with no probe. One backend needs only VITE_BACKEND_URL — the failover path stays dormant.
  • The website is standalone marketing; its only optional tie-in is the support form, which posts to the API’s public POST /v1/support when you set PUBLIC_SUPPORT_ENDPOINT to that URL (otherwise it runs in demo mode). No account needed; the message is emailed to you.
  • Each client sends a client_id (the app’s VITE_CLIENT_ID; the admin uses admin). The API only lets in ids listed in CLIENT_IDS (plus admin), so another app can’t use your API as its backend; after sign-in the id labels the session. It ships in every build, so it’s an allowlist, not authentication.

Shared wire contract

App, API and admin all agree on:
  • One version prefix /v1/...; camelCase fields; ISO-8601 UTC timestamps; UUIDv7 ids.
  • One casing exception: sign-in request bodies are snake_case (client_id, session_name, device_id, restore_token, id_token, identity_token, …), in the app’s and the admin’s auth calls alike, as are some admin request fields and filters (user_id, is_test, …). The route’s request schema is the source of truth; responses are always camelCase.
  • Errors are flat { "code": "snake_case_reason", "message": "for logs" } — clients switch on code; message is never shown to end users.
  • Auth is a token in Authorization — Bearer <access>, or DPoP <access> plus a per-request DPoP proof once the session is bound to the device’s key — no cookies, no CSRF surface.

Auth model — one model everywhere

Passwordless: a six-digit email code where sign-in and sign-up are the same act. Google / Apple sign-in sit alongside. Access tokens are short (15 min) and rotate on refresh (30-day refresh), each bound to a sessions row so a revoked session dies immediately. A refresh token is single-use — spent twice (outside a 2-minute grace window for lost responses), it revokes its session — so the app and the admin panel coordinate refreshes across browser tabs. Sessions are DPoP-bound to a non-exportable key on the device, so a stolen token alone is useless. The admin panel uses the same model, staff-scoped, with optional TOTP. Full detail in Backend.

What you’re starting from

  • The exported pieces are ready to use — handlers, composables, api-client functions, components. Some aren’t wired into a screen yet; that’s intentional, they’re there for you to build on.
  • The account screens are built — profile with avatar, sessions, and account settings with data export and account deletion (the in-app path the App Store and Google Play require). Reskin them; your product’s own screens go on top.

Where to go next

Run everything with the Quickstart, wire up the environment in Configuration, rebrand with Customization — or go deeper into one part:

Backend

Modules, auth, routes, scripts, ops.

App

Layout, auth, encrypted storage, native builds.

Admin

Architecture, sign-in, i18n/RTL, deploy.

Website

Content, rebranding, i18n, fonts.