/express-ts-wysiwyg-api

A little API designed to learn how to deal with wysiwyg data.

Primary LanguageTypeScript

About the project

This project is inteded to be somehow "small", since it works as proof of concept that will allow me to understand how store and retrieve wysiwyg data while implementing interesting practices regarding the use of decorators, DI containers, etc.

Motivation

I've been trying to learn how to "optimize" the structure of my express projects for a quile a while now, in order to apply interesting concepts like DI (dependency injection), different design patterns and other practices that may bring an interesting level of abstraction to the overall express ecosystem.

On the otherhand, I also wanted to play around with some interesting technologies that I haven't been able to use on my day-to-day basis. When it comes to the backend some of those technologies are:

  • Prisma: Prisma is kinda the new kid on the block when it comes to ORMs in the JS ecosystem. However, its abstractions are really interesting and its whole functionality (from queries, to migrations, and mapping) reminds of solid ORMs like Ecto (Elixir) and Eloquent (PHP).
  • reflect-metadata: I've briefly worked with reflection before (mostly on C#) and I didn't thought I would find a cool use case for it on TS, until I started to dig into decorators. I've been working with Flask for almost 8 months by now, and along that time I learned how to create decorators and decorator factories in order to easily extend the functionality of my controllers, so I said to myself "I should try to do the same on TS". After some research, I noticed that reflect-metadata could be usefull, so I decided to give it a shot.
  • typedi: While learning about reflect-metadata I discovered typedi, a DI container that's pretty dynamic when it comes to resolving type requirements. It kinda reminded me of Autofac (.Net) and that's the main reason why it caught my eye.

I've learned a lot until now, so I really hope that anyone that may find this repo also learns a thing or two C;