Skip to content

Frontend (Sveltekit)

Purely static frontend using SvelteKit’s adapter-static. Uses water.css for styling and is served from PocketBase.

The frontend features:

  • Office Features:
    • analytics and job tracking
    • Worker device remote controls
  • Worker Features:
    • Sessions overview
    • Job information
    • Stop / Start TempoRush Mobile tracking
  • Playwright Testing:
    • Tests to be created

When modifying collections in Pocketbase be sure to run npm run typegen. This generates typescript types from the collection information.

Components are located in ./sk/src/lib/ (imported using $lib).

  • General components live in ./sk/src/lib/components
  • app-specific components live in ./sk/src/lib/app/components
  • Pocketbase-specific components live in ./sk/src/lib/pocketbase

To hide components based on user roles (ex. worker, editor, administrator) there is a <LoginGuard> component that will automatically hide its children based on the users role.

We rely heavily on config values stored in the config Pocketbase collection. You can access these configs from any route through $page.data.config as we feed all config items through ./sk/src/routes/+layout.ts

Due to the limitations of the current PWA ecosystem we cannot rely on a PWA alone to track the user location. PWA’s cannot run continuous background tasks, which means we require a native app that can use background service API’s.

Interacting with TempoRush Mobile Locally (Local Message Bridge)

Section titled “Interacting with TempoRush Mobile Locally (Local Message Bridge)”

When a server is detected at the local port (specified through config) you can interact with the native app using the nativeApp store ($nativeApp) this store has several functions for controlling TempoRush Mobile locally. These functions will only work if TempoRush Mobile is installed and running in the background.

Interacting with TempoRush Mobile Remotely (Remote Message Bridge)

Section titled “Interacting with TempoRush Mobile Remotely (Remote Message Bridge)”

When the TempoRush Mobile app is connected to a site and the user signs into the PWA The mobile app will recieve the users auth token and start listening to the pocketbase messaging collection. This allows you to send commands remotely to a users device.