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.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.
Prerequisites
- Node.js 20 or higher — TranslogiX targets
@types/node ^20and 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):
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | Full PostgreSQL connection string. Used by Drizzle ORM and drizzle-kit to connect to the database. |
BETTER_AUTH_SECRET | Yes | Secret used to sign and verify authentication session tokens. Use at least 32 random characters in production. |
BETTER_AUTH_URL | Yes | The public base URL of the application, including protocol and domain. BetterAuth uses this for cookie configuration and redirect URLs. |
Local development
The recommended local setup uses Docker Compose to run PostgreSQL alongside the Next.js dev server.Start the database
The included The container is configured with a health check (
These match the default
docker-compose.yml starts a PostgreSQL 16 container named translogix-postgres on port 5432:pg_isready) that polls every 5 seconds. The default credentials are:| Setting | Value |
|---|---|
| User | postgres |
| Password | postgres |
| Database | translogix |
| Port | 5432 |
DATABASE_URL value shown above.Apply the schema
Push the Drizzle schema to the database. This creates all tables without generating migration files:To generate and apply versioned SQL migration files instead, use:
Seed sample data (optional)
Production build
For production, build the application and start it with the Next.js production server.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.Apply the schema
Run this once against your production database before starting the app for the first time, and again after any schema changes:
Database management
| Command | Description |
|---|---|
pnpm db:push | Apply the current schema to the database without generating migration files. Recommended for development and simple deployments. |
pnpm db:migrate | Generate and apply versioned SQL migration files via drizzle-kit migrate. Recommended when you need a migration history. |
pnpm db:seed | Clear all tables and insert sample data including users, transporters, vehicles, routes, and shipments. |
pnpm db:studio | Open 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.