fabrik 0.1.5
fabrik: ^0.1.5 copied to clipboard
A CLI to generate scalable, testable, clean Flutter feature scaffolding using DDD layered architecture.
🧱 Fabrik CLI #
A powerful CLI tool to generate scalable, testable, and clean Flutter feature scaffolding using DDD layered architecture.
Built with developer experience in mind — generate complete feature folders in seconds.
✨ Features #
- ✅ Clean architecture structure (Model → Entity → DataSource → Repository → UseCase → BLoC)
- ✅ Barrel files auto-generated
- ✅ Supports
--output-diror-oto customize output - ✅ Works great with
flutter_core(optional) - 🛠️ Optional flags like
--with-bloc,--minimalcoming soon
🚀 Installation #
dart pub global activate fabrik
Make sure your Dart global bin is in PATH:
# Add this to your shell config (~/.zshrc or ~/.bashrc)
export PATH="$PATH":"$HOME/.pub-cache/bin"
🧰 Usage #
Generate a feature #
fabrik generate feature auth
This will create:
./auth/
|- models/
|- entities/
|- usecases/
|- blocs/
|- repository.dart
|- data_source.dart
|- auth.dart (barrel)
Generate into a specific folder #
fabrik generate feature auth -o app_auth
➡️ Outputs to ./app_auth/
📦 Output Example #
Inside your feature folder:
lib/features/auth/
|- models/
|- user_model.dart
|- models.dart
|- entities/
|- user.dart
|- entities.dart
|- usecases/
|- login_usecase.dart
|- usecases.dart
|- blocs/
|- auth_bloc.dart
|- auth_event.dart
|- auth_state.dart
|- repository.dart
|- data_source.dart
|- auth.dart
All classes are stubbed with clean and minimal code — ready to be implemented.
🔗 Related #
- mason — powering this scaffolding magic.
- flutter_core — recommended base package for
Failure,Status, and architecture utilities.
📣 Coming Soon #
- ❌
--minimalflag for model-only scaffolds - ❌
fabrik initto generate ApiClient, Config, and other architecture utils - ❌ VSCode Extension for Fabrik
- ❌ Web UI at fabriktool.com
❤️ Credits #
Crafted by Ashish Bhakhand, inspired by real-world Flutter app architecture challenges.
Open source. Open to contributions. Built for the Flutter community.
📄 License #
MIT