crudius
v1.0.2
Published
A scaffolding API tool to generate CRUD applications quickly and easily.
Readme
CRUDius CLI
CRUDius is a Node.js + TypeScript CLI tool that automatically generates CRUD boilerplate code based on interactive prompts or a JSON configuration.
⚠️ Currently under development. Features are evolving and more integrations are planned.
Features
- Interactive setup wizard (
crudius init) - JSON-based configuration generation (
crudius init-json) - Configuration validation (
crudius validate) - Clean command to remove temporary files (
crudius clean) - Generates a ready-to-use
.zipwith full source code - Supports Express.js with Knex.js
- Modular project structure (controllers, routes, services, entities)
- Documented code generation for easy understanding
- Written entirely in TypeScript for flexibility and extensibility
Planned: Support for other languages (Python, PHP) and databases (Knex, Prisma, MongoDB).
Recent Updates
- Added support for relations in entities
- Improved migration generator to avoid duplicated foreign key fields
- Enhanced validation step for entity relations
- Added prettier formatting to generated code
- Fixed bugs in interactive prompt flow
- Internal refactor of template rendering logic for better stability
Installation
You can install CRUDius globally to use it anywhere:
npm install -g crudiusQuick Start
After cloning the repository:
# 1. Install dependencies
npm install
# 2. Build the project
npm run build
# 3. (Optional) Link globally to test locally
npm linkNow you can run
crudiusfrom anywhere.
Usage
1. Initialize a new project interactively
crudius init- Walks you through prompts for entities and fields.
- Generates a
crudius.config.jsonfile.
Example session:
Entity name: Product
Field name: name
Field type: string
Is this field optional? No
Is this field searchable? Yes
Add another field? Yes
Field name: price
Field type: number
Add another field? No2. Generate from an existing JSON config
crudius init-json- Uses a JSON configuration file to generate the project automatically.
Example crudius.config.json:
{
"generationConfigs": [
{
"entityName": "User",
"properties": [
{ "field": "id", "type": "number", "primary": true },
{ "field": "name", "type": "string" },
{ "field": "email", "type": "string" }
]
}
]
}3. Validate configuration
crudius validate- Checks if your
crudius.config.jsonfollows the correct structure before generating code.
4. Clean generated files
crudius clean- Removes generated files (
crudius.config.json,crudius-output.zip, etc.)
Generated Project Structure
When generation completes, the .zip file contains:
/src
├── controllers/
├── routes/
├── entities/
├── services/
├── database/
├── server.ts
└── app.ts
README.mdAfter Unzipping the Generated Project
- Install dependencies:
npm install- Run migrations using Knex:
npm run knex:migrate- Start the server:
npm run devYour backend is now ready to test with CRUD endpoints.
Command Reference
| Command | Description |
| ------------------- | ---------------------------------------- |
| crudius init | Start interactive CRUD setup |
| crudius init-json | Generate CRUD structure from JSON config |
| crudius validate | Validate existing configuration |
| crudius clean | Remove generated and temporary files |
| crudius generate | Generate CRUD from JSON config |
Roadmap
- Foreign key / relations support
- Additional languages (PHP, Python)
- More database integrations (Prisma, MongoDB)
Why CRUDius?
- Rapid backend prototyping
- Consistent project structure
- Fully local, no server or internet required
- Perfect for MVP development
