Update README with project structure and Clean Architecture overview
This commit is contained in:
@@ -1,16 +1,46 @@
|
||||
# app
|
||||
# Project Structure
|
||||
|
||||
A new Flutter project.
|
||||
The project follows a **Clean Architecture inspired** structure with clear separation into **app**, **core**, and *
|
||||
*features**.
|
||||
|
||||
## Getting Started
|
||||
```text
|
||||
lib/
|
||||
app/ → app-wide modules (theme, router, DI, env)
|
||||
router.dart → global routing (go_router)
|
||||
theme.dart → app theme and styling
|
||||
di.dart → dependency injection (providers, locator)
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
core/ → shared, generic & stable components
|
||||
network/ → Dio client, interceptors
|
||||
storage/ → secure/local storage abstractions
|
||||
error/ → Failure, AppException, guards
|
||||
utils/ → formatters, validators, helpers
|
||||
result.dart → Either/Result type
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
features/
|
||||
inventory/
|
||||
data/
|
||||
models/ → DTOs (Json)
|
||||
sources/ → remote/local data sources
|
||||
repositories/ → implementations (InventoryRepositoryImpl)
|
||||
domain/
|
||||
entities/ → pure Dart objects (business entities)
|
||||
repositories/ → abstract definitions (InventoryRepository)
|
||||
usecases/ → business logic (AddItem, ScanBarcode, …)
|
||||
presentation/
|
||||
pages/
|
||||
inventory_page.dart
|
||||
add_item_page.dart
|
||||
controllers/ → state management (Riverpod/BLoC) & presenters
|
||||
widgets/ → feature-specific UI components
|
||||
inventory_routes.dart → go_router routes for this feature
|
||||
|
||||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||
budget/ → same structure as inventory
|
||||
expenses/ → same structure as inventory
|
||||
auth/ → same structure as inventory
|
||||
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
main.dart → application entry point
|
||||
```
|
||||
# Layered Flow
|
||||
|
||||
Data Source → Repository Impl → Repository Abstraction → UseCase → Controller → UI (Pages/Widgets)
|
||||
|
||||
Reference in New Issue
Block a user