https://serverless-stack.com/ logo
#help
Title
# help
t

T Indie

05/19/2022, 2:25 PM
Hi everyone and thanks for this amazing tool and community, just wondering if there exists a structured boilerplate with the best patterns for a Rest API with RDS (Postgres) that one can use as a reference. I already using the kysely-data-API ORM mentioned by @thdxr (https://serverless-stack.slack.com/archives/C01JG3B20RY/p1648520392937399?thread_ts=1648517936.338399&cid=C01JG3B20RY) My my main pain-points are how to make functions reusable, validations, mapping from underscore to camelcase for fields and reducing the amount of copy-paste I am doing for each route 😄 not to mention testings etc. Much thanks
t

thdxr

05/19/2022, 2:26 PM
hey we don't actually have anything this specific
my pattern is to have a
core
package that contains 90% of my code
and then
functions
which just call into core
if you watch my talk for the graphql stack I demonstrate this pattern

https://youtu.be/6FzLjpMYcu8?t=5176

you can just ignore the graphql parts and pretend they're route handlers
t

T Indie

05/19/2022, 5:05 PM
that's great Thanks 🙂 I will try to make an open-source one when I finish the project maybe it can be helpful 🙌