Next.js Discord

Discord Forum

Features folder structure

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
I'm trying to implement the features folder structure in nextjs but I don't know if it's a great idea to do features/post/server/actions.ts (server actions) and features/post/server/queries.ts (only drizzle queries that we'll use in the server/actions.ts file)

Please can you tell me if it's a great way doing it, and also how you're doing it. Thank you!

2 Replies

Western paper wasp
A normal and common approach. The key is that server actions should call queries, not the other way around, and that the structure remains simple and understandable for the team
Transvaal lionOP
thanks for your help! @Western paper wasp