Skip to main content

Throttle App

The Throttle app is the primary user-facing application in the DEJA.js system. It gives model railroad operators real-time control of locomotives, turnouts, signals, routes, and effects from any device with a modern web browser.

Operators can run a single train with detailed throttle controls, manage multiple trains simultaneously in a grid view, or use the Conductor view for full-station operation on large screens. Every control writes to Firebase in real time, and the DEJA.js server translates those changes into DCC-EX serial commands sent to your CommandStation.

Throttle app main screen

Key Features

  • Speed and direction control for individual locomotives using button controls (mobile) or slider controls (desktop/tablet).
  • Function buttons (F0 through F28) for headlights, horns, bells, sound effects, and decoder-specific features via a speed dial overlay.
  • Turnout management with throw/close controls and color-coded state indicators.
  • Route execution through interactive track maps or a route list, with a visual timeline showing turnout sequences and a progress bar during execution.
  • Consist support for linking multiple locomotives together, visible directly on the throttle screen.
  • Multi-throttle operation with a grid view of all active throttles, drag-to-reorder tiles, and a floating action button to add locomotives from the roster.
  • Conductor view combining throttle list, active throttle, and turnout controls in a three-pane layout designed for operator stations.
  • Signal monitoring with red, yellow, and green aspect indicators.
  • Effects control for triggering sound effects, lights, and animations on your layout.
  • Swipe navigation between locomotives on the throttle screen.
  • Emergency stop accessible from the app header on every page.
  • Theme switching between light and dark modes.
  • Guest access available without authentication for quick demonstrations.

Tech Stack

TechnologyRole
Vue 3Application framework (Composition API with <script setup lang="ts">)
Vuetify 3UI component library (Material Design)
Tailwind CSSUtility-first styling
PiniaState management
Vue Router 4Client-side routing with auth guards
VueFireReactive Firebase Firestore bindings
VueUseComposable utilities (useStorage, useSwipe, useDebounce)
FirebaseReal-time database and authentication
MQTTOptional message transport via mqtt-vue-hook
ViteDevelopment server and production builds

Navigation Structure

The Throttle app uses a customizable footer navigation bar and a slide-out side menu. The footer bar shows your favorite views as icon buttons, and you can configure which items appear through the settings.

Pages

PageRouteDescription
Home/Landing page with speedometer widgets for active throttles, login cards, and layout selection
Throttle Control/throttle/:addressFull single-locomotive control with speed, functions, consist, and emergency stop
Throttle List/throttlesGrid view of all active throttles for multi-train operation
Conductor View/conductorThree-pane operator station layout with throttle list, active throttle, and turnouts
Effects/effectsSound effects, lights, and animation control
Routes/routesInteractive track maps and route execution
Signals/signalsSignal monitoring and control
Turnouts/turnoutsTrack switch throw/close controls
Roster/locosLocomotive roster browser
Settings/settingsApp preferences and footer menu customization
Select Layout/select-layoutLayout picker for multi-layout setups
Login/loginAuthentication screen

Route Guards

Most routes require authentication. Some also require an active DCC-EX connection and a selected layout before they are accessible.

GuardApplied To
requireAuthAll pages except Home and Login
requireLayoutEffects, Signals, Routes, Turnouts, Conductor, Throttle, Throttle List
requireDccExRoster, Conductor, Throttle, Throttle List

App Shell

The Throttle app shell includes three persistent UI elements visible across all pages:

  • AppHeader -- displays the app name, layout power toggle, emergency stop button, device connection status, and user profile. The hamburger menu opens the side navigation drawer.
  • Side Menu -- a slide-out drawer with the full list of navigation items, each with an icon and color. Items marked as favorites also appear in the footer bar.
  • Footer Bar -- a pill-shaped button group at the bottom of the screen showing your favorited navigation items for quick access. The default favorites are Throttles, Conductor, Throttle, Effects, Routes, Turnouts, and Signals.

Page transitions use a fade animation when navigating between views. Swipe gestures on the main content area navigate forward and backward through the menu (disabled on the Throttle Control page, which uses swipe for locomotive switching).