First, need to refactor existing directory to match this architecture:
blog-api
-src
-- app.ts
-- server.ts
-- plugins
--- database.ts
-- features
--- posts
----index.ts
---- controllers
----- ...files for controllers
---- models (types are how they are defined in fastify)
----- ...files for ORM models
---- routes
----- ...files for post routes
---- services
----- ...files for services
---- schemas
----- ...files for validation
First, need to refactor existing directory to match this architecture:
blog-api -src -- app.ts -- server.ts -- plugins --- database.ts -- features --- posts ----index.ts ---- controllers ----- ...files for controllers ---- models (types are how they are defined in fastify) ----- ...files for ORM models ---- routes ----- ...files for post routes ---- services ----- ...files for services ---- schemas ----- ...files for validation