r/react • • 10d ago

General Discussion Mocks to Component Diagram to Implementation

I have got mocks from my design team. I need to undertake the task of implementing the mocks. What's the usual way to plan things well? Can we create component diagram, data flow etc? My aim is mocks -> architecture diagrams -> commom components/data flow mapped -> stories/tasks

Are there any examples or references that I could look up?

2 Upvotes

5 comments sorted by

2

u/No_Lawyer1947 6d ago

dont overcomplicate it. I'd go feature by feature, and whether handcoding or ai coding, just organize it AS you go, don't try and figure out some component diagram first. Just get implementing straight away, otherwise the way you organize stuff will definitely change.

1

u/trickitycunt 6d ago

Thanks I am trying not to...but there are many features and finding it challenging to plan it well so everyone in the team can work independently plus parallely

2

u/No_Lawyer1947 6d ago

Fair enough. If you're working in a team, maybe making base components that are for sure going to be shared would work, standardizing the way errors will get handled, the way you guys organize API related code, libs, etc, but apart from that, have everyone work on a particular section of the flow, specifically like /rotues, eventually you'll find natural ways to split it. But initially you've gotta just go responsibility separated over feature sliced IMO.

1

u/trickitycunt 5d ago

Thanks a lot. Are there any good open source repos that you'd recommend to check for structure ? Preferably including mfe exposure

2

u/No_Lawyer1947 5d ago

I really don't know of any off the top of my head, but how many people are you working with? How big is this application exactly?

If it were me I normally use separate folders plus file based routing lib (comes w nextjs or you can just get tanstack router)

app/ all routing goes here, and I'd also colocate any components that are not shared

components/ui/ any primitive components like button.tsx etc
components/pages/ all pages that are routable AND reused would go here, if any component is literally only used say on a dashboard page, I won't bother placing it in ui folder. In nextjs you can also do colocated files too, to make it a tad easier

lib/ any internal working code like managing sessions, etc

lib/ reusable formatter functions

api/ all networking code, some people call it services but I feel as if this pattern gets confusing with Angular framework

I also like to use tanstack query to saving on fetch state code with use state hooks etc.