UNPKG

fhipster

Version:

A CLI tool to convert JHipster JDL to Flutter GetX services and models.

127 lines (82 loc) • 4.43 kB
# FHipster ![FHipster - Flutter tool for converting JDL to Flutter ](https://dl3.pushbulletusercontent.com/T5UCg8KcfSBk06wyziPK2ZKTMzUByfZg/a-digital-illustration-of-a-smiling-hipp_u60V8NX0TUa5-x-HyyWx3A_o3ipjE9jTLSC1SopRHOWWw.jpeg) ## šŸš€ JDL to Flutter: Bridging Your Backend with Beautiful UIs! šŸš€ ### ✨ Say Goodbye to Boilerplate, Hello to Blazing Fast Development! ✨ Are you a Flutter developer building stunning mobile apps, but constantly find yourself bogged down by the tedious task of manually creating service calls, data models, and form structures to match your JHipster backend? Do you dream of a world where your backend's data model magically translates into ready-to-use Flutter code? Your dream just became a reality! Introducing **JDL to Flutter**, the ultimate companion for developers leveraging JHipster's powerful backend generation with Flutter's elegant frontend capabilities. This revolutionary tool takes your JHipster Domain Language (JDL) definitions and intelligently crafts the essential Flutter classes you need, saving you countless hours of repetitive coding and ensuring perfect synchronization between your layers. ## 🌟 What This Magic Wand Does 🌟 JDL to Flutter is designed to streamline your development workflow by automatically generating: - **🌐 Service Classes**: Ready-to-use Dart classes for interacting with your JHipster REST endpoints, handling HTTP requests, and deserializing responses. Forget manual `http.get`, `http.post`, and JSON parsing! - **šŸ“¦ Model Classes**: Beautifully crafted Dart data models (.dart files) with `fromJson` and `toJson` methods, perfectly mirroring your JDL entities. Type-safe, robust, and delightful to work with. - **šŸ“ Form Classes**: Smartly designed Flutter form models and widgets (or helpers) that align with your entity properties, making data input and validation a breeze. Get a head start on your CRUD screens! ## šŸš€ Get Started in a Flash! šŸš€ ### Installation You can install `fhipster` globally via npm: ```bash npm install -g fhipster ``` ### Usage Once installed, generating your Flutter code is as simple as pointing the tool to your JDL file: ```bash fhipster <jdl-file> <output-directory> [OPTIONS] ``` ### Example Let's say you have an `application.jdl` file like this: ```jdl entity BlogPost { title String required, content TextBlob, date Instant, author User } entity Comment { text String required, date Instant } relationship OneToMany { BlogPost to Comment{blogPost} } ``` Running a basic command: ```bash fhipster application.jdl lib/models ``` Or, a more comprehensive command including optional parameters for microservices and API host: ```bash fhipster ./appuser.jdl my_flutter_app --microservice sample-service --apiHost 'https://api.ypurapi.lk' ``` Will generate files similar to: ``` lib/models/ ā”œā”€ā”€ blog_post_model.dart ā”œā”€ā”€ blog_post_service.dart ā”œā”€ā”€ blog_post_form.dart ā”œā”€ā”€ comment_model.dart ā”œā”€ā”€ comment_service.dart ā”œā”€ā”€ comment_form.dart └── generated_models.dart (or an index file for easy export) ``` Each generated file will contain the necessary Dart code for models, services, and forms, saving you hours of manual coding! Check `fhipster --help` for all available options! ## šŸ¤ Contributing We believe in the power of community! If you have ideas for new features, find a bug, or want to improve the existing code, your contributions are highly welcome. - Fork the repository. - Create a new branch (`git checkout -b feature/amazing-feature`). - Make your changes. - Commit your changes (`git commit -m 'Feat: Add amazing feature'`). - Push to the branch (`git push origin feature/amazing-feature`). - Open a Pull Request. Please ensure your code adheres to our style guidelines and includes appropriate tests. ## šŸ“œ License This project is licensed under the MIT License - see the LICENSE file for details. ## šŸ™ Acknowledgements Inspired by the incredible JHipster community and its powerful JDL. Built with ā¤ļø by Heaven'sCode. ## šŸ›£ļø Future Enhancements - Support for more JHipster field types and relationships. - Customizable templates for generated code. - Integration with state management solutions (e.g., Provider, Riverpod, Bloc). - CLI wizard for interactive setup. - Hot-reloading for generated files during development. Happy Coding! šŸŽ‰