Hey everyone!
I am glad to announce that Marten 0.4 has been officially released!
TL;DR
Marten is a Crystal web framework that makes building web applications easy, productive, and fun. The latest 0.4 release of the framework introduces new and long-awaited features such as generators, facilitating the creation of abstractions and structures within projects while following best practices. Additionally, the release also introduces a plethora of advancements such multi-table inheritance, new schema handler callbacks, and the ability to define URL and slug fields in models and schemas. This update is a major step forward, making web development with Marten more user-friendly and feature-rich. You can check out the full changelog for a comprehensive overview of all the new features and changes included in this release. Last but not least, the 0.4 release is also accompanied by a RealWorld demo project to demonstrate a fully-fledged fullstack application built with the framework.
Main new features and highlights
- Generators - Marten now provides a generator mechanism that makes it easy to create various abstractions, files, and structures within an existing project. This feature is available through the use of the
gen
management command and facilitates the generation of key components such as models, schemas, emails, or applications. The authentication application can now also be added easily to existing projects through the use of generators. By leveraging generators, developers can improve their workflow and speed up the development of their Marten projects while following best practices. - Multi-table inheritance - It is now possible to define models that inherit from other concrete models (ie. non-abstract models). In this situation, each model can be used/queried individually and has its own associated database table. The framework automatically defines a set of โlinksโ between each model that uses multi table inheritance and its parent models in order to ensure that the relational structure and inheritance hierarchy are maintained.
- Schema handler callbacks - Handlers that inherit from the base schema handler or one of its subclasses can now define new kinds of callbacks that allow to easily manipulate the considered schema instance and to define logic to execute before the schema is validated or after (eg. when the schema validation is successful or failed).
- URL fields for models and schemas - Marten now provides the ability to define
url
fields in models and schemas. These fields allow you to easily persist valid URLs to the database but also to expect valid URLs in data validated through the use of schemas. - Slug fields for models and schemas - It is now possible to define
slug
fields in models and schemas. These fields allow you to easily persist valid slug values in your models and to require such values in schemas as well.
RealWorld application
The Marten 0.4 release is accompanied by a RealWorld demo project: Marten RealWorld. This project was created to demonstrate a fully-fledged fullstack application built with the framework, including CRUD operations, authentication, routing, pagination, and more.
Whatโs next?
The Marten framework is still young and Iโm actively seeking feedback from individuals interested in experimenting with it or utilizing it in their projects! If you find a bug or if you want to contribute and share ideas regarding the framework, donโt hesitate to open an issue/discussion in the projectโs issue tracker on GitHub or chat with us in our Discord. Any help will be greatly appreciated!
If you are new to Marten, here are a few ideas on how you can get started:
- Check out the Marten GitHub repository
- Check out the official documentation
- Ask for help or chat with the community in our Discord
Thanks for reading me!