Do you have any guidance for best practice to setting up routes, specifically;
_Route project/folder architecture:_ how to organise routes grouped by resource type under a 'routes' folder and best way to asynchronously load these into the app?
_Route schema:_ should a single generic schema be shared across routes of the same resource type, with properties which are only relevant to some of these routes. For example, routes that do expect a query string in the request and those that don't? Alternatively, is it better to pass a schema specific to each single route?
organize your application by logical plugins, your unit of distributions between files are plugins, and those can be nested indefinitely. having a specific folder for "routes" does not scale well for complexity, you should follow the features of your application more. I tend to have a folder/plugin for users, carts, products, etc... We will be providing an example for this structure.
your schema is the same if the data you are receiving/sending is the same. If it's different data it should be different schemas. JSON schema is very flexible and you can reuse some part of your schema between different routes.
@mcollina, point 1 sounds sensible - do you have an ETA for your example app and perhaps link to watch?
We are working on things at https://github.com/fastify/fastify-example-twitter
Most helpful comment
We are working on things at https://github.com/fastify/fastify-example-twitter