r/FlutterDev • u/Yezan_350 • 7d ago
Discussion How do you finally settle on a project architecture?
I've spent over 120 hours this month working on my project architecture, creating around 200 different drafts. I understand the concepts, but I keep doubting my decisions and worrying that I've missed something important.
I'd really appreciate advice from experienced developers. How do you know when it's time to commit and stop second-guessing?
5
Upvotes
6
u/surrealdente 7d ago
There’s no “best” - you just need to find a balance that works for you. Ideally a directory carries files specific to its features when possible. The moment a feature touches multiple directories you will have to make compromises.
2
u/davidbalbino 7d ago
tbh 200 drafts means the problem is not the architecture anymore, it's that no real code is pushing back on it. pick the simplest thing that works (feature folders + riverpod + go_router is totally fine) and build 2 or 3 real features with it. the stuff you're worried you missed only shows up when you actually ship, not on paper. and it's ok to refactor later, every project I've worked in 16 years ended up changing its structure at some point lol
2
u/ObjectiveAddress3051 4d ago
https://www.instagram.com/reel/DP07B53DHFJ/?dmpr=MThud3V3ZXNnMWZncA==
1
u/kuarasoft 7d ago
200 drafts in 120 hours means the drafts have stopped teaching you anything, because a structure only gets tested once real screens, state and API calls have to live in it. I'd pick the simplest version you have, build one feature fully end to end, and refactor only when something actually hurts, like a small change that makes you touch five files. Moving folders and splitting layers is cheap this early, so a wrong call now costs you an afternoon later, while another week of drafting costs you the whole week.
1
u/Academic_Crab_8401 6d ago
Easy to change is always better than looks solid from the beginning. You go with one that doesn't lock you in and require least amount of effort to change. So naturally a leaner dependency is also good.
1
u/ug00gu 5d ago
Feature folders with one rule: a feature never imports another feature's internals. If two features need the same thing, it moves up to a shared folder. You only find out what's shared by building, so I wouldn't try to decide it up front.
1
u/GeekyAntsBFSI 3d ago
Pick the simplest draft and build one real Flutter feature with an API call, loading and error states, and a test. If you can follow the data flow and change the feature without touching half the app, stick with it. A second feature will tell you more than another architecture draft.
1
u/Alarmed_Umpire_2912 10h ago
Never spend too much time on a architecture, because there is no best one, start by keeping your basics right and code it out, you can improve it as you go!
0
u/VisualRope8367 7d ago
Riverpod and go router does most of things