Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fatelessdev/translogiX/llms.txt

Use this file to discover all available pages before exploring further.

TranslogiX stores all platform data in a PostgreSQL database managed with Drizzle ORM. This page documents every core entity, its fields, the enumerations used across the schema, and how entities relate to one another. Refer to this page when building integrations, writing queries, or understanding how data flows through the system.

Enumerations

These enums are defined at the database level using pgEnum and are referenced throughout the schema.

userRoleEnum

Controls which dashboard section a user can access and what API operations they can perform.
ValueDescription
ADMINFull platform access, no transporter scope restriction
TRANSPORTERScoped to their linked transporter entity
DRIVERAccess to the driver section
CUSTOMERDefault role; access to the customer section

transporterStatusEnum

ValueDescription
activeTransporter is operational
inactiveTransporter has been deactivated

vehicleTypeEnum

ValueDescription
TRUCKStandard truck
DUMPERDumper vehicle
VANVan
OTHERAny other vehicle type

vehicleStatusEnum

ValueDescription
AVAILABLEVehicle is ready to be assigned to a shipment
BUSYVehicle is currently assigned to an active shipment
MAINTENANCEVehicle is undergoing maintenance and unavailable

shipmentStatusEnum

ValueDescription
CREATEDShipment has been created but not yet assigned
ASSIGNEDA vehicle and transporter have been assigned
PICKED_UPCargo has been collected from the source
IN_TRANSITShipment is on the way to the destination
DELIVEREDShipment has been delivered successfully
CANCELLEDShipment was cancelled; terminal state

Core entities

Users

The users table represents all authenticated accounts on the platform.
FieldTypeNotes
iduuidPrimary key, auto-generated
emailtextUnique, required
emailVerifiedbooleanDefaults to false
nametextRequired
imagetextOptional profile image URL
roleuserRoleEnumDefaults to CUSTOMER
transporterIduuidFK → transporters.id; set for TRANSPORTER users
createdAttimestampAuto-set on insert
updatedAttimestampAuto-set on insert
The transporterId field on a user is what links a TRANSPORTER-role account to a specific transporter entity. Without this link, the user cannot access any transporter-scoped API endpoints.

Transporters

The transporters table represents logistics companies or vendors operating on the platform.
FieldTypeNotes
iduuidPrimary key, auto-generated
nametextRequired
gstNumbertextOptional GST registration number
contactPersontextRequired
phonetextRequired
emailtextOptional contact email
statustransporterStatusEnumDefaults to active
createdAttimestampAuto-set on insert
updatedAttimestampAuto-set on insert

Vehicles

The vehicles table tracks all vehicles registered under a transporter.
FieldTypeNotes
iduuidPrimary key, auto-generated
vehicleNumbertextRegistration/plate number; required
transporterIduuidFK → transporters.id; required
vehicleTypevehicleTypeEnumRequired
capacityKgintegerMaximum load capacity in kilograms; required
currentLocationtextOptional free-text location
statusvehicleStatusEnumDefaults to AVAILABLE
lastMaintenanceDatedateOptional
createdAttimestampAuto-set on insert
updatedAttimestampAuto-set on insert

Routes

The routes table defines predefined origin–destination corridors with associated rates and timing.
FieldTypeNotes
iduuidPrimary key, auto-generated
origintextRequired
destinationtextRequired
distanceKmdecimalDistance in kilometres; required
estimatedTimetextHuman-readable duration (e.g., “3 days”); required
billingRatedecimalRate charged to the customer; required
vendorRatedecimalRate paid to the transporter; required
createdAttimestampAuto-set on insert
updatedAttimestampAuto-set on insert

Shipments

The shipments table is the central entity in TranslogiX. It records cargo details, assignment information, and current status.
FieldTypeNotes
iduuidPrimary key, auto-generated
packageCodetextUnique identifier for the shipment; required
sourcetextPickup location; required
destinationtextDelivery location; required
materialTypetextDescription of the cargo type; required
grossWeightKgdecimalTotal weight including packaging; required
tareWeightKgdecimalWeight of packaging alone; optional
quantityintegerNumber of units; required
pickupDatedateScheduled pickup date; required
deliveryDeadlinedateLatest acceptable delivery date; required
transporterIduuidFK → transporters.id; optional until assigned
vehicleIduuidFK → vehicles.id; optional until assigned
routeIduuidFK → routes.id; optional
statusshipmentStatusEnumDefaults to CREATED
createdAttimestampAuto-set on insert
updatedAttimestampAuto-set on insert

TrackingUpdates

The tracking_updates table stores location events appended throughout a shipment’s journey.
FieldTypeNotes
iduuidPrimary key, auto-generated
shipmentIduuidFK → shipments.id; required
locationtextHuman-readable location name; required
latitudedecimalOptional GPS latitude (-90 to 90)
longitudedecimalOptional GPS longitude (-180 to 180)
createdAttimestampAuto-set on insert

Entity relationships

users ──────────────────── transporters
  (transporterId)               │
                         ┌──────┴──────┐
                      vehicles      shipments ──── tracking_updates
                         │               │
                         └───────────────┘ (vehicleId)

                                 routes (routeId)
The Drizzle relations are defined as follows:
A user belongs to one transporter (via transporterId) and has many sessions and accounts (managed by BetterAuth).
A transporter has many vehicles and many shipments.
A vehicle belongs to one transporter and has many shipments.
A route has many shipments.
A shipment belongs to one transporter, one vehicle, and one route. It has many tracking updates.
A tracking update belongs to one shipment.

Authentication tables

TranslogiX uses BetterAuth for session management. Three additional tables are maintained by the auth library and are not typically queried directly by application code:
TablePurpose
sessionsActive user sessions; cascade-deleted when the user is deleted
accountsOAuth and credential provider account links per user
verificationsShort-lived tokens for email verification and similar flows

Build docs developers (and LLMs) love