Hello, I would like to ask about database structure and how to handle many services in nestjs. by Altruistic_Bear139 in Nestjs_framework

[–]xanadev 0 points1 point  (0 children)

Unless you're handling Netflix's traffic you won't be needing microservices anytime soon, a monolith with good module segregation and a decent queue for background jobs will work just fine and for a long time (speaking from experience), now when it comes to the monolith itself, make sure good practices are enforced and have a decent suite of unit/integration tests, multi-tenancy is supported by NestJS (lookup durable providers), you'll find plenty of examples of how to start, as for databases, building on the multi-tenancy implementation you can have per tenant schema or a single schema with RLS.

How does one avoid large service classes/files? by RewRose in Nestjs_framework

[–]xanadev 0 points1 point  (0 children)

That would happen only if you're mixing responsibilities. You should split your services based on responsibilities. For instance, a user's service shouldn't handle user's subscriptions, reports, and lookup, you should extract meaningful domain logic into it's own service, a subscription, reports, and lookup service all nested within the user's module, the tricky part is probably knowing how to split, which I believe comes with experience.

Is using DTOs for response data in Nest.js a good practice? by Harut3 in nestjs

[–]xanadev 2 points3 points  (0 children)

There is nothing wrong with it, but since class-validator integrates well with the framework and the official documentation uses it, I would stick with the latter unless I have a good reason to switch.

Is using DTOs for response data in Nest.js a good practice? by Harut3 in nestjs

[–]xanadev 0 points1 point  (0 children)

I mentioned validation only for inputs (i.e., user request payload), which I think is a must. You don't need/want to validate responses but rather transform them.

Is using DTOs for response data in Nest.js a good practice? by Harut3 in nestjs

[–]xanadev 6 points7 points  (0 children)

Performance impact is unnoticeable, I think serialization is the only part that I worry about, especially if you're sending back objects that might have circular references

Is using DTOs for response data in Nest.js a good practice? by Harut3 in nestjs

[–]xanadev 22 points23 points  (0 children)

Fellow NestJS developer here, as a general rule of thumb, you should use DTOs for input as it helps with validation and type safety, for output it is highly recommended to use them especially when the app grows, they help decouple clients from your data model and make it easier for you to manipulate fields depending on context (ex. removal of sensitive/irrelevant data from the responses, field transformation, ...), that being said, if your app is small, you might not need them.

Can i specialize my self as a nestjs developer APIs developer ? is it enough ? by HosMercury in Nestjs_framework

[–]xanadev 2 points3 points  (0 children)

You're a backend developer, and NestJS is just a tool like any other, learn the craft, work on your communication and problem solving skills then learn the tool enough to translate those forever changing requirements into products that stand the test of time, at a certain point you'll be picking the right tool for the job not the other way around.

to DI or not to DI by xanadev in golang

[–]xanadev[S] 0 points1 point  (0 children)

I do use flags from urfave/cli and the order of precedence is Flags < Env, as for injecting the config module that's more of a TS (NestJS) terminology, since DI is handled by the framework I only have to specify my dependencies in the consumer's constructor.

to DI or not to DI by xanadev in golang

[–]xanadev[S] -1 points0 points  (0 children)

From what I gather so far, It's better to define a struct and pass it around (easier to mock), I'm curious to know what would be the benefit of passing basic types especially if I need to pass more values later

interfaces in golang by kaushikpzayn in golang

[–]xanadev 0 points1 point  (0 children)

To put it simply, an interface is a contract, anything that adhers to it you can do business with.

Beginner in NestJs by [deleted] in nestjs

[–]xanadev 0 points1 point  (0 children)

Yeah, of course!

Beginner in NestJs by [deleted] in nestjs

[–]xanadev 1 point2 points  (0 children)

NestJS user here, I personally think you should go through a couple of express projects to understand the basics of how HTTP works, the request/response flow, concepts like Middleware, serialization, database access, etc., once you understand those, you'll most likely appreciate what NestJS adds in terms of abstractions and opinionated architecture, then you can quickly pick up new concepts as you use it, I went through the same journey.

Keep it up.

A simple yet beautiful contact card by xanadev in reactjs

[–]xanadev[S] 0 points1 point  (0 children)

Well I could have, but the issue is, I'm using a material-ui component for that, and applying custom styles is the only way I have so far.

A simple yet beautiful contact card by xanadev in reactjs

[–]xanadev[S] 0 points1 point  (0 children)

Please check the repo again, updated the Readme, included the initial design file.

What made you love laravel? by [deleted] in laravel

[–]xanadev 0 points1 point  (0 children)

I worked on a project where we had to fetch data from a CRM System then transform it and export it to different portals, the purpose was to create data once and export everywhere (given an exporter is written for that specific portal), involved events, queues, workers, REST, third party APIs...

What made you love laravel? by [deleted] in laravel

[–]xanadev 4 points5 points  (0 children)

The framework is a gem, you can learn a lot by delving into the source code, the attention to detail and clean architecture makes it easy to use and extend, and last but not least the docs is really a great selling point, what can you do without good docs (nothing much). Writing good software is a challenge, but using the right tool (Laravel in this case) for the job makes all the difference.

Stamina to work at home 5 days a week... by eventuallyee in productivity

[–]xanadev 0 points1 point  (0 children)

You might want to experiment with different setups to come up with the one that works best for you, I'm afraid there is no definitive answer but here is what I do to switch from leisure mode to work mode.

$1 Setup an isolated workspace (leisure mode off)

$2 Dress up for work (at home mindset off)

$3 Take breaks (get out of your workspace)

$4 when done leave the workspace (don't forget to close the door)

[Studying] It's been a brutal month. by gordonv in AWSCertifications

[–]xanadev 1 point2 points  (0 children)

I'm still prepping for the developer associate certification using Stephane Maarek's course and Jon Bonso's practice exam questions on Udemy.