arcle 1.0.2
arcle: ^1.0.2 copied to clipboard
A Flutter CLI to scaffold Clean Architecture projects with BLoC, GetX, or Riverpod. Easily generate features, routing, and DI.
ARCLE CLI #
A production-ready Flutter CLI that scaffolds Clean Architecture projects with BLoC, GetX, or Riverpod.
Why ARCLE #
ARCLE removes repetitive setup work for scalable Flutter apps.
- Create a project with Clean Architecture structure
- Choose BLoC, GetX, or Riverpod
- Generate full feature modules
- Keep DI and route wiring consistent
- API client ready with Dio
- Session management & token handling
- Multi-language support
- Environment configuration (local, staging, production)
- Working demo feature with login & API integration
- Auto-generated documentation
- Production-ready code structure
- Build APKs from the CLI
What's New In 1.0.2 #
- Added
arcle doctorto validate ARCLE projects and detect common setup issues - Added
arcle doctor --fixfor safe ARCLE-managed repairs - Added
arcle verifyto run analyze, test, and BLoC codegen checks - Added generated
core/utils/date_formatter.dartwith UTC/local conversion and UX-friendly output helpers - Added automatic
intldependency support in generated projects - Updated generated notification and permission services to be platform-safe for Android, iOS, macOS, and unsupported platforms like web
- Removed generated
lib/features/README.mdfrom new projects across all state management options
π¦ Installation #
Option 1: Activate globally (Recommended) #
dart pub global activate arcle
Then use the arcle command directly from anywhere in your terminal.
Make sure your pub cache bin folder is in your PATH:
- Linux/macOS:
$HOME/.pub-cache/bin - Windows:
%APPDATA%\Pub\Cache\bin
Add to your PATH if not already present:
- Linux/macOS: Add to
~/.bashrcor~/.zshrc:export PATH="$PATH:$HOME/.pub-cache/bin" - Windows: Use System Properties β Environment Variables β Add
%APPDATA%\Pub\Cache\bin
Option 2: Run from pub #
dart pub global activate arcle
arcle --help
Or use without activating:
dart pub global run arcle:arcle --help
π Quick Start #
# Create with interactive state selection
arcle create my_app
# Create with explicit state
arcle create my_app --state bloc
arcle create my_app --state getx
arcle create my_app --state riverpod
# Add a feature
arcle feature auth
# Build APK
arcle build apk --debug
arcle build apk --release
# Validate and verify an ARCLE project
arcle doctor
arcle doctor --fix
arcle verify
π Commands #
arcle create <name>: Create a new Flutter project with Clean Architecturearcle init: Scaffold Clean Architecture in an existing projectarcle feature <name>: Generate feature data/domain/presentation layersarcle doctor: Validate ARCLE project health and safe repairsarcle auto-gen-di: Regenerate DI and refresh dependencies (BLoC)arcle gen-di: Regenerate DI files only (BLoC)arcle build apk: Build APK in debug or release modearcle gen-doc: Generate project documentationarcle verify: Run analyze/test/codegen verification
State Management #
ARCLE includes templates and generators for three state management solutions:
BLoC (Business Logic Component) #
- Event-driven architecture
- Predictable state management with clear separation of concerns
- Automatic DI generation using
GetItandInjectable - Best for: Complex apps with multiple features and events
GetX #
- Lightweight and simple to use
- Reactive state management with bindings
- No build_runner needed
- Best for: Quick prototyping and small to medium apps
Riverpod #
- Type-safe provider-based state management
- No context needed, functional approach
- Excellent for state composition
- Best for: Apps requiring strong typing and immutability
β Requirements #
- Dart SDK: 3.5.4 or higher
- Flutter: Latest stable channel (3.24.5+)
- Operating System: macOS, Linux, or Windows
- Terminal: bash, sh, zsh, or PowerShell
Platform Notes #
- ARCLE project scaffolding works for Android, iOS, macOS, and web because it builds on
flutter create - Generated notification and permission services now include platform guards so unsupported platforms fail safely instead of crashing
- Android and iOS are the primary supported mobile targets for the generated permission and local notification setup
- iOS still requires proper native permission descriptions in
Info.plistand Apple signing setup before release builds - Web is safe for shared app code, but local notifications and runtime permissions are intentionally treated as unsupported by default
π§ͺ Troubleshooting #
Command Not Found: arcle #
If you get "command not found: arcle" after global activation, ensure the pub cache bin is in your PATH:
# Check if dart is properly installed
dart --version
# Re-activate arcle
dart pub global activate arcle
# On Linux/macOS, add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export PATH="$PATH:$HOME/.pub-cache/bin"
# On Windows, use System Environment Variables
%APPDATA%\Pub\Cache\bin
Flutter SDK Not Found #
ARCLE requires Flutter to be installed and available in PATH:
flutter --version
which flutter # or 'where flutter' on Windows
Build Failures #
Ensure you're using a compatible Flutter version:
flutter channel stable
flutter upgrade
ποΈ Project Structure #
my_awesome_app/
βββ lib/
β βββ main.dart # App entry point
β βββ bootstrap.dart # Bootstrap configuration
β βββ app/
β β βββ app.dart # App widget setup
β βββ core/ # Shared infrastructure
β β βββ api_client/
β β β βββ api_service.dart # HTTP client wrapper
β β β βββ base_response.dart # API response model
β β β βββ dio_client.dart # Dio configuration
β β βββ di/
β β β βββ app_di.dart # DI setup
β β β βββ injection.dart # DI setup (BLoC only)
β β β βββ injectable_module.dart # Module registration (BLoC only)
β β β βββ injection.config.dart # Generated config (BLoC only)
β β β βββ providers.dart # Riverpod providers (Riverpod only)
β β βββ env/
β β β βββ env.dart # Environment interface
β β β βββ local_env.dart # Local config
β β β βββ prod_env.dart # Production config
β β β βββ stag_env.dart # Staging config
β β β βββ env_factory.dart # Environment factory
β β βββ error_handler/
β β β βββ error_handler.dart # Error handling
β β βββ response_handler/
β β β βββ response_handler.dart # Response handling
β β β βββ api_failure.dart # Failure classes
β β βββ localization/
β β β βββ app_strings.dart # Localization keys
β β β βββ getx_localization.dart # GetX localization (GetX only)
β β βββ route_handler/
β β β βββ app_routes.dart # Route definitions
β β β βββ app_router.dart # Router configuration
β β β βββ app_route_observer.dart # Route observer
β β βββ session_manager/
β β β βββ pref_manager.dart # SharedPreferences wrapper
β β β βββ session_manager.dart # Session handling
β β βββ theme_handler/
β β β βββ app_theme.dart # Theme configuration
β β βββ notifications/
β β β βββ notification_service.dart # Notification handling
β β βββ permissions/
β β β βββ permission_service.dart # Permission handling
β β βββ utils/
β β β βββ constants.dart # App constants
β β β βββ endpoints.dart # API endpoints
β β β βββ enums.dart # Enumerations
β β β βββ app_assets.dart # Asset constants
β β β βββ app_colors.dart # Color constants
β β β βββ dimensions.dart # Dimension constants
β β β βββ dialogs.dart # Dialog utilities
β β β βββ logger.dart # Logging utility
β β β βββ result.dart # Either pattern
β β β βββ app_validators.dart # Custom validators
β β β βββ validators.dart # Validation utilities
β β βββ common_widgets/
β β βββ svg_icon.dart # SVG icon widget
β β βββ common_loader.dart # Loading widget
β β βββ common_button.dart # Button widget
β β βββ common_text_field.dart # Text input widget
β β βββ common_dropdown.dart # Dropdown widget
β β βββ common_checkbox.dart # Checkbox widget
β β βββ common_snackbar.dart # Snackbar widget
β β βββ common_app_bar.dart # App bar widget
β β βββ common_bottom_sheet.dart # Bottom sheet widget
β β βββ common_dialog.dart # Dialog widget
β β βββ common_image_container.dart # Image container widget
β βββ features/ # Feature modules
β βββ demo/ # Demo feature (included!)
β β βββ data/
β β β βββ models/
β β β βββ sources/
β β β βββ repositories/
β β βββ domain/
β β β βββ entities/
β β β βββ repositories/
β β β βββ usecases/
β β βββ presentation/
β β βββ pages/ # Feature screens
β β βββ widgets/ # Feature widgets
β β βββ bloc/ (BLoC) # BLoC files (if using BLoC)
β β β βββ *_bloc.dart
β β β βββ *_event.dart
β β β βββ *_state.dart
β β βββ controller/ (GetX) # Controllers (if using GetX)
β β β βββ *_controller.dart
β β βββ bindings/ (GetX) # Bindings (if using GetX)
β β β βββ *_binding.dart
β β βββ providers/ (Riverpod) # Providers (if using Riverpod)
β β βββ *_providers.dart
β βββ settings/ # Settings feature (included!)
βββ assets/
β βββ images/
β βββ icons/
β βββ langs/
β βββ en.json # English translations
β βββ bn.json # Bengali translations (BLoC & Riverpod only)
βββ docs/ # Auto-generated documentation
βββ test/ # Tests
β βββ features/
β β βββ */
β β βββ *_test.dart
β βββ widget_test.dart
βββ pubspec.yaml # Dependencies
ποΈ State Management Details #
ARCLE generates different structures and setup requirements based on your chosen state management:
BLoC/Cubit Architecture #
- Event-based state management with predictable patterns
- DI Setup: Uses GetIt + Injectable library
- Files Created:
lib/core/di/injection.dart- Service locator initializationlib/core/di/injectable_module.dart- Dependency registration modulelib/core/di/injection.config.dart- Auto-generated dependencies (generated by build_runner)lib/core/di/bloc_providers.dart- BLoC provider instances
- Localization: Creates
assets/langs/en.jsonandassets/langs/bn.json - Best For: Complex apps with multiple features and events
- Code Generation: Requires
build_runner- runarcle auto-gen-diafter adding features
GetX #
- Lightweight and simple reactive state management
- Controller-based: Uses controller + binding pattern
- DI Setup: Service locator is built into GetX
- Files Created:
lib/core/localization/getx_localization.dart- GetX localization wrapper- Feature controller:
lib/features/*/presentation/controller/*_controller.dart - Feature binding:
lib/features/*/presentation/bindings/*_binding.dart
- Localization: Creates
.gitkeepplaceholder (you manage translations) - Best For: Quick prototyping and small to medium apps
- Build Step: No additional build step required
Riverpod #
- Type-safe provider-based state management
- Functional approach: Providers instead of classes
- DI Setup: Built into Riverpod providers
- Files Created:
lib/core/di/providers.dart- Core provider definitions- Feature providers:
lib/features/*/presentation/providers/*_providers.dart - Feature state:
lib/features/*/presentation/state/*_state.dart
- Localization: Creates
assets/langs/en.jsonandassets/langs/bn.json - Best For: Apps requiring strong typing and immutability
- Code Generation: Uses code generation for some features
π Feature Structure by State Management #
Generated features have different presentation structure depending on state management:
BLoC:
lib/features/feature_name/presentation/
βββ pages/
β βββ feature_name_screen.dart
βββ widgets/
β βββ feature_name_card.dart
βββ bloc/
βββ feature_name_bloc.dart
βββ feature_name_event.dart
βββ feature_name_state.dart
GetX:
lib/features/feature_name/presentation/
βββ pages/
β βββ feature_name_screen.dart
βββ widgets/
β βββ feature_name_card.dart
βββ controller/
β βββ feature_name_controller.dart
βββ bindings/
βββ feature_name_binding.dart
Riverpod:
lib/features/feature_name/presentation/
βββ pages/
β βββ feature_name_screen.dart
βββ widgets/
β βββ feature_name_card.dart
βββ providers/
β βββ feature_name_providers.dart
βββ state/
βββ feature_name_state.dart
π Features #
- π¦ Full project scaffolding with chosen architecture
- π§© Feature generation (data/domain/presentation layers)
- π Automatic DI wiring
- π± Build APK (debug and release modes)
- π Documentation generation
- π¨ Pre-configured theming system
- π API client setup with error handling
- β Comprehensive code templates
π Toolchain #
- Dart SDK:
^3.5.4 - Flutter: stable channel recommended
See TOOLCHAIN.md for release-specific versions and environment setup details.
πΊοΈ Roadmap #
- β Add support for more state management options (Provider, Redux)
- β Generate unit tests automatically
- β Add GraphQL support
- β Generate widget tests
- β Add Firebase integration option
- β Generate CI/CD configuration
- β Add more demo features
- β Support for custom templates
π€ Contributing #
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to your branch
- Open a pull request
π License #
MIT License. See LICENSE.
π Acknowledgments #
- Flutter team for the amazing framework
- BLoC, Getx, Riverpod library maintainers
- Clean Architecture community
- All contributors
β Star History #
If ARCLE helps you, consider giving it a star! β
π Stats #
- Lines of Code Generated: ~5,000+ per project
- Time Saved: Hours of setup work
- Architecture: Production-ready from day one
- Best Practices: Baked in by default
Happy Coding! π