Coming from Java/C#/Scala and back into javascript world but now with typescript, I am a bit rusty in this world. Regardless, I bring a huge amount of experience across all the platforms I previously worked in when attacking any new language or framework. I chose typescript for 3 reasons
one language for server and frontend
it is more popular these days than languages like java so good for hiring
While javascript is great in the beginning, later on, many bugs get into production that a compiler would have caught (and we can break out and do javascript in an emergency)
I am starting to look into these areas
launch express.js directly serving up react avoiding CORS security risks (later, we can have the CDN serve react for download *.js file speed..... maybe............ I read about some problems but I do not believe that blog is correct)
DI that allows overrides of interfaces for testing later. most likely InversifyJS after looking into a bit (need to run a few quick test cases)
Dockerfile - simple production deployment (currently going to be using GCP cloud run)
ORM layer or something
database connection in GCP (a bit complex but once done, it is done and secure)
React client using server's APIs directly. Looks like we may be able to take any API and generate the http client that react will use (keeps dev dead simple for me and anyone that joins) with only 100-200 lines of code like I do in java. Also, future microservices can easily generate their clients given the API of another microservice.
Server implementing the API that client's use(in this case react currently). Looks like we may be able to take any API and generate the reverse(I call it scaffolding) - again, 100-200 lines of code and maps the http request back to the same exact method on the controller (using typescript reflection - well, I am hoping).
Logging wiring locally and GCP with MDC
Metrics/Monitoring - will not look into the first month but after that perhaps
As a workaround to inherit GREAT monitoring, we will CHEAT and everything will be a POST with unique url so we get every endpoint metric for free with no work. Otherwise, things like /user/{user} end up as N endpoints and you cannot see metrics on /user/*
Meeting 6 and 7 keeps controllers and API's in-sync and we would have a few APIs/controllers. The benefits here are
server/client do not compile when someone messes with the API incorrectly this way
Adding new endpoints was extremely quick -> simply add a new method to interface and implement on server controller (as you will get compile error that controller is not implementing that method)
Also, this significantly sped up architectural pivots in Orderly Health
led to extremely clean test contract boundaries
Comments