8000 GitHub - calvingit/fwen · GitHub
[go: up one dir, main page]

Skip to content
calvingitPublic

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

fwen

Flutter Clean Architecture scaffolder - Create production-ready Flutter apps with Clean Architecture in seconds.

PyPI Python License Tests


Table of Contents

Overview

fwen is a command-line tool that scaffolds Flutter applications following Clean Architecture principles. It generates a complete project structure with configurable state management, navigation, dependency injection, and optional integrations for Firebase, authentication, analytics, testing, and CI/CD.

Why fwen?

  • 🏗️ Clean Architecture - Pre-configured layer separation (core, features, shared)
  • ⚡ Fast - Create a full project in seconds with interactive or non-interactive CLI
  • 🔧 Configurable - Support for Bloc, Provider, Riverpod, GoRouter, AutoRoute, and more
  • 📦 Batteries Included - Optional Firebase, authentication, persistence, analytics setup
  • 🧪 Testing Ready - Generated projects include testing structure
  • 🚀 Production-Ready - Bootstrap error handling, logging, and best practices

Features

Architecture Options

  • State Management: Bloc, Provider, Riverpod
  • Navigation: GoRouter, AutoRoute, Navigator 2.0
  • Dependency Injection: GetIt, Provider, Riverpod

Integrations

  • Firebase: Auth, Firestore, Functions, Analytics, Messaging, Storage
  • Authentication: Email, Google, Apple, Phone
  • API Layer: Dio, Retrofit
  • Persistence: Shared Preferences, Hive, Isar
  • Analytics: Firebase Analytics, Sentry, Mixpanel
  • CI/CD: GitHub Actions, GitLab CI

Platform Support

  • iOS, Android, Web, macOS, Windows, Linux

Installation

Prerequisites

  • Python 3.11+
  • Flutter 3.22.0+
  • Dart 3.4.0+

Using uv (Recommended)

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install fwen
uv pip install fwen

# Or run directly with uv
uvx fwen --project-name my_app

Using pip

pip install fwen

From Source

git clone https://github.com/calvingit/fwen.git
cd fwen
uv pip install -e .

Quick Start

Interactive Mode

Run without arguments for step-by-step prompts:

fwen

Non-Interactive Mode

Pass all options via command-line arguments:

# Basic usage
fwen --project-name my_app --org com.example

# Full example with all options
fwen \
  --project-name my_awesome_app \
  --org com.mycompany \
  --description "My Awesome App" \
  --state-management bloc \
  --navigation go_router \
  --platforms ios android web \
  --include-api \
  --api-choice dio \
  --yes

Documentation

Architecture Guide

Command-Line Arguments

Required:

  • --project-name - Project name in snake_case

Basic Options:

  • --org - Organization ID (default: com.example)
  • --description - Project description
  • --output-dir - Output directory (default: current)

Architecture:

  • --state-management - bloc|provider|riverpod (default: bloc)
  • --navigation - go_router|auto_route|navigator (default: go_router)
  • --dependency-injection - get_it|provider|riverpod (default: get_it)
  • --no-examples - Disable example scenarios. Default behavior enables include_examples and applies scenario.commerce_reference into lib/.

Platforms:

  • --platforms - ios android web macos windows linux (default: ios android)

Features:

  • --include-auth -- --auth-methods email google apple phone
  • --include-firebase -- --firebase-services auth firestore analytics messaging storage
  • --include-api -- --api-choice dio retrofit fetch
  • --include-persistence -- --persistence-choice shared_preferences hive isar
  • --include-analytics -- --analytics-choice firebase_analytics sentry mixpanel
  • --include-testing -- --testing-types unit widget integration
  • --include-ci -- --ci-choice github_actions gitlab_ci

Other:

  • --feature-name - Create initial feature
  • --yes, -y - Skip confirmation
  • --interactive, -i - Force interactive mode

Template Commands:

  • fwen templates list - Show full template registry metadata
  • fwen templates explain - Show selected templates for current/default CLI config
  • fwen templates explain --state-management riverpod --navigation auto_route --no-examples
    • Explain template selection for a specific architecture combination

CLI Template Behavior

  • Default behavior uses include_examples=True, so generator selects scenario.commerce_reference.
  • scenario.commerce_reference copies templates/scenarios/commerce_reference/lib/** into generated project lib/**.
  • --no-examples sets include_examples=False, so generator skips scenario.commerce_reference.

Example:

# Includes scenario.commerce_reference by default
fwen --project-name shop_app --org com.example

# Skips scenario.commerce_reference
fwen --project-name shop_app --org com.example --no-examples

Feature Generator

Use the feature generator script to add new features:

uv run python scripts/feature-dev.py <FeatureName>

Example:

uv run python scripts/feature-dev.py Auth

Creates:

  • lib/features/auth/domain/entities/auth_entity.dart
  • lib/features/auth/domain/repositories/auth_repository.dart
  • lib/features/auth/domain/usecases/get_auth_usecase.dart
  • lib/features/auth/data/models/auth_model.dart
  • lib/features/auth/data/repositories/auth_repository_impl.dart
  • lib/features/auth/presentation/pages/auth_page.dart
  • Updates lib/app/routes.dart with new route

Available Options

Category Options
State Management Bloc, Provider, Riverpod
Navigation GoRouter, AutoRoute, Navigator 2.0
DI GetIt, Provider, Riverpod
Platforms iOS, Android, Web, macOS, Windows, Linux
API Dio, Retrofit, Fetch
Persistence Shared Preferences, Hive, Isar
Analytics Firebase Analytics, Sentry, Mixpanel
CI/CD GitHub Actions, GitLab CI

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

License

MIT © calvingit


Made with ❤️ by the Flutter community

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers