Does everything in the convex folder
Does everything in the convex folder need to be in the root folder? It feels cluttery for me
8 Replies
hi @niels ! nope, you can organize your code into subdirectories. here's an example
convex/
folder from AI town: https://github.com/a16z-infra/ai-town/tree/main/convexGitHub
ai-town/convex at main · a16z-infra/ai-town
A MIT-licensed, deployable starter kit for building and customizing your own version of AI town - a virtual town where AI characters live, chat and socialize. - a16z-infra/ai-town
ok cool
and what about the generated apis?

e.g. could you put this tasks.ts file somewhere else or not
All queries, mutations, and actions need to be defined somewhere in the
convex/
directory (but you can do a subdirectory like convex/queries/tasks.ts
and call it like api.queries.tasks.get
). Generated code will always live under convex/_generated
oh right so the path defines the generated methods
Yeah the type for
api
is generated based off of the file structure within convex
(which can be whatever you want)amazing, thanks!