CRUD Generator v2
A Node.js CLI tool that reads live API metadata and generates versioned TypeScript/React configuration files for CRUD interfaces — no hand-writing boilerplate.
Version: 3.14.0 | Branch: main-v2
How It Works
The generator uses a two-layer versioning system. Each layer is independent.
API
│
▼
JSON Layer (config/versioned/json/Bundle/Entity/vN/)
├── data.json ← raw API metadata snapshot
└── changes.json ← your field selections & customizations
│
▼
TSX Layer (config/versioned/tsx/Bundle/Entity/vN/)
└── index.tsx ← generated React configuration
│
▼
Frontend ProjectJSON Layer — Fetches and stores raw entity metadata from the API. You customise which fields appear where using changes.json.
TSX Layer — Reads the JSON layer, applies your customisations, and renders a typed index.tsx ready to drop into your React project.
Both layers version independently (v0, v1, v2 …). Pin a TSX generation to any JSON version with --jsonVersion=v0.
Quick Start
Install
git clone https://github.com/PHPCreation/frontend-components-crud-react-generator.git
cd frontend-components-crud-react-generator
npm install
chmod +x index.jsAuthenticate
./index.js token \
--baseUrl=https://demo.phpreaction.com \
--devUsername=admin \
--devPassword=demo \
--bundleCrud=phprCrudGenerate JSON Metadata
./index.js gen:json \
--entity=AccountingBundle/Account \
--bundleCrud=phprCrud \
--baseUrl=https://demo.phpreaction.com/open-api/v3Customise changes.json
Open config/versioned/json/AccountingBundle/Account/v0/changes.json and edit your field selections.
Generate TSX Config
./index.js gen:tsx \
--entity=AccountingBundle/Account \
--bundleCrud=phprCrudExport to Your Project
./index.js exportEntity \
--entity=AccountingBundle/Account \
--destination=../my-frontend/src/entities/Documentation
Supported Projects
| Project | --bundleCrud | Base URL |
|---|---|---|
| PHPReaction | phprCrud | demo.phpreaction.com |
| Configuration | configCrud | dev.config.solidservice.link |
| Ticket | ticketCrud | dev.ticket.solidservice.link |
| Account | accountCrud | demo1.dev.account.solidservice.link |
Requirements
- Node.js v18+ (v20+ recommended)
- npm v6+ or pnpm v10+
Generated index.tsx files require these packages in the consuming project:
@phpcreation/frontend-utils-react-nextjs-bundle
@phpcreation/frontend-crud-react-nextjs-bundleCLI aliases (after npm install -g . or npm link):
phpr # primary
phpcrt # alias