Building modern web applications often involves a lot of repetitive work. You define your database schema, then you write API endpoints to perform CRUD (Create, Read, Update, Delete) operations on that data. Then you add validation. Then you add authentication. Then you add authorization.
It's exhausted just thinking about it.
Nuxt Auto CRUD is a module designed to eliminate this boilerplate. It takes your Drizzle ORM schema and automatically mounts fully-featured RESTful APIs.
nuxt.config.ts.// server/db/schema.ts
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core'
export const posts = sqliteTable('posts', {
id: integer('id').primaryKey(),
title: text('title').notNull(),
content: text('content').notNull(),
published: integer('published', { mode: 'boolean' }).default(false),
})
With just that code, you get:
GET /api/posts - List all posts (with pagination, filtering, sorting)GET /api/posts/:id - Get a single postPOST /api/posts - Create a new postPATCH /api/posts/:id - Update a postDELETE /api/posts/:id - Delete a postCheck out the documentation to learn more and start building faster today.