Tired of repeating the same folder structure setup in Flutter? I built a CLI tool that generates Clean Architecture + Riverpod modules with one command—saving hours of boilerplate and boosting productivity.
by Ramy Bouchareb
As a Flutter developer, I kept running into the same problem: every time I started a new feature or app, I had to manually recreate the same folder structure, set up providers, define use-cases, and wire everything together with Riverpod and Clean Architecture.
So I decided to fix it once and for all—by building a CLI tool that would do it for me.
Clean Architecture brings order to Flutter projects, but it's also... repetitive.
Every new feature means:
data/
, domain/
, and presentation/
folders.Doing this manually for each new feature is not just annoying—it’s error-prone and time-consuming.
Instead of copying and pasting or starting from scratch, I wanted to generate entire feature modules with a single command. Think:
flutter pub run flutter_clean_architecture_generator create user_profile
This command would output:
features/user_profile/
├── data/
│ └── repositories/
├── domain/
│ └── usecases/
├── presentation/
│ ├── controllers/
│ └── pages/
└── providers.dart
Everything wired and ready for development.
I created flutter_clean_architecture_generator
—a CLI tool published on pub.dev.
flutter pub run flutter_clean_architecture_generator create auth
Will generate:
data/
: Models, remote/local data sources.domain/
: Abstract repositories, entities, use-cases.presentation/
: Pages and controllers using Riverpod.providers.dart
: Hooks everything together.I’ve used this in multiple Flutter projects now. It allows me to:
This tool is especially useful if:
Install it globally:
flutter pub global activate flutter_clean_architecture_generator
Use it inside any Flutter project:
flutter pub run flutter_clean_architecture_generator create feature_name
Start building right away.
Building flutter_clean_architecture_generator
was a game-changer for my workflow.
It saves me time, enforces structure, and lets me focus on what matters: writing business logic and building great apps.
If you’re tired of repeating yourself every time you start a feature, give it a try and let me know what you think!
📦 Package:
flutter_clean_architecture_generator on pub.dev
🧠 Author:
Ramy Bouchareb
Published in my portfolio to help other developers save time and stay organized.
Discover more insights about development, DevOps, and technology.
View All Posts