Written by Kudah Ndhlovu
Version: 2.0.0
License: MIT
Modesy is a powerful, enterprise-grade code generation platform that automatically creates models, controllers, repositories, and views from SQL schema definitions across 12+ programming languages. Built with Hexagonal Architecture and Clean Architecture principles for maximum maintainability, testability, and extensibility.
# Install dependencies
npm install
# Generate Dart/Flutter code
npm run cli example-schema.sql dart
# Generate TypeScript code
npm run cli example-schema.sql typescript
# Generate for all languages
npm run cli example-schema.sql all
# Advanced mode with interactive configuration
npm run cli example-schema.sql dart --advanced
# JSON output for scripting
npm run cli example-schema.sql typescript --json
# Custom output directory
npm run cli example-schema.sql dart --output ./my-project
# Verbose logging
npm run cli example-schema.sql dart --verbose# Generate Dart/Flutter code
npm start example-schema.sql dart
# Generate TypeScript code
npm start example-schema.sql typescript
# Generate for all languages
npm start example-schema.sql all
# Advanced mode with interactive configuration
npm start example-schema.sql --advanced- Dart/Flutter: Models, controllers, repositories, views, protos
- TypeScript: Models, controllers, repositories
- JavaScript: Models, controllers, repositories
- Kotlin: Models, controllers, repositories
- Swift: Models, controllers, repositories
- Java: Models, controllers
- C#: Models, controllers, repositories
- Rust: Models, controllers, repositories
- Go: Models, controllers, repositories
- PHP: Models, controllers, repositories
- Ruby: Models, controllers, repositories
- Python: Models, controllers
- SQL Schema Parsing: Automatic parsing of CREATE TABLE statements
- Metadata-Driven Generation: Customizable via
project-metadata.json - Validation Rules: Automatic constraint generation
- UI Hints: Form generation with proper input types
- Relationship Support: Foreign key and association handling
- Permission Management: Role-based access control
- Localization: Multi-language support
- Seed Data: Automatic test data generation
- Protocol Buffers: gRPC service definitions
- Professional CLI: Modern command-line interface with color grading
- Comprehensive Logging: Multi-level logging with colored output and file logging
- Interactive Console: Professional command-line interface with validation
- Error Handling: Graceful error recovery with detailed context
- Input Validation: Robust validation with retry mechanisms
- Progress Tracking: Real-time generation progress with visual indicators
- JSON Output: Machine-readable output for CI/CD integration
- Performance Optimized: Fast generation for large schemas
Modesy follows Hexagonal Architecture (Ports & Adapters) combined with Clean Architecture principles:
src/generators/
├── domain/ # Business Logic
│ ├── entities/ # Core entities
│ ├── value-objects/ # Immutable value objects
│ ├── use-cases/ # Application logic
│ └── ports/ # Interface definitions
├── application/ # Application Services
│ └── services/ # Orchestration layer
└── infrastructure/ # External concerns
└── adapters/ # Language-specific generators
├── dart/
├── typescript/
├── javascript/
└── [other languages...]
- Maintainable: Clear separation of concerns
- Testable: Easy to unit test individual components
- Extensible: Simple to add new languages and features
- Scalable: Handles large schemas efficiently
- Professional: Enterprise-grade architecture
- Node.js v14.0.0 or higher
- npm (comes with Node.js)
# Clone the repository
git clone <repository-url>
cd modesy
# Install dependencies
npm install
# Build the project
npm run build
# Quick test
npm start example-schema.sql dart# Basic generation
npm run cli <schema> <language> [options]
# Examples
npm run cli schema.sql dart
npm run cli schema.sql typescript
npm run cli schema.sql kotlin
npm run cli schema.sql swift
# Advanced options
npm run cli schema.sql dart --advanced
npm run cli schema.sql all --output ./my-project
npm run cli schema.sql typescript --json
npm run cli schema.sql dart --verbose
# Help and version
npm run cli --help
npm run cli --version# Basic generation
npm start <schema> <language>
# Examples
npm start schema.sql dart
npm start schema.sql typescript
npm start schema.sql kotlin
npm start schema.sql swift
# Advanced usage
npm start schema.sql --advanced
npm start schema.sql alldart- Dart/Fluttertypescript- TypeScriptjavascript- JavaScriptkotlin- Kotlinswift- Swiftjava- Javacsharp- C#rust- Rustgo- Gophp- PHPruby- Rubypython- Pythonall- All languages
output/v5/
├── dart/
│ ├── models/ # Data models
│ ├── controllers/ # Business logic
│ ├── repositories/ # Data access
│ ├── views/ # UI components
│ ├── protos/ # Protocol buffers
│ └── seeds/ # Seed data
├── typescript/
│ ├── models/
│ ├── controllers/
│ └── repositories/
├── javascript/
│ ├── models/
│ ├── controllers/
│ └── repositories/
└── [other languages...]
Create a project-metadata.json file to customize generation:
{
"project": {
"name": "MyProject",
"version": "1.0.0",
"description": "My awesome project"
},
"generation": {
"includeValidation": true,
"includeUIHints": true,
"includeRelations": true,
"includePermissions": true,
"includeLocalization": true,
"includeSeedData": true
},
"tables": {
"users": {
"validation": {
"email": "required|email",
"username": "required|min:3|max:20"
},
"uiHints": {
"email": "email",
"password": "password"
}
}
}
}- Validation Rules: Define field validation constraints
- UI Hints: Specify form input types and behaviors
- Relationships: Define table relationships and associations
- Permissions: Configure role-based access control
- Localization: Set up multi-language support
- Seed Data: Generate test data for development
- All Languages: 12 programming languages generate successfully
- File Generation: 55+ files generated per schema
- Performance: Excellent performance with no degradation
- TypeScript Compilation: No errors with strict mode
- Backward Compatibility: Legacy system remains functional
# Test TypeScript compilation
npm run build
# Test specific language generation
npm start example-schema.sql dart
npm start example-schema.sql typescript
# Test all languages
npm start example-schema.sql all- Single Language: ~0.1 seconds for 5 tables
- All Languages: ~0.2 seconds for 5 tables
- Large Schema: 133 tables → 1,463 files in seconds
- Memory Usage: Efficient with no memory leaks
- Concurrent Generation: Supports parallel processing
npm start <schema> <language> # Generate code
npm run dev # Development mode
npm run build # Build project
npm run help # Show helpThe platform supports both legacy and new architecture:
# Legacy system (still works)
npm start schema.sql dart
# New architecture
npx ts-node src/index-new.ts schema.sql dart- Create language directory:
src/generators/infrastructure/adapters/[language]/ - Implement generators:
[Language]ModelGenerator.ts, etc. - Register in
TemplateRepositoryAdapter - Update
CodeGeneratorAdapter
- Architecture Guide - Detailed architecture documentation
- Changelog - Version history and changes
- Setup Guide - Detailed setup instructions
- Verification Report - Testing and verification results
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Author: Kudah Ndhlovu
- Architecture: Hexagonal Architecture + Clean Architecture
- Languages: 12+ programming languages supported
- Status: Production-ready with enterprise-grade architecture
- Plugin System: Third-party language generators
- Configuration Management: External configuration files
- Caching: Template and file caching
- Parallel Processing: Concurrent code generation
- Validation: Enhanced input validation
- Metrics: Performance monitoring and analytics
Modesy - Empowering developers with intelligent code generation across multiple programming languages.
Built with ❤️ by kudahndhlovu using Hexagonal Architecture and Clean Architecture principles.