Skip to main content

Week 2

Milestones

  • Decide what parts of templater should be moved to doc-gen and how
  • Define approaches to move the code

Approach

Create a new Service in Templater called RenderService

  • Render Service will be responsible for rendering the templates and will be used by Doc-Gen.
  • Currently the templateService is injected into the templateController which we were previously using to render the templates by calling them as API's in Doc-Gen.
  • Move all the template related code from prior templateController to RenderService.
  • RenderService should be independent of the templateController and should be able to render the templates without the need of calling them as API's so that it can be used as a library by Doc-Gen.

Conclusion

Using the above approach we can move the template related code from Templater to Doc-Gen and make it independent of PrismaService. Thereby making it easier for Doc-Gen to use Templater as a library, by simply injecting the RenderService into Doc-Gen's RenderController and using it to render the templates.

Next Steps

  • Implement the above approach and create a PR for the same