@aegisx/crud-generator
v2.1.1
Published
CRUD Generator for AegisX Platform - Professional code generation with interactive CLI and template management
Maintainers
Readme
@aegisx/crud-generator
Professional CRUD Generator for AegisX Platform with interactive CLI and flexible template system.
🎉 v2.1.0 Release Highlights
HIS Mode (Hospital Information System Mode) - New default behavior for critical enterprise systems:
- ⚕️ Data Accuracy First: UI always shows actual database state (no optimistic updates)
- 📊 Backend Always Emits Events: Audit trail and event-driven architecture ready
- 🔧 Optional Real-Time Mode: Easy to enable by uncommenting 4 code blocks
- 🛡️ No User Confusion: Never show outdated or server-rejected data
- 🏗️ Event-Driven Ready: WebSocket events available for microservices
Why HIS Mode? In critical systems (hospitals, financial, enterprise), showing users data that might not match the database is dangerous. HIS Mode ensures UI always reflects actual server state.
Migration: Regenerate modules to get HIS Mode behavior:
# With events for audit trail
npx aegisx-crud generate budgets --with-events --force
# With import + events
npx aegisx-crud generate budgets --with-import --with-events --forceSee CHANGELOG for complete details.
✨ Features
- 🎯 Interactive Mode - Step-by-step wizard for easy code generation
- 🎨 Template System - Multiple templates with easy switching (domain/standard, v2/v1)
- 🛠️ Template Management - CLI commands to manage and customize templates
- ⚙️ Configuration - Project-level preferences with
.crudgen.json - 📦 Multi-Package - Standard, Enterprise, and Full feature packages
- ⚡ WebSocket Events - Real-time CRUD operations support (
--with-events) - 📥 Bulk Import - Excel/CSV import with 5-step wizard (
--with-import) - 🔐 Permission System - Auto-generate roles and permissions
- 100% Backward Compatible - All existing commands still work
🚀 Quick Start
Interactive Mode (Recommended)
npx aegisx-crud generateThe interactive wizard will guide you through:
- Table selection (from your database)
- Generation type (fullstack, backend, frontend, permissions)
- Template selection (backend: domain/standard, frontend: v2/v1)
- Feature selection (events, bulk operations, export, import)
- Advanced options and confirmation
Quick Mode
# Generate full CRUD with events
npx aegisx-crud generate users --events --package full
# Generate backend only
npx aegisx-crud generate products --package enterprise
# Preview without creating files
npx aegisx-crud generate orders --dry-run📦 Template Management
# List available templates
npx aegisx-crud templates list
# Set default template
npx aegisx-crud templates set-default
# View configuration
npx aegisx-crud config show
# Initialize config file
npx aegisx-crud config init📚 Documentation
For complete documentation, see:
- Complete Documentation - Main documentation hub
- Quick Commands - CLI reference
- Events Guide - WebSocket events (
--with-events) - Import Guide - Bulk import (
--with-import) - CHANGELOG - Version history
- Local Docs - Library-specific documentation
- Migration Guide - Upgrading from v1.x
- Template Development - Creating custom templates
🔧 Configuration
Create .crudgen.json in your project root:
{
"defaultTemplates": {
"backend": "domain",
"frontend": "v2"
},
"defaultFeatures": {
"events": true,
"bulkOperations": true,
"export": false,
"import": false
}
}📦 Available Packages
- Standard - Basic CRUD operations
- Enterprise - Advanced features (bulk ops, dropdowns, stats)
- Full - All features (validation, export, import)
🎯 Examples
# Interactive mode - easiest way
npx aegisx-crud generate
# Quick generation with all features
npx aegisx-crud generate notifications --package full --events
# Custom output directory
npx aegisx-crud generate users --output ./custom/path
# Force regeneration (removes duplicates)
npx aegisx-crud generate products --force🛠️ Programmatic Usage
const { generateCrudModule, TemplateManager } = require('@aegisx/crud-generator');
// Generate CRUD module
await generateCrudModule('users', {
withEvents: true,
package: 'full',
});
// Use Template Manager
const templateManager = new TemplateManager({
templatesBasePath: './templates',
});
await templateManager.initialize();📄 License
MIT © AegisX Team
🔗 Quick Links
- Main Documentation Hub - Start here for all guides
- Quick Commands Reference - Fast CLI lookup
- Events Guide - Real-time WebSocket events
- Import Guide - Bulk Excel/CSV import
- CHANGELOG - What's new in v2.0.1
Need help? Check the complete documentation or template development guide.
Version: 2.0.1 Last Updated: 2025-10-26
