Next.js Discord

Discord Forum

Are there any best-practices for where/how to organize server actions?

Unanswered
Jumbo flying squid posted this in #help-forum
Open in Discord
Jumbo flying squidOP
for example putting them in /lib/actions or having a single directory like /app/actions that has them? In my case I'm starting to outgrow a specific actions file for each directory as log-in/log-out actions aren't following that paradigm.

4 Replies

Jumbo flying squidOP
Western paper wasp
You can do whatever you want - there’s not an explicit recommendation
This is just up to your opinion on how to structure your project
Jumbo flying squidOP
Right, but I'm looking for some examples of well organized & well though-out codebases, especially for a larger codebase where it doesn't make sense to have all of the actions together in a single file, and also doesn't make sense to have them separated into the app directory colocated with each page