kbkk / abitia Goto Github PK
View Code? Open in Web Editor NEWmodular monolith playground
modular monolith playground
I think that the t
variable is no longer on the zod object.
Right now errors are logged as error: {}
https://getpino.io/#/docs/api?id=serializers-object
https://github.com/pinojs/pino-std-serializers
Need to design a way to generate OpenAPI out of zod schemas
Cancelled: Even if Nest.js isn't perfect maintaing a set of abstractions over a more flexible framework like Fastify brings a lot of maintainability burden regarding DX, possible bugs, etc. I will pursue building on top of Nest.js and provide a set of good practices (to be established).
Original post:
So far Nest.js stands in the way of achieving a modular monolith application:
abitia/services/monolith/src/index.ts
Line 114 in 33b0572
async providers
which are a nightmare to maintain and leads to bad DX.
class-validator
and class-transformer
which are type unsafe by design, not maintained very well. Since I've had real nightmare stories with those, this project has replaced them with a custom solution built on top of zod
.Suggested solution:
None yet, needs research. Most probably a DI container like tsyringe
and build around a simple http framework.
Implement a service template using fastify and inversify.
Related PRs:
is leading the schema to have that error:
Structural error at components.schemas.LiveModel.required
should be an array of property names required within an object schema
Jump to line 2275
Needs design, top of the head action items:
Turns out these can he handled out of the box with OpenTelemetry. #26
Currently EventHandlers register themselves from constructor:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR! @nestjs/common@"^10.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @nestjs/common@"8.x" from @abitia/[email protected]
npm ERR! node_modules/@abitia/zod-dto
npm ERR! @abitia/zod-dto@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /home/apu/.npm/_logs/2023-07-08T06_49_17_010Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /home/apu/.npm/_logs/2023-07-08T06_49_17_010Z-debug-0.log
Hey, my team is currently using class-validator
which I'm not a fan of it at all :) With Nest.js which means we're pretty locked on classes being available in the runtime for Nest to be happy.
I try to find a way to migrate towards zod
for validation as much as I can, but the Swagger part is pretty useless for us as we're using GraphQL, so having Swagger imported even if we're not using it, is a bit wasteful.
To guarantee that Swagger stuff will never get into the runtime/compile-time no matter the setup, having it as a separate module will be nice.
Since you have rush.js
setup, I guess, it should be pretty straightforward to achieve :)
Afterthoughts, I guess, with GraphQL we will have to stick to class-validator
as, well, all GraphQL stuff is done using decorators, so we won't be going away from classes for DTOs/InputTypes/Models, but, anyway, having it separated is just a good thing anyway.
right now a faulty message breaks the whole app, the MikroOrmOutboxWorker should retry the message up to a specified amount of times
Main README:
Monolith README:
Core/
dirGeneral guides:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.