Skip to content

Repository files navigation

arxgen

npm npm downloads license CI

arxgen is a CLI generator for Clean Architecture-style project starters and schema-driven CRUD scaffolding.

It is strongest today for TypeScript Express, with growing support for NestJS and other backend stacks.

Install

npm install -g arxgen
arxgen doctor
arxgen list plugins

Quick Start

arxgen create \
  --name student-api \
  --language typescript \
  --framework express \
  --entity student \
  --field name:string \
  --field email:string \
  --out ./generated
cd generated/student-api
npm install
npm run dev

SQL First

Generate from an existing SQL schema:

arxgen create \
  --name school-api \
  --language typescript \
  --framework express \
  --database postgres \
  --orm prisma \
  --from-sql ./schema.sql \
  --out ./generated

Upgrade an existing generated project after schema changes:

arxgen upgrade schema \
  --from-sql ./schema.sql \
  --project ./generated/school-api \
  --dry-run

The dry-run output reports added fields, removed fields, type changes, nullability changes, default changes, and risky migration warnings.

Apply additive changes after reviewing the preview:

arxgen upgrade schema \
  --from-sql ./schema.sql \
  --project ./generated/school-api

If the schema contains risky changes, arxgen requires --force. It still does not delete, rename, or rewrite existing fields automatically; those database/code migration steps remain manual.

arxgen upgrade schema \
  --from-sql ./schema.sql \
  --project ./generated/school-api \
  --force

Production Auth

Generate TypeScript Express JWT auth with refresh-token storage, token rotation, logout, RBAC metadata, and Prisma auth models:

arxgen create \
  --name secure-api \
  --language typescript \
  --framework express \
  --entity student \
  --field name:string \
  --database postgres \
  --orm prisma \
  --auth jwt \
  --auth-mode production \
  --out ./generated

Generated production auth requires JWT_SECRET at runtime.

Plugin SDK

arxgen 2.0 supports external plugins from local files or installed npm packages:

arxgen list plugins --plugin ./examples/arxgen-plugin.mjs
arxgen --plugin ./examples/arxgen-plugin.mjs create \
  --name example-api \
  --language example \
  --framework api \
  --entity student \
  --field name:string \
  --out ./generated

Plugins expose v2 metadata, capabilities, compatibility checks, and generation hooks. See Plugin Development.

Support Status

Area Status
TypeScript Express CRUD Stable
TypeScript Express add entity Stable
TypeScript Express schema upgrade Stable with safety warnings
TypeScript Express JWT auth Production mode available with --auth-mode production
TypeScript Express Prisma Database-backed CRUD repositories with schema/migration/seed files
NestJS CRUD Build/e2e verified beta
NestJS Prisma Prisma-backed repository scaffold
NestJS add entity Beta
NestJS schema upgrade Stable additive support
External plugin SDK Stable v2 contract with local/npm loading
Other backend CRUD stacks Stable scaffold
Other backend schema upgrade Partial additive model/entity support
Docker, Nginx, Redis, CI, logging, OpenAPI Scaffold

arxgen is explicit about generated scaffold versus production-ready implementation. Generated projects are intended as a strong starting point, not a replacement for security review, production database design, or framework-specific hardening.

Supported Stacks

  • TypeScript Express
  • TypeScript NestJS
  • TypeScript React
  • Python FastAPI
  • Python Django
  • Java Spring Boot
  • C# ASP.NET Core
  • PHP Laravel
  • Go Gin
  • Ruby Rails
  • Kotlin Ktor

Stack Support Matrix

arxgen supports multiple stacks, but not every stack has the same production confidence level yet.

Status meaning:

  • Stable: generated project is expected to build/run and has automated tests.
  • Beta: core scaffolding works, but some advanced features are still partial.
  • Experimental: basic scaffold exists, but generated output needs more validation before production use.
  • Planned: not fully implemented yet.
Stack Create Project CRUD ORM / DB Add Entity SQL Import Schema Upgrade Generated App Test Status
TypeScript Express Yes Yes Prisma-backed Yes Yes Yes Yes Stable
TypeScript NestJS Yes Yes Prisma-backed Yes Partial Yes Yes Beta
TypeScript React Yes Partial N/A N/A N/A N/A Planned Beta
Python FastAPI Yes Partial Partial Planned Partial Planned Planned Experimental
Python Django Yes Partial Partial Planned Partial Planned Planned Experimental
Java Spring Boot Yes Partial Partial Planned Partial Planned Planned Experimental
C# ASP.NET Core Yes Partial Partial Planned Partial Planned Planned Experimental
Go Gin Yes Partial Partial Planned Partial Planned Planned Experimental
PHP Laravel Yes Partial Partial Planned Partial Planned Planned Experimental
Ruby Rails Yes Partial Partial Planned Partial Planned Planned Experimental
Kotlin Ktor Yes Partial Partial Planned Partial Planned Planned Experimental

Recommended Production Path

For production-oriented usage, start with:

  1. TypeScript Express - strongest current support.
  2. TypeScript NestJS - recommended for structured backend projects, currently in beta.
  3. TypeScript React - useful for frontend/fullstack scaffolding.

Other stacks are available as scaffolding targets, but should be treated as experimental until they have generated-app build/e2e validation.

Promotion Rules

A stack can move from Experimental to Beta when:

  • base project generation works;
  • CRUD layers are generated consistently;
  • DTO/request/response files are generated;
  • validation files are generated;
  • ORM/database artifacts are generated;
  • snapshot tests exist.

A stack can move from Beta to Stable when:

  • generated project builds successfully in CI;
  • generated project can start successfully;
  • generated CRUD endpoints are tested through HTTP/e2e tests;
  • add entity does not break existing project structure;
  • SQL import is validated for common table/foreign-key cases;
  • schema upgrade has at least additive-change support;
  • generated README includes stack-specific run commands.

Useful Commands

arxgen create --preset saas --name my-api --entity student --field name:string
arxgen create --name secure-api --language typescript --framework express --auth jwt --auth-mode production --database postgres --orm prisma --entity student --field name:string
arxgen add entity course --field title:string --project ./generated/student-api --merge
arxgen add schema --from-sql ./schema.sql --project ./generated/student-api
arxgen upgrade schema --from-sql ./schema.sql --project ./generated/student-api --dry-run
arxgen upgrade schema --from-sql ./schema.sql --project ./generated/student-api --force
arxgen list plugins --plugin ./examples/arxgen-plugin.mjs
arxgen wizard
arxgen list plugins

Development

npm install
npm run typecheck
npm test

Generated Express app execution test:

npm run test:e2e

This test generates an Express project, installs dependencies, builds it, starts the server, and calls CRUD endpoints.

Generated Express + Prisma + PostgreSQL execution test:

npm run test:e2e:postgres

This test requires Docker. It generates an Express Prisma project, starts PostgreSQL with Docker Compose, runs Prisma migration, builds the app, starts the server, and calls CRUD endpoints.

Generated NestJS app execution test:

npm run test:e2e:nestjs

This test generates a NestJS project, installs dependencies, builds it, starts the server, and calls health and CRUD endpoints.

Documentation

Release maintainers should follow the release checklist in CONTRIBUTING.md, including README command review for every version.

License

This project is licensed under the MIT License.

Copyright (c) 2026 Minh Bùi Đức.

Official repository: https://github.com/minhbddeveloper-jpg/arxgen_architecture

Official npm package: https://www.npmjs.com/package/arxgen

About

ArchGen is a CLI project generator for creating Clean Architecture-style starters across popular languages and frameworks.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages