For the past few months, I’ve been quietly working on a complete overhaul of the Gland framework, a project close to my heart. This new version, Gland v2, represents not just a technical upgrade but a reevaluation of what a Node.js backend framework can be simple yet powerful, flexible yet structured. While the original version served as a learning ground, this rewrite aims to refine ideas, borrow inspiration from established ecosystems like NestJS, and carve out a distinct identity for Gland.
Why a Rewrite?
The decision to rebuild Gland from scratch came from a desire to create something more maintainable, both for myself as a solo developer and for anyone who might use it. The goal is to strike a balance between familiarity and innovation. Gland v2 isn’t trying to compete with existing frameworks but rather to offer a cohesive set of tools that prioritize readability, modularity, and developer comfort.
For this version, I have drawn inspiration from NestJS, a popular Node.js framework known for its modular architecture and robust APIs. While Gland will not replicate NestJS, it incorporates some of its best concepts, adapting them to suit the specific goals and vision of the project. The structure and APIs in Gland are designed to provide developers with powerful yet intuitive tools for building backend applications with Node.js.
The exact features and APIs of Gland v2 are still evolving as development progresses, but a few foundational elements have already been confirmed. The framework will consist of five key packages, each tailored for specific purposes:
- @gland/core: This is the heart of the framework, handling essential functionality such as lifecycle management, routing, middleware, and module-based architecture. It is designed to provide developers with a solid foundation for building scalable applications.
- @gland/validation: This package focuses on data validation, offering a clean and simple way to define and enforce validation rules for user input, query parameters, headers, and more.
- @gland/metadata: Metadata plays a crucial role in the framework's internals, enabling decorators, dynamic configuration, and enhanced flexibility.
- @gland/common: A package for shared constants, interfaces, enums, and other reusable components that can be used across different parts of the application.
- @gland/events: A robust event system designed to handle custom hooks and events for seamless communication and extensibility within the framework.
One of the most exciting aspects of Gland v2 is its flexibility. Much like NestJS, Gland will support adapters for popular HTTP servers such as Express and Fastify. This means developers can choose the underlying technology that best suits their needs while benefiting from Gland's powerful features. However, the implementation of this feature is still under consideration, and I am exploring the best way to achieve it without compromising simplicity or performance.
I welcome any suggestions, feature requests, or feedback from the community. You can share your ideas by opening an issue on the project's GitHub repository. Together, we can make Gland a valuable tool for developers building backend applications with Node.js.
What’s Next?
The road to Gland v2 is still unfolding. Some questions remain unanswered: How will the configuration system work? What conventions will govern project structure? How can we make the framework lightweight without sacrificing essential features? These are problems I’m actively thinking through, and I welcome anyone interested to join the conversation.
You can follow the project's progress or contribute your ideas by visiting the GitHub repository at https://github.com/medishen/gland. I look forward to hearing your thoughts and feedback as I continue working towards the release of Gland v2.
Top comments (0)