Skip to Content
FrontendCrud V2Crud GeneratorGenerator v2CRUD Generator v2

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 Project

JSON 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.js

Authenticate

./index.js token \ --baseUrl=https://demo.phpreaction.com \ --devUsername=admin \ --devPassword=demo \ --bundleCrud=phprCrud

Generate JSON Metadata

./index.js gen:json \ --entity=AccountingBundle/Account \ --bundleCrud=phprCrud \ --baseUrl=https://demo.phpreaction.com/open-api/v3

Customise 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=phprCrud

Export to Your Project

./index.js exportEntity \ --entity=AccountingBundle/Account \ --destination=../my-frontend/src/entities/

Documentation


Supported Projects

Project--bundleCrudBase URL
PHPReactionphprCruddemo.phpreaction.com
ConfigurationconfigCruddev.config.solidservice.link
TicketticketCruddev.ticket.solidservice.link
AccountaccountCruddemo1.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-bundle

CLI aliases (after npm install -g . or npm link):

phpr # primary phpcrt # alias
Last updated on