← Back to the app User guide

Admin guide

For the fleet program administrator: setting up devices and access codes, loading the fleet, changing checklists and rules, backups, resets and troubleshooting. Members should read the user guide.

1. How the system fits together

Phones, tablets, laptops⇄api.php on fleet.spcfpd.org⇄Flat files in ~/fvm-data

Full technical detail: DATA-MODEL.md.

2. First-time setup checklist

  1. Issue the department's access code(s) — section 3. Retire the test code once real data goes in.
  2. Review config/program.json against your SOPs: lock-out steps, release roles, check-out purposes, the 12-hour pre-trip window — section 7.
  3. Clear any test or demo data from the server and devices — section 9.
  4. Import the fleet roster from the spreadsheet — section 5.
  5. Place lock-outs for any units already out of service, and record the last known PM / service test dates so due dates start correctly.
  6. Hand out the device setup card and the access code.
  7. Set a backup routine — section 8.

3. Access codes

Give every person their own code (or one per shared station tablet). Everything a code uploads is stamped with its name, and the server logs each upload with the internet address it came from, so changes can be traced. A code can be cut off at once without re-keying anyone else.

Roles

RoleCan
MemberInspections, check-out / check-in, lock-outs and releases, work orders, PM records. Cannot add or change units — the server refuses those changes.
OfficerEverything a member can, plus add / edit units and import the fleet spreadsheet.
AdministratorEverything, plus issue, change and deactivate access codes and read the activity log.

In the app (recommended)

  1. Connect your own device with an administrator code. Data & settings › Server then shows Manage access codes.
  2. Issue: enter the person's name, badge ID and role › Issue code. The code is shown once — copy it or press Print slip and hand it over in person. The server keeps only a fingerprint; a lost code can't be looked up, only replaced.
  3. Deactivate: press Deactivate on the person's row — for a member leaving, a lost phone, or a code that may have spread. Their devices show Access code rejected on the next sync; records already uploaded stay. Reactivate undoes it.
  4. Change role with the drop-down on the row.
  5. Recent activity lists every upload (with unit names for fleet changes), code change and refused code, with time and internet address. Use the filter to find, for example, every change to “Engine 9-1”.

You can't deactivate or demote the code you're signed in with, and at least one active administrator code must remain.

From the server shell (backup method)

cPanel › Terminal or SSH, in the program folder:

cd ~/fleet.spcfpd.org
php api.php list-keys                                  # every code: id, name, role, active, last used
php api.php issue-key "Pat Rivera" officer 417         # new code (printed once): name, role, badge ID
php api.php deactivate-key "Pat Rivera"                # cut off (name or id)
php api.php reactivate-key "Pat Rivera"

Use the shell if every administrator code is lost: php api.php issue-key "New admin" admin.

Retire the shared test code. Codes issued before roles existed (like the original test code) became member codes. Once everyone has their own code, deactivate it.

4. Setting up devices

5. Loading and updating the fleet

From the spreadsheet template

  1. In the app: Fleet › Import / update from spreadsheet › Download Excel template. It has drop-downs, an Instructions tab and a Unit types tab.
  2. One row per vehicle. Only Unit name and Unit type are required. Equipment columns: Y / N only where a unit differs from its type's defaults.
  3. Choose the file (.xlsx or .csv). The preview marks each row New, Update, No change or Skipped with the reason. Nothing is saved until you press Import.
  4. Import on one device only. The others download the units by syncing. Importing the same new file on two devices creates every unit twice.

Updating later

From the district Apparatus Master

The converter turns the Apparatus Master workbook's Fleet Master tab into an import file. It maps Current Assignment to unit name, Chassis Type to unit type, Date Acquired to in-service date and Mileage to odometer, and carries pump hours, priority and notes into Notes:

cd ~/fleet.spcfpd.org
python3 tools/convert_apparatus_master.py ~/fvm-imports/ApparatusMaster.xlsx ~/fvm-imports/fleet-import.xlsx
Keep roster files out of the website folders — they contain VINs and asset numbers. Use ~/fvm-imports, or the program's private/ folder, which the web server refuses to serve.

6. Unit types, retiring and renaming

7. Checklists, inventory, PM and rules

File in config/Controls
program.jsonInspection types and what each covers; result levels; lock-out reasons and required steps; energy sources; who may release a lock-out; check-out purposes; work-order statuses and priorities; the pre-trip window (12 h), expiry warning (30 days) and PM "due soon" thresholds (30 days / 500 mi / 25 h).
apparatus.jsonUnit types, their checklist modules, default equipment, daily-check interval and weekly interval; the equipment list.
checklists.jsonPass / fail items by section. Flags: crit (failure recommends out of service), freq: "weekly", req (only shown if the unit has that equipment), als / bls, min + unit for readings.
inventory.jsonStock lists with par levels, expiry tracking and controlled-substance sections.
pm.jsonPM and service-test tasks: interval (months / miles / hours), required equipment, and the standard cited. Edition references marked "verify edition" should be checked against the current NFPA documents your department has adopted.

8. Backups and recovery

Server copy

Back up the whole ~/fvm-data folder — it's the master copy. Your host's account backups include it; for an extra copy:

tar czf ~/fvm-backup-$(date +%F).tar.gz -C ~ fvm-data

Download that file and keep it off the server. Restoring is copying the folder back.

From the app

Any device is a backup. Each synced device holds every record, so if the server copy were lost, upload a device's backup file to a fresh server and the others re-sync.

9. Clearing test data / starting over

Because records are never deleted inside the app, clearing test data is done on the server and on each device:

  1. Server — move the record files into an archive folder (keeps server.json, so access codes still work):
    A=~/fvm-data-archive/$(date +%F); mkdir -p "$A"
    flock ~/fvm-data/.lock sh -c "mv ~/fvm-data/records ~/fvm-data/ids.txt ~/fvm-data/seq.txt ~/fvm-data/fleet.json ~/fvm-data/manifest.json $A/ && mkdir -m 750 ~/fvm-data/records"
  2. Every device that has used the app — Data & settings › Erase this device › Erase local data. This keeps the name, server address and access code. Do it after the server reset and before the device syncs again, otherwise it keeps showing old units and misses the first new records.
  3. Thumb-drive folders — delete the FireVehicleMgmt folder, or it brings old records back.
  4. Import the fleet on one device, then open the app on the others.
Don't press Load demo fleet on a live system — it adds 14 sample units to the shared data.

10. Updating the program

11. Security and accountability

12. Troubleshooting

SymptomFix
Access code rejectedCode mistyped (dashes count; capitals don't) or deactivated. Check Manage access codes; reactivate it or issue a new one.
Offline · n waiting for a long timeNo connection, or the server is down. Open https://fleet.spcfpd.org/api.php?action=health — it should say "ok":true,"configured":true. Records wait safely on the device.
A unit or record is missing on one deviceSave & sync now, then Re-download everything. If still missing, the device that created it hasn't uploaded yet — check that device's badge.
Units appear twiceThe same import ran on two devices. Retire the duplicates (Status: Retired).
App shows "Could not load the configuration files"A JSON file in config/ has a syntax error. Restore your copy or fix the file.
Excel import says it can't load the readerThe device is offline. Save the sheet as CSV and import that.
Wrong status after a lock-out releaseStatus follows the newest event. A new inspection or lock-out updates it; old records aren't changed.
Storage on a phone filling upVery unlikely (records are small). If needed: back up, Erase local data, sync again.

13. Moving to a database later

Each records/*.jsonl file maps one-to-one to a database table, and every record has a unique ID, so loading them is a straight insert that is safe to repeat. Replace api.php with an endpoint that speaks the same two calls (push and pull) and the app doesn't change. That stage is the right time to add per-person sign-in and role-checked lock-out release. Details: DATA-MODEL.md §6–7.