crud-generator-nuxt3-nestjs
v1.0.6
Published
A CRUD generator tool with Nuxt3 and Nestjs
Readme
CRUD Generator : NestJS + Nuxt3
This project is a tool for automatically generating CRUD (Create, Read, Update, Delete) code, supporting both Backend (NestJS) and Frontend (Nuxt3).
Installation
npm installMain File Structure
crud-generator/
├── crud-gen-backend/ # NestJS (Backend) code
├── crud-gen-frontend/ # Nuxt3 (Frontend) code
├── tools/
│ ├── schemas/ # Example schemas for generation
│ └── templates/ # Templates for file generation
├── plopfile.js # Generator logic configuration
├── package.json # Main dependencies
└── README.md- crud-gen-backend/ : Backend code (NestJS)
- crud-gen-frontend/ : Frontend code (Nuxt3)
- tools/schemas/ : Store schema files for generation (recommended to create new schemas here)
- tools/templates/ : Store templates for generating various files
- plopfile.js : Define the logic and flow of the generator
- package.json : Main project dependencies
Usage
- Create the desired schema file in
tools/schemas/, for example:
// tools/schemas/product.js
module.exports = {
name: "product",
fields: [
{ name: "title", type: "string", required: true },
{ name: "price", type: "number", required: true },
{ name: "isActive", type: "boolean", required: false },
],
};- Run the plop command to start the generator
npx plop- Choose whether to Create or Delete
- Specify the destination
- Select the schema name to generate
- The generated files will be in the specified folder
Example Usage
npx plop
# Select "create crud"
# Specify the destination
# Select the schema name to generate (e.g., product)
# The system will automatically generate CRUD filesPrerequisites
- Node.js
- npm
[NEW] Web UI + API CRUD Generator (React + Tailwind + Express.js)
The system will be enhanced with 2 new components:
- /backend/ : Express.js API for receiving/saving schemas, generating, and deleting CRUD
- /frontend/ : React + Tailwind UI for schema input, selecting generate/delete CRUD operations
Workflow
- Users input schema or select existing schemas through the web interface
- Click generate/delete CRUD buttons instantly
- Express API will save the schema as a file and execute CRUD generation using existing logic (plop)
New File Structure
/backend/ <-- Express API
/frontend/ <-- React + Tailwind
/tools/schemas/ <-- Shared schemas