layered-architecture

Featured

Best practices for VGV layered monorepo architecture in Flutter, covering the four layers Data, Repository, Business Logic, and Presentation, their unidirectional dependency rules, model transformation across layer boundaries, and app bootstrap wiring. Use when structuring a multi-package Flutter app, creating data or repository packages, defining layer boundaries, or wiring dependencies between packages through path dependencies in pubspec.yaml, barrel exports, and RepositoryProvider.

Data & Documents 161 stars 22 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
74
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Layered Architecture Layered monorepo architecture for Flutter apps — four layers organized as independent Dart packages with strict unidirectional dependencies. --- ## Core Standards Apply these standards to ALL layered architecture work: - **Four layers** — Data, Repository, Business Logic, Presentation — every feature spans exactly these four layers - **Unidirectional dependencies** — Presentation → Business Logic → Repository → Data — never skip or invert a layer - **Data and Repository layers live in `packages/`** — each is an independent Dart package with its own `pubspec.yaml` - **Business Logic and Presentation live in `lib/`** — organized by feature within the app - **Data layer packages contain zero domain/business logic** — they must be reusable in unrelated projects - **No inter-repository dependencies** — repositories never import other repositories - **No Flutter SDK in data or repository packages** — scaffold with the `very_good_cli` MCP server `create dart_package` tool - **One repository per domain** — `user_repository`, `weather_repository`, `auth_repository` - **Path dependencies for local packages** — never `git:` or pub version references for packages in the same repo - **Barrel exports at every package boundary** — `src/` is never imported directly by consumers - **Repositories accept data layer dependencies via constructor injection** — never instantiate clients internally - **App bootstrap wires all layers** — `main_<flavor>.dart` creates client...

Details

Author
VeryGoodOpenSource
Repository
VeryGoodOpenSource/vgv-ai-flutter-plugin
Created
6 months ago
Last Updated
yesterday
Language
Shell
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category