simonplend / egghead-build-a-modern-rest-api-in-node-js-with-fastify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code layars and codebase structure

fmenis opened this issue · comments

Hi Simon!
I'm really interested in the fastify course that you are building and I already have a request (if that's possibile).
Can you provide some examples of how structure a fastify server?
I know that fastify discourage the use of the MVC model, but all know that as soon as the application grows a little bit, not all code that serves a request can be placed inside the main route handler.
Also with fastify, ihmo, must be possible to structure the codebase in layers that have their own responsabilities (handling requests, execute business logic, etc).
I'm currently build my own fastify boilerplate and I'm struggling to find a good code structure.
If you can help (not only) me, It would be great.

Hey @fmenis. Thanks for opening this issue 😀 I'm heading off on holiday now, but I'll drop you a proper reply when I'm back next week!

Hi @simonplend!
I was on holiday too :D So, no problem.