unc.js — CLI for Node backends

Forge production-ready
backends in seconds.

unc.js scaffolds Express apps in JS or TS, wires up Mongoose, Prisma, or Sequelize, and generates full CRUD modules — model, service, controller, routes, schemas, DTOs — in one command. Layered architecture, your stack, no folder plumbing.

events-api — unc
DWG
REV
SCALE
DRAWN BY
LIC
unc.js
1.0.3
npx
3mo-tony
ISC

Why use it

Every backend starts the same way.

Folder structure, path aliases, linting, a database loader, a service base class, then CRUD files for every entity you add. unc.js automates that part so you can go straight to business logic.

As-is / without unc.js

  • Copy the folder structure from your last project
  • Rewrite path aliases in tsconfig, by hand
  • Re-wire the ORM loader and connection handling
  • Build a base service class from memory, again
  • Write model → service → controller → routes ×N
  • Set up ESLint, Prettier, Husky separately

Proposed / with unc.js

  • $ unc init my-api

    Full scaffold + BaseService + ORM setup

  • $ unc generate module events

    Model, service, controller, routes, schemas, DTOs

Sequence

How it works

01init
unc init events-api --language ts --orm mongoose

Prompts for language, ORM, and tooling — or take the flags non-interactively. Runs npm install and leaves you with a full project: BaseService, ORM setup, path aliases, ESLint, Prettier.

02generate module
unc generate module events --fields name:string,startsAt:date

One command produces the full vertical slice — model, service, controller, routes, contracts, Zod schemas, DTOs — and patches every barrel file and route index that needs to know about it.

03develop
npm run dev

Hot reload via nodemon + tsx. Customize the generated service, add associations or auth middleware, and ship — the base CRUD behavior stays intact underneath.

Your stack

Pick your ORM. unc.js adapts.

The choice is made once, at init, and recorded in .uncjs.json. Every later generate command reads it and picks the matching templates automatically.

Sequelize

PostgreSQL · default

--orm sequelize

DataTypes-based models, ModelStatic base service, transactions, include for population. Tables registered in src/constants/tables.ts.

Mongoose

MongoDB

--orm mongoose

Schema + model generation, FilterQuery-based base service, controllers keyed on _id instead of numeric id.

Prisma

SQL, type-safe client

--orm prisma

Wired into the same init → generate flow, stored in .uncjs.json so every later generate command targets the right templates.

Floor plan

What init actually builds

A layered structure, not a single flat folder of routes. Every concern — validation, business logic, transport, background work — gets its own room, so a generated module lands in the right place automatically.

TypeScript projects get strict mode and path aliases (@services, @controllers, @schema…) out of the box, plus an ESLint v9 flat config and Prettier.

  • src/adapters/external service adapters
  • src/combined-services/cross-model orchestration
  • src/config/environment + app config
  • src/constants/endpoints, tables, messages
  • src/contracts/interfaces + DTO contracts
  • src/controllers/request handlers
  • src/loaders/express + database bootstrap
  • src/middlewares/express middlewares
  • src/models/database models
  • src/routes/api route definitions
  • src/schemas/zod validation schemas
  • src/services/business logic layer
  • src/swagger/openapi definitions
  • src/types/enums + dto types