Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tsdiapi/crud

unbywyd135MIT0.2.4TypeScript support: included

A TSDIAPI plugin that provides automatic CRUD (Create, Read, Update, Delete) API generation for your database entities. It generates TypeScript modules and services with full type safety, validation, and best practices.

tsdiapi, crud, api, typescript, rest, api-generator, database, prisma, typebox, fastify, typedi, dependency-injection

readme

crud Plugin for TSDIAPI

A TSDIAPI plugin that automatically generates CRUD (Create, Read, Update, Delete) REST API endpoints for your Prisma entities.

📌 About

This is a TSDIAPI plugin that serves as a code generator. It automatically creates fully functional CRUD REST API endpoints for your Prisma database entities. The generated code includes:

  • Service layer with CRUD operations
  • REST controllers with endpoints
  • Type validation schemas
  • Error handling
  • JWT authentication integration

🔗 TSDIAPI CLI: @tsdiapi/cli


📦 Installation

You can install this plugin using npm:

tsdiapi add crud

🚀 Features

  • 🛠 Automatic CRUD Generation - Generates complete CRUD API for any Prisma entity
  • REST Endpoints - Creates standard REST endpoints (GET, POST, PUT, DELETE)
  • 🔒 Built-in Security - Includes JWT authentication
  • 📝 Type Safety - Full TypeScript support with validation schemas
  • 🔄 Pagination - Built-in support for list operations with pagination
  • 🛡️ Error Handling - Comprehensive error handling and validation

🔧 Usage

To generate CRUD API for a Prisma entity, simply run:

tsdiapi generate crud <entityName>

Where <entityName> is your Prisma model name (e.g., User, Product, Order).

The generator will create:

  • Service layer with CRUD operations
  • REST controllers with endpoints
  • Type validation schemas

Generated Endpoints

For each entity, the following REST endpoints are created:

  • GET / - List entities with pagination
  • GET /:id - Get entity by ID
  • POST / - Create new entity
  • PUT /:id - Update entity
  • DELETE /:id - Delete entity

You can find more TSDIAPI plugins here:
🔗 Available Plugins


👨‍💻 Contributing

Contributions are always welcome! If you have ideas for improving this plugin, feel free to open a pull request.

Author: unbywyd
GitHub Repository: https://github.com/unbywyd/tsdiapi-crud

📧 Contact: unbywyd@gmail.com

🚀 Happy coding with TSDIAPI! 🎉