Update: Part 5 is out!
About Me: I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at Better Coding Academy, and as part of what I do, I post videos on our YouTube channel at https://www.youtube.com/c/BetterCodingAcademy.
(Subscribe for awesome web development content!)
This is part 4 in a full tutorial on how to set up a React/Node.js app with a microservices architecture. (Here's part 3!)
In this video, I hook up the Listings and Users microservices to the GraphQL-powered API gateway, in preparation for use within the React app.
I hope you enjoy!
Happy coding!
Full source code: https://github.com/parkroolucas/microservices-demo
Top comments (18)
You've made yourself look like a twat, congratulations.
If your first reaction, to somebody creating a learning resource, is to put them down you should just stay quiet.
I notice your history shows one comment, and zero submissions of helpful articles, so sit down and shut up.
Yeah I notice a bunch of accounts like that lately with a snarky sock puppet stack overflow vibe. Huh.
Hi Mahen, thanks for your feedback! Let me try and answer this best I can:
As far as I know (and I'm willing to admit I might be wrong here), Express does not provide a better way to handle errors raised in asynchronous operations - see the Express docs on error handling for more information on this. Notice that it says:
If the try...catch block were omitted, Express would not catch the error since it is not part of the synchronous handler code.
Correct. I stated in the video (not sure which one lol but at least one of them in the series :P) that I took and will take quite a few shortcuts in order to best showcase microservices in this video series and not add too much fluff. I personally use Joi for validation with a custom middleware, but that's not something I felt was necessary to showcase microservices within this video.
I don't see any need to put the business logic elsewhere. The Users and Listings microservices are designed as simple REST wrappers on top of a database, so I would argue that this sort of design is not only intentional but optimal.
Hope this helps!
I don't mean to be that guy. But, wouldn't you expect anyone writing an article on how to do something to be a professional?
Definitely not. I blogged a lot when I was just starting out in development.
That's kind of the point I'm making here.
A lot of people blog for themselves, as a way of cementing their understanding, and plenty of beginners relate to those types of articles as they are naturally not overly technical.
If any junior asks me what they can do, I always suggest blogging.
I know and understand why they do it. But what I've been noticing over the years is a groundswell of bad practice, misunderstanding and issues that stem from the prevalence and dominance of articles written by novices for novices. It's starting to get to the point where it does more harm than good.
I'm one of those who are guilty of both but have a few years under me and continue to blog! We all start somewhere and I'm really happy when the community corrects me. Unfortunately without ongoing mentorship between short jobs and no school I don't have the direction on right or wrong, and reading and chatting on the internet is the substitute. I think like anything, a range of sources are important in self study, and being humble and ready to acknowledge errors in thinking is super important.
I understand the point you're trying to make Stephen, but at the same time I'd never advocate learning solely through blogs.
My point of view is blogging is informal, and isn't designed to "teach" people everything. Naturally, a blog post focuses of something very specific.
Readers should read posts, and will probably learn something from them, but I'd always recommend for people to read from official sources afterwards.
That seems really cool! Thanks for your advice, will consider that in the future :)
Good thing my name is Lucas then!
The experience of being told to shut up or think of the best question/answer on coding forums is entirely formative to my initial impression of tech being full of autodidactic genius-level, emotionally stunted and snobby people programming alone in caves and also partly why it took 2 years for me to decide to switch into tech π.
It wasn't until I discovered different communities that I didn't feel this way and have come to understand that to be one school of (rather toxic) thought.
I'd ignore him, his history shows he has contributed nothing helpful so probably just jealous.
Carry on creating stuff!
Will it cover multiple react apps? And topics like a code splitting etc?
I'm not a guy π
Unfortunately, with the growth of Dev, it is going to attract certain people who are simply toxic to the culture and only want to troll instead of actually contributing.
I wonder if @ben has any thoughts on how to combat this behaviour?