|
Initially I started building this for my own projects. The main goal was to define a unified "blueprint" allowing me to develop multi-platform apps using the same code, without code generation. I wanted to be able to develop the same functionality on web, desktop, cli, server, mobile, whatever... I've been able to achieve this by relying on TypeScript, a 4-layer architecture (UseCase => App => Product => Target) and dependency injection. This mechanism allows me to use whatever tech stack I want, provided the good adapters are developed. For instance, I have pre-built ones : node express (server), next.js (server), node hono (server in alpha), node parseArgs (CLI), node stricli (CLI), react-web-pure (web with no CSS), react-native (mobile), node mcp server (anthropic MCP in alpha), etc. The same goes with data storage : Postgres, SQLite, a txt file, whatever. It also comes with auto testing and auto documentation. Did I reinvent the wheel ? Probably on some aspects.
Is it too much abstraction ? Probably as well. But I like the idea of modularity and portability. That's why it's not made for everyone, nor all types of projects. If you like testing new stuff, give it a try and feel free to ping me if needed, I'd love to help. I'm aware the documentation is not state of the art yet. I wanted to focus on the "Getting Started" Guide to give a quick overview instead of going to deeply into the details. Best, |
I feel like you could describe the abstractions you built in more detail. When I read the explanation for what the 'UseCase', 'App', 'Product' and 'Target' were, it wasn't clear how each of those translates to TypeScript. My guess is that 'UseCase' and 'App' would be like Classes, if you're modeling your program in an OOP way? The 'Product' seems like it would be the TypeScript project itself, with the package.json, source code and all of that.
I would rethink how you named the 'App' layer. The examples given ('auth', 'accounting', etc.) are not necessarily what I would call an 'app'.
As you introduce names and concepts for things in your library, I recommend trying to keep the cognitive load as low as possible. It seems like there are a very high amount of high-level concepts and implementation details like types, functions, etc. that 1. are specific/unique to libmodulor and 2. you need to learn before you can start actually building your application, from looking at the examples. The barrier to give it a try in a side project seems really high.
Building things is cool regardless :) I'm happy that you built something it's useful to you and that you got to share here.