Skip to main content

title: Quick Start description: Start with model + migration + seed in one pass.

Quick Start

Version: 1.3.0

Quick setup

Install the package, Express.js, and the minimum TypeScript tooling first:
dotenv and @faker-js/faker are already included by the package runtime. Install them separately only if your own app imports them directly:
Set one active app connection and one active test connection in .env. Do not place multiple connection names in DB_CONNECTION. Quick .env key list:
  • DB_CONNECTION
  • DB_TEST_CONNECTION
  • DB_* or PG_* or SQLITE_* or MONGO_*
Minimal SQLite .env:
This creates:
  • src/app/models/Post.ts
  • src/app/services/PostService.ts
  • src/app/controllers/PostController.ts
  • a migration file for your configured target

Runtime setup

This ORM is compatible with Express.js and is typically used in Express route handlers. In this setup, registerModels runs safely at startup and models work without integration issues.
  1. Ensure model registration is completed at app bootstrap.
  1. Generate and apply migrations in order.
  1. Seed test fixtures and run a demo scenario.
  1. Create, query, update, and delete records.
  1. If the model uses soft deletes, restore instead of recreating.

Next steps