FeatGen is a lightning-fast Command Line Interface (CLI) tool designed to automate the creation of Feature-First Architecture structures for modern software projects.
Instead of manually creating folders and typing repetitive boilerplate code, FeatGen generates a complete, ready-to-code feature package in milliseconds. It currently supports both Spring Boot (Java) and Flutter (Dart)!
- ⚡ Instant Generation: Generates complete feature layers for both backend and frontend instantly.
- ☕ Spring Boot Ready: Automatically writes standard Java annotations (
@RestController,@Service,@Repository,@Entity) and constructor injections. - 📱 Flutter Ready: Generates UI screens, state controllers, models, and API services with standard Flutter boilerplate.
- 🛢️ Smart Database Architecture: Generate standard JPA/SQL boilerplates or seamlessly switch to Firebase Firestore using the
--db firebaseflag. - 🎯 Custom Packages: Define your own base package dynamically using the
--packageflag. - 🚀 Standalone Executable: Compiled as a native
.exefile. You don't need Dart or Java installed on your machine to run the tool!
- Go to the Releases tab of this repository.
- Download the latest
feat_gen.exefile. - Place it in a folder of your choice (e.g.,
C:\tools\featgen). - Add to PATH: Search for "Environment Variables" in Windows, edit the
Pathvariable, and add the folder path where you placedfeat_gen.exe. - Open a new terminal and type
feat_gen --helpto verify the installation!
(For developers: You can also clone this repo and run dart run bin/feat_gen.dart)
Navigate to your project's root directory in the terminal and run the generation commands.
Create a Spring Boot feature with a custom base package (Generates JPA entities by default):
feat_gen create payment-gateway --package com.yourcompany.app
(Or use the shorthand -p)
feat_gen create order-management -p com.ecommerce.shop
Use the --framework or -f flag to target Flutter:
feat_gen create user-profile -f flutter
Generate features specifically tailored for Firebase Firestore instead of standard relational databases.
For Spring Boot (Generates Firestore collections and POJO entities):
feat_gen create product-catalog -p com.shop.app --db firebase
For Flutter (Generates cloud_firestore CRUD operations in the service class):
feat_gen create cart-items -f flutter --db firebase
If you run feat_gen create order-management -p com.shop.app, it generates:
order-management/
├── controller/
│ └── OrderManagementController.java
├── service/
│ └── OrderManagementService.java
├── repository/
│ └── OrderManagementRepository.java
├── dto/
│ ├── OrderManagementRequest.java
│ └── OrderManagementResponse.java
└── entity/
└── OrderManagement.java
Note: If you add --db firebase, the Repository and Entity classes will be automatically configured for Google Cloud Firestore instead of Spring Data JPA.
If you run feat_gen create user-profile -f flutter, it generates:
user-profile/
├── screens/
│ └── user_profile_screen.dart
├── controllers/
│ └── user_profile_controller.dart
├── models/
│ └── user_profile_model.dart
├── services/
│ └── user_profile_service.dart
└── widgets/
Note: If you add --db firebase, the user_profile_service.dart file will include ready-to-use CRUD operations using the cloud_firestore package.
Contributions, issues, and feature requests are welcome! If you'd like to help expand the template engine (e.g., adding GetX/BLoC support for Flutter, or new frameworks), please feel free to fork the repository and submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.