Skip to main content

reactjs-clean-gen

Independent Python CLI to generate a reactjs + TypeScript + Vite platform and feature modules from YAML.

Architecture

  • global_config.py: generator defaults and supported schema types.
  • config.py: loads the target project's config once per CLI command.
  • platform_generator.py: creates global app shell files during init.
  • api_generator.py: creates shared HTTP/API infrastructure separately.
  • feature_generator.py: creates feature-specific types, API methods, list model, columns and renderer contract.
  • templates/: TypeScript/TSX/CSS templates, separate from Python logic.

Install

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Commands

reactjs-clean-gen init ./frontend
reactjs-clean-gen generate examples/customer.yml --target ./frontend
reactjs-clean-gen show-config --target ./frontend

init creates the platform, API infrastructure and reactjs-clean-gen.config.json. generate loads config once and creates only the selected feature. It does not regenerate global files. Existing files are skipped by default; use --force deliberately.

Generated feature routes are exported for explicit registration rather than automatically editing router source code. This avoids fragile source-code mutation.

Important

apiPath is explicit; the generator does not guess endpoint pluralization. response_mode is either array or page-result. Review the generated contract against the backend API before using it.

Generated feature capabilities

Feature YAML is frontend-specific. The generator supports configurable list columns, server pagination, search via search, field filters via filter[field], and create/edit/delete UI when the corresponding operations are declared. The default update operation maps to HTTP PATCH; verify this against the backend controller or override the API method template if your backend uses PUT. The backend must implement the query semantics for search and filters; the UI does not pretend to filter all rows client-side.

For relations, the frontend should model the API's public representation, not TypeORM entities. Relation selectors (e.g. author dropdown, tag multi-select) should be generated only after the backend's DTOs, relation lookup endpoints, and write payload contract are explicit.

Relation selectors (0.4.0)

The reactjs YAML can define form relation controls independently from the NestJS YAML. See examples/posts.yml for single-select author/cover-image controls and multi-select tags/co-authors.

ui:
  form:
    relations:
      - field: authorId
        name: author
        kind: single
        label: Author
        resource: /api/users
        valueField: id
        labelField: name
        required: true
        response:
          collectionPath: data
          itemPath: props
          itemResponsePath: props
        pagination:
          pageParam: page
          pageSizeParam: limit
          pageSize: 50
      - field: tagIds
        name: tags
        kind: multiple
        label: Tags
        resource: /api/tags
        valueField: id
        labelField: name
        initialValueField: tags
  • kind: single submits one ID (or null for a nullable relation); kind: multiple submits an array of IDs.
  • resource must expose a list endpoint with the configured collection/item response paths and a detail endpoint at resource/:id for resolving selected labels during edit.
  • searchParam, pagination.pageParam, pagination.pageSizeParam, and pagination.pageSize configure the lookup request. The backend must implement those query parameters.
  • initialValueField identifies the field used to prefill an edit form. It may be an ID field such as authorId or a relation array such as tags; arrays of objects are converted to IDs using valueField.
  • api.response.itemResponsePath configures how detail responses are unwrapped (for example props). Set it to an empty string if the endpoint returns the entity directly.
  • The generator creates RelationSelect.tsx, RelationSelect.css, and item-normalizer.ts once, and skips existing shared files by default. Use --force only when you deliberately want to replace generated files.

The selector is a UI convenience, not authorization or validation. The NestJS backend must verify that referenced IDs exist and that the current user may associate them. A paginated lookup returns only the configured first page; the selector searches remotely and fetches selected IDs individually to hydrate edit forms.

Run pytest -q from the generator project to run the generator tests. Install frontend npm dependencies locally and run npm run build to verify the generated TypeScript project; the build could not be verified in the current environment because npm dependency installation timed out.

Metadata

Release files for reactjs-clean-gen 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reactjs-clean-gen 0.4.0
File Size Uploaded
reactjs_clean_gen-0.4.0.tar.gz 66.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reactjs-clean-gen 0.4.0
File Interpreter ABI Platform
reactjs_clean_gen-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 129.7 kB

Release files / reactjs_clean_gen-0.4.0.tar.gz

Download URL reactjs_clean_gen-0.4.0.tar.gz
Size 66.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e5259e72e1ad7f26c09179b36156df09046403d8bc7ca9090f696eafe68d7226
BLAKE2b-256 checksum
How to use checksums
572cea1273d42b4f48617c992a65b7b1ac6b833b40c0d74e35b94fb7aae144b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":null,"cpu":"x86_64","distro":{"id":"trixie","libc":{"lib":"glibc","version":"2.41"},"name":"Debian GNU/Linux","version":"13"},"implementation":{"name":"CPython","version":"3.13.5"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.5.7 9 Jun 2026","python":"3.13.5","system":{"name":"Linux","release":"6.12.113+deb13-amd64"}} HTTPX2/2.13.1

Release files / reactjs_clean_gen-0.4.0-py3-none-any.whl

Download URL reactjs_clean_gen-0.4.0-py3-none-any.whl
Size 63.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8521e645298c19d7aeb51cca951db78b4a5bc2802e9d0c64ac90f443835daa9e
BLAKE2b-256 checksum
How to use checksums
65f9f16ed3dd7e34531b79c31555e0c0d60f6be939ee336f772d734604dcc2df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":null,"cpu":"x86_64","distro":{"id":"trixie","libc":{"lib":"glibc","version":"2.41"},"name":"Debian GNU/Linux","version":"13"},"implementation":{"name":"CPython","version":"3.13.5"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.5.7 9 Jun 2026","python":"3.13.5","system":{"name":"Linux","release":"6.12.113+deb13-amd64"}} HTTPX2/2.13.1

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page