What I learnt
Things I’ve learnt:
DESIGN EVOLUTION - Continue with Flutter, use Compose where possible.
Yeah so Flutter is definitely the way to go for now - we can migrate later if it’s really an issue later on.
DESIGN EVOLUTION - This is the new model. Actually. Please stay on track.
Mapping to Clean Architecture:
Presentation Layer:
- Maps to the app/ layer in Clean Architecture.
- Specifically, the pages/ and widgets/ directories.
Abstraction between Presentation and Logic:
- This is represented by the Controller and Presenter in the app/ layer. They define what actions can be taken based on user interactions but don’t dictate the exact logic.
Logic Layer:
- This is represented by the usecases/ in the domain/ layer. They orchestrate the flow of data and decide what actions to take based on user input and other conditions.
Abstraction between Logic and Data:
- This is represented by the abstract repositories/ in the domain/ layer. They define what data operations can be performed but don’t dictate how they’re executed.
Data Access Layer:
- This is represented by the data/ and device/ layers in Clean Architecture. They provide concrete implementations of the abstract repositories and define how data is accessed and manipulated.
Abstraction between Data Access and Database:
- In the context of Clean Architecture and your current setup, this abstraction is inherently handled by the Firestore SDK and the way you interact with it through your data/ layer.
Database:
- This is Firestore in your case. It’s the actual storage where your data resides.
Folder Structure - Please use this
my_flutter_app/
│
├── modules/
│ ├── auth/ <--- Authentication module
│ │ ├── lib/
│ │ │ ├── app/ <--- Presentation Layer for Auth
│ │ │ ├── domain/ <--- Logic Layer for Auth
│ │ │ ├── data/ <--- Data Access Layer for Auth
│ │ │ └── device/ <--- Device Layer for Auth (if needed)
│ │ ├── test/
│ │ └── pubspec.yaml
│ │
│ ├── profile/ <--- User Profile module
│ │ ├── lib/
│ │ │ ├── app/
│ │ │ ├── domain/
│ │ │ ├── data/
│ │ │ └── device/
│ │ ├── test/
│ │ └── pubspec.yaml
│ │
│ ├── ... <--- Other modules
│
├── shared/ <--- Shared utilities, widgets, and other common code
│ ├── lib/
│ └── pubspec.yaml
│
├── lib/
│ ├── main.dart <--- Main entry point that stitches modules together
│
├── pubspec.yaml <--- Main project dependencies and metadata
└── ...
Things I NEED to learn:
How the hell am I supposed to join up things I’ve grabbed from sample apps or example code?
That’s all well and great that I can see the capabilities but surely I’m supposed to use this to speed up development time?
Or is it merely a showcase of items of what can be done? Why are all the sample apps so basic?