Hey alchemists ,
I’m a developer at a smaller consultancy agency located in Copenhagen, here we mainly build MVP projects for startups which typically takes within 2-3 months to develop. Because of the small develop time, we build a fair bunch of GraphQL APIs with Phoenix and Absinthe.
Sadly it also means that we do a lot of copy’n’paste every time we start on a new projects, as every project need users, some sort of oauth login, graphql schemas etc.
Writing boilerplate code is actually starting to take up a lot of development time, it’s also error prone, also not exactly stimulating our developers.
I want to make this process more efficient and i’ve come up with 2 solutions, I would love some feedback or new ideas.
- File generation
We build a project, that we add all our boilerplate code to. We could then run something like mix boilerplate.users.
+Fully transparent code
-A struggle to update already “boilerplated” projects
-Many generators depending on level of details
-Probably take longer to write, due to patching of files etc.
- Meta programming
We build a project, which contains macros for stuff like fields (boilerplate_user_fields()) graphql types etc.
+Easy to maintain, with future updates
+More fine grained control of boilerplate parts.
-Less transparent code
Would love to hear your thoughts, pro and cons, new ideas