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.

This guide covers how to run TranslogiX in two modes: a local development environment backed by Docker Compose, and a production build served by the Next.js standalone server. Both modes require the same environment variables and a reachable PostgreSQL database.

Prerequisites

  • Node.js 20 or higher — TranslogiX targets @types/node ^20 and uses Next.js 16 with React 19.
  • pnpm — TranslogiX uses pnpm as its package manager. Install it with npm install -g pnpm.
  • Docker — Required for the local development database. Not required if you bring your own PostgreSQL instance.

Environment variables

Both development and production deployments require these three environment variables. Create a .env file in the project root (or set them in your deployment environment):
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/translogix
BETTER_AUTH_SECRET=your-secret-key-min-32-chars
BETTER_AUTH_URL=https://your-domain.com
VariableRequiredDescription
DATABASE_URLYesFull PostgreSQL connection string. Used by Drizzle ORM and drizzle-kit to connect to the database.
BETTER_AUTH_SECRETYesSecret used to sign and verify authentication session tokens. Use at least 32 random characters in production.
BETTER_AUTH_URLYesThe public base URL of the application, including protocol and domain. BetterAuth uses this for cookie configuration and redirect URLs.
Never commit .env to version control. Use environment injection through your hosting platform or a secrets manager in production. Set BETTER_AUTH_URL to your actual public domain — using http://localhost:3000 in production will break authentication redirects.

Local development

The recommended local setup uses Docker Compose to run PostgreSQL alongside the Next.js dev server.
1

Install dependencies

pnpm install
2

Start the database

The included docker-compose.yml starts a PostgreSQL 16 container named translogix-postgres on port 5432:
docker compose up -d
The container is configured with a health check (pg_isready) that polls every 5 seconds. The default credentials are:
SettingValue
Userpostgres
Passwordpostgres
Databasetranslogix
Port5432
These match the default DATABASE_URL value shown above.
3

Apply the schema

Push the Drizzle schema to the database. This creates all tables without generating migration files:
pnpm db:push
To generate and apply versioned SQL migration files instead, use:
pnpm db:migrate
4

Seed sample data (optional)

pnpm db:seed
This populates the database with transporters, vehicles, routes, shipments, tracking updates, and four user accounts. See the Quickstart for the full list of seeded records.
5

Start the dev server

pnpm dev
This starts Next.js with Turbopack at http://localhost:3000.

Production build

For production, build the application and start it with the Next.js production server.
1

Set environment variables

Configure DATABASE_URL, BETTER_AUTH_SECRET, and BETTER_AUTH_URL in your server environment before building. BETTER_AUTH_URL must be set to your public domain.
2

Install dependencies

pnpm install
3

Apply the schema

Run this once against your production database before starting the app for the first time, and again after any schema changes:
pnpm db:push
4

Build the application

pnpm build
This runs next build and produces an optimized production build in .next/.
5

Start the production server

pnpm start
This runs next start, which serves the production build. The server listens on port 3000 by default.
To verify your TypeScript types before deploying, run pnpm typecheck. To check for lint errors, run pnpm lint.

Database management

CommandDescription
pnpm db:pushApply the current schema to the database without generating migration files. Recommended for development and simple deployments.
pnpm db:migrateGenerate and apply versioned SQL migration files via drizzle-kit migrate. Recommended when you need a migration history.
pnpm db:seedClear all tables and insert sample data including users, transporters, vehicles, routes, and shipments.
pnpm db:studioOpen Drizzle Studio in the browser for a visual database editor.
pnpm db:seed deletes all existing rows before inserting new ones. Do not run it against a production database containing real data.

Build docs developers (and LLMs) love