# koja-mdt

koja-mdt is a Mobile Data Terminal for FiveM. Police, sheriff, highway patrol, the DOJ, EMS and fire all work on one shared records system, each with its own permissions, crest and tablet theme. It is built on koja-lib, so it runs on ESX, QBCore and QBX without changes.

Officers open the tablet in game (`/mdt`, default key F6), and the same MDT is available in a browser or on a phone through the built-in web portal.

## Departments

Six departments ship in `shared/departments.lua`:

| Department | Short | Type | Default jobs |
|---|---|---|---|
| Los Santos Police Department | LSPD | `leo` | `police`, `lspd` |
| Blaine County Sheriff's Office | BCSO | `leo` | `sheriff`, `bcso` |
| San Andreas Highway Patrol | SAHP | `leo` | `sahp`, `statepolice`, `trooper` |
| Department of Justice | DOJ | `doj` | `doj`, `judge`, `lawyer`, `da`, `clerk` |
| San Andreas Medical Services | SAMS (EMS) | `ems` | `ambulance`, `ems` |
| Los Santos Fire Department | LSFD | `fire` | `fire`, `firefighter`, `lsfd` |

You can rename them, change the jobs, or add any other faction (park rangers, for example) with config only. See [Departments and permissions](/new/mdt/departments-and-permissions).

## Features

::::cards{cols="2"}
:::card{title="Shell and dashboard" href="/new/mdt/features"}
Browser-style tabs with history, collapsible sidebar, global search, notification center. Dashboard with duty toggle, KPI cards, online employees, mail inbox, bulletins and record counters.
:::
:::card{title="Dispatch" href="/new/mdt/features"}
911, 311 and anonymous calls, panic button, priority calls with blips and sound, unit board with status codes, quick dispatch overlay, spoken dispatcher voice.
:::
:::card{title="Records" href="/new/mdt/features"}
People, vehicles, firearms, reports, sentencing, citations, warrants, BOLOs, evidence, jail and impound, penal code.
:::
:::card{title="Justice" href="/new/mdt/features"}
Court docket, hearings, filings, verdicts and sentences, judge approval for warrants, expungement requests, bar registry.
:::
:::card{title="Medical and fire" href="/new/mdt/features"}
Patient records, ePCR treatment reports, medical bills, hospital bed board, optional koja-ambulance link, fire dispatch codes.
:::
:::card{title="Surveillance" href="/new/mdt/features"}
CCTV cameras, bodycams with live watch, ANPR cameras and in-vehicle ALPR, live map.
:::
:::card{title="Staff tools" href="/new/mdt/features"}
Roster, officer profiles, divisions, certifications, forms, internal mail, calendar, audit log, admin panel.
:::
:::card{title="Web portal" href="/new/mdt/features"}
The MDT in a browser or on a phone, plus a citizen portal for public forms, tickets and own record.
:::
::::

### Feature list by module

| Module | What it does |
|---|---|
| Shell | Tabs with back, forward and reload, sidebar groups, Ctrl+F search across people, plates, reports and pages, notification center |
| Dashboard | Welcome bar with duty toggle, KPI cards, online employees with division filter, mail inbox, bulletins, record counters |
| Mail | Internal department email to officers or whole departments, inbox, unread, starred, sent, reply, reply all, forward, signature |
| Profile | Banner and photo, rank, phone, badge, rewards and strikes, duty heatmap, divisions, certificates, permissions, suspend and reinstate |
| Divisions and certifications | Divisions with a head and members, qualifications per division, assign and revoke |
| Forms | Form builder (8 field types, up to 50 fields), internal or public forms, submissions and reviews |
| Dispatch | 911 / 311 / anonymous calls, panic, call log, unit board, GPS waypoint, quick dispatch, dispatcher voice |
| People | Search by name, phone or ID, file with photo, flags, licenses, record summary, vehicles, firearms, warrants, BOLOs, court cases |
| Vehicles and ANPR | Plate search, flags, strike points, BOLO and warrant alerts, ANPR cameras and in-vehicle ALPR |
| Firearms | Serial registry with status |
| Reports and sentencing | 8 report types, penal code picker, fine and jail in one click, license points |
| Citations | Ticket book with signatures, printed item, pay and contest |
| Warrants, BOLOs, evidence | Warrant approval flow, BOLO broadcast, evidence locker with chain of custody |
| Custody | Jail records and impound lots |
| Court (DOJ) | Docket, hearings, filings, sentence carrying out, expungement, bar registry |
| EMS | Patients, ePCR, bills, hospital beds |
| Cameras | CCTV, bodycams, live map |
| Admin | Department overrides, job editing (ESX), officer actions, system status |
| Web portal | Browser and phone access, citizen portal |
| Settings and language | Own callsign, badge, photo, accent color, per-player language, dispatcher voice |

Details for each module are in [Features](/new/mdt/features).

## Requirements

| Requirement | Notes |
|---|---|
| FXServer with Lua 5.4 | The resource uses `lua54 'yes'`. |
| [koja-lib](https://github.com/Koja-Scripts/koja-lib) | Required. Provides the framework bridge for ESX, QBCore and QBX. |
| oxmysql | Required. Tables are created on start. |
| ESX, QBCore or QBX | One of them. See [Integrations](/new/mdt/integrations). |
| screenshot-basic | Optional. Needed for the Take a photo button (with `Config.Camera.uploadUrl`) and for the selfie profile photo. |
| An inventory | Optional. Needed only for the tablet item, bodycams as an item, printed citations and documents. |

## Where to go next

- [Installation](/new/mdt/installation)
- [Configuration](/new/mdt/configuration)
- [Departments and permissions](/new/mdt/departments-and-permissions)
- [Features](/new/mdt/features)
- [Commands and keybinds](/new/mdt/commands-and-keybinds)
- [Demo mode](/new/mdt/demo-mode)
- [Integrations](/new/mdt/integrations)
- [Database](/new/mdt/database)
- [Storage and CDN](/new/mdt/storage)
- [Translations](/new/mdt/translations)
- [Troubleshooting](/new/mdt/troubleshooting)

Developer reference: [API overview](/new/mdt/api/overview), [Server exports](/new/mdt/api/server-exports), [Client exports](/new/mdt/api/client-exports), [Hooks](/new/mdt/api/hooks), [Events](/new/mdt/api/events).
