DVLD is a desktop-first license management system built with Electron + React on the client, a Node/Express + TypeORM API server, and a shared TypeScript DTO/types package. It supports core DVLD workflows such as people, drivers, licenses, applications, tests, and detained licenses.
packages/
client/ # Electron + React (Vite)
server/ # Express + TypeORM API
shared/ # Shared DTOs/types- Client: React 18, Vite, Electron
- Server: Node.js, Express, TypeORM, PostgreSQL
- Shared: TypeScript DTOs/types used by client & server
- Node.js (recommended: latest LTS)
- npm
- PostgreSQL
Create a .env file in packages/server:
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=dvld
PORT=3000
SESSION_SECRET=your_session_secret
NODE_ENV='development' | 'production'
CORS_ORIGIN='http://localhost:5173'The server uses typeorm with synchronize: true (in development mode), so it will auto-create tables on startup.
Run this command in the top-level:
npm ciFrom the repository root, create the database (if missing), then import backup.sql:
npm run db:createpsql -d dvld -f backup.sqlFrom the repository root, you can use the top-level workspace scripts:
npm run dev:server
npm run dev:clientEquivalent package-level commands:
Start the server (API):
cd packages/server
npm run start:devStart the client (Electron + Vite):
cd packages/client
npm run start:devDefault ports:
- Client (Vite):
http://localhost:5173 - Server (API):
http://localhost:3000
From the repository root:
npm run buildThis runs build:shared and then compiles the referenced TypeScript projects.
Other top-level build scripts:
npm run build:shared
npm run build:server
npm run build:client
npm run dist:clientThe client build also runs electron-builder to package the desktop app (using npm run dist:client).
The project includes a multi-stage Dockerfile and docker-compose configuration for containerized deployment.
Prerequisites:
- Docker
- Docker Compose
Start the application:
docker compose upThis will:
- Build the application image
- Start a PostgreSQL database container
- Import backup.sql into the PostgresSQL container (populate the db)
- Start the DVLD server container
- Expose the server on
http://localhost:3000
Environment variables (docker-compose.yml):
Default PostgreSQL credentials:
POSTGRES_USER=myuserPOSTGRES_PASSWORD=mypasswordPOSTGRES_DB=dvld_db
You can override these in the docker-compose.yml file or use a .env file, make sure you match the .env.docker with it:
POSTGRES_USER=your_user
POSTGRES_PASSWORD=your_passwordStop the application:
docker compose downnpm run dev:server- Run server in development mode (@dvld/server)npm run dev:client- Run client in development mode (@dvld/client)npm run build- Build shared package, then run TypeScript project buildnpm run build:shared- Build@dvld/sharednpm run build:client- Build@dvld/clientnpm run build:server- Build@dvld/servernpm run run:server- Run server in production mode (@dvld/server)npm run dist:client- Create client distribution package (@dvld/client)npm run clean- Clean TypeScript build outputs (tsc -b --clean)npm run db:create- Create PostgreSQLdvlddatabase if it does not existnpm run lint- Run client lint checks (@dvld/client)
The API is organized by feature under packages/server/src/routes and mounted in packages/server/src/routes.ts:
/person/user/driver/country/applicationType/testType/licenseClass/license/internationalLicense/application/testAppointment/test/login,/logout/me
- File uploads are served from
/uploadsin the server. - DTOs and shared types are defined in
packages/shared.