founder_code_cli 0.1.0-beta.1
founder_code_cli: ^0.1.0-beta.1 copied to clipboard
An enterprise-grade Flutter CLI for generating production-ready applications following Founder Code Standards and Clean Architecture.
Founder Code CLI #
Enterprise Flutter CLI for generating production-ready Flutter applications following Founder Code Standards.
Introduction #
Founder Code CLI (fc) is a professional-grade command-line interface designed for enterprise Flutter development. It automates the creation of high-quality, scalable, and maintainable Flutter projects based on the Founder Code Standard Architecture.
Unlike generic scaffolding tools, fc generates a strictly typed, modular infrastructure that is battle-tested for large-scale applications. It enforces Clean Architecture boundaries while providing a frictionless developer experience.
Why Founder Code CLI? #
In enterprise environments, consistency is everything. Setting up a new project from scratch—configuring routing, networking, responsiveness, and state management—takes hours and often leads to architectural drift.
Founder Code CLI solves this by:
- Reducing Setup Time: Go from zero to a runnable enterprise app in seconds.
- Enforcing Standards: Every project follows the same 10-folder feature structure and core kernel.
- Code-Driven Dependencies: No bloat. Only the packages your code actually uses are added to
pubspec.yaml. - Atomic Rollbacks: If a generation fails, the CLI automatically cleans up the workspace.
Features #
| Feature | Description |
|---|---|
| Production Ready | Generated code includes error handling, logging, and security out-of-the-box. |
| Clean Architecture | Strict separation between Data, Domain, and Presentation layers. |
| Responsive Engine | A built-in scaling system that works without global mutable state. |
| Theme Engine | Full Material 3 support with dynamic brand color generation. |
| Smart Networking | Advanced Dio wrapper with SSE support and standardized error mapping. |
| Unified Storage | Single Repository API for SharedPreferences and SecureStorage. |
| Auth Ready | Every project starts with a fully implemented Authentication module. |
| Feature Generator | Create complex feature slices with recursive sub-folders in one command. |
| White Label Ready | Standardized design tokens make rebranding trivial. |
Installation #
Install the CLI globally via pub.dev:
dart pub global activate founder_code_cli
System Requirements #
- Flutter SDK:
^3.10.0or higher - Dart SDK:
^3.0.0or higher - OS: Windows, macOS, or Linux
Getting Started #
Quick Start #
Create your first project in one command:
fc create my_awesome_app --org com.founder.code
This will initialize a new Flutter project, generate the Founder Code directory structure, inject the necessary dependencies, and set up the default Auth module.
Available Commands #
fc create #
Creates a new Flutter project with the full enterprise structure.
Usage:
fc create <project_name> --org <organization_name>
What it does:
- Runs
flutter create. - Replaces the default folder structure.
- Implements the Responsive and Theme engines.
- Generates the Core and Shared modules.
- Creates the default Auth feature.
- Runs
flutter pub get.
fc feature #
Generates a new feature slice following Clean Architecture standards.
Usage:
fc feature <feature_name>
Generated Structure:
data/:datasource,models,repo,mapper.domain/:entity,repo,usecase.presentation/:provider,screen,widget.
fc screen #
Generates a new UI screen in a specific feature.
Usage:
fc screen <screen_name> --feature <feature_name>
fc model #
Generates a data model with JSON serialization and Equatable support.
Usage:
fc model <model_name> --feature <feature_name>
fc assets #
Scans the assets/ directory and generates a strongly-typed Assets class.
Usage:
fc assets [--watch]
Use the --watch flag to automatically update the class whenever you add or remove files in your assets folder.
fc doctor #
Checks the environment and verifies that all Founder Code requirements are met.
fc clean #
Cleans up build artifacts and temporary generation files.
fc upgrade #
Upgrades the CLI to the latest stable version.
Project Structure #
The generated project follows a strict modular hierarchy:
lib/app/ #
The orchestration layer.
app.dart: The root widget and global configuration.app_router.dart: Centralized GoRouter instance.app_theme.dart: Material 3 theme factories.di/: Dependency injection entry point.routes/: Routing constants and transition helpers.localization/: Multi-language manager.
lib/core/ #
The infrastructure kernel.
network/: Advanced Dio implementation and SSE service.env/: Environment-specific configurations (Dev, UAT, Prod).constants/: Design tokens (Colors, Spacing, Radius, Fonts).errors/: Centralized exception mapping and error handling.utils/: Common and regional (India) validators/formatters.services/: Low-level system services (Permission, Version, SecureStorage).local_database/: Unified persistence repository.responsive/: The Immutable Responsive Engine.
lib/shared/ #
Reusable UI components.
widgets/: Basic UI building blocks (AppText, AppImage).buttons/: Premium animated buttons.textfields/: Robust input fields with validation UI.loaders/: Standardized loading indicators.dialogs/: Global alert and confirmation handlers.
lib/features/ #
Feature-specific slices. Each folder is a self-contained domain following Clean Architecture.
Default Architecture #
Networking (Dio) #
The networking layer is built for stability. It includes:
- Connectivity Gate: Requests are automatically blocked if the device is offline.
- Standardized Error Mapping: Maps HTTP status codes (401, 429, 500, etc.) to specific
AppExceptiontypes. - Generic Interceptors: Decoupled from state management, allowing for clean token injection.
Routing (GoRouter) #
Uses the industry-standard go_router package.
- Supports nested routes and deep linking.
- Includes pre-built transition animations (Fade, Slide).
- Features a global
rootNavigatorKeyfor navigation from anywhere in the app.
Responsive Engine #
A custom, zero-dependency engine based on a 375x812 design reference.
- Context-Driven: Recalculates automatically on orientation changes.
- Explicit Scaling: No "magic" syntax. Uses
context.w(),context.h(), andcontext.sp().
Theme Engine #
A full-featured Material 3 implementation.
- Dynamic Palette: Automatically generates a cohesive 7-color brand palette from a single primary hex code.
- Dark Mode: Fully implemented and persistent by default.
Default Auth Module #
Every project comes with a production-ready auth feature. It serves as a blueprint for the rest of the app and includes:
- Presentation: A responsive Login screen with validation.
- Domain:
LoginUseCaseandUserEntity. - Data:
AuthRemoteDataSourceandAuthRepositoryImpl. - Infrastructure: Simulated login logic that connects to the
NetworkApiService.
Roadmap #
Current (v0.1.x) #
- ✅ Base Generation Engine.
- ✅ Core Kernel (Network, Theme, Responsive).
- ✅ Standard Shared Widgets.
- ✅ Smart Dependency Resolution.
- ✅ Default Auth Module.
Future (v0.5.x) #
- ❌
fc add hive: Add local database plugin. - ❌
fc add firebase: Automate Firebase Core setup. - ❌
fc feature --bloc|--riverpod: Support multiple state managements in generators. - ❌ Built-in API Mocking server for development.
Long Term (v1.0.0) #
- ❌ Visual Template Editor.
- ❌ CI/CD automation scripts for generated projects.
- ❌ One-click White Labeling engine.
Enterprise Standards #
All generated code adheres to:
- Liskov Substitution Principle: Every service uses an abstract interface.
- Inversion of Control: Dependencies are injected, never hardcoded.
- Single Source of Truth: Constants like
StorageKeysprevent magic string bugs. - Accessibility: All widgets include semantic nodes and haptic feedback.
Contributing #
We welcome contributions from the community! If you'd like to contribute, please:
- Fork the repository.
- Create a new branch (
git checkout -b feature/awesome-feature). - Commit your changes.
- Push to the branch.
- Open a Pull Request.
Please ensure all new code passes dart analyze.
Support #
If you encounter any issues or have questions, please open an issue on the GitHub repository.
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Author #
Founder Code Team Professional Enterprise Solutions
Acknowledgements #
- Inspired by the architectural standards of Very Good Ventures.
- Built using the powerful Mason Logger and Args packages.