I wanted to take a few moments to introduce a shard I’ve been working on for quite some time:
Marten is a Crystal web framework that makes building web applications easy, productive, and fun. You can read more about it in the dedicated documentation.
What is it?
Marten is a Crystal Web framework that enables pragmatic development and rapid prototyping. It provides a consistent and extensible set of tools that developers can leverage to build web applications without reinventing the wheel. As it stands, Marten focuses on the following aspects:
- Full featured: Marten adheres to the “batteries included” philosopy. Out of the box, it provides the tools and features that are commonly required by web applications: ORM, migrations, translations, templating engine, sessions, etc.
- Extensible: Marten gives developers the ability to contribute extra functionalities to the framework easily. Things like custom model field implementations, new route parameter types, session stores, etc… can be registered to the framework easily.
- App-oriented: Marten allows to separate projects into a set of logical “apps”. These apps can also be extracted in order to contribute features and behaviours to other Marten projects. The goal here is to allow the creation of a powerful apps ecosystem over time.
How does it differ from existing frameworks?
My goal here is not to draw a direct comparison with other existing frameworks. I simply want to highlight a few key things that (I believe) Marten is bringing to the table and that differ from what has been encountered in the Crystal world so far:
- Auto-generated migrations: Marten’s visions when it comes to models is that everything needed to understand a model should be defined within the model itself. In this light Marten’s models drive tables (and not the reverse way around) and migrations are generated automatically from model definitions. Migrations can still be written manually using a convenient DSL if necessary, but the idea is that defining a model and its fields is all that is necessary in order to have a corresponding table taken care of automatically by the framework
- App ecosystem: Marten provides an “app” mechanism that allows to separate a project into a set of logical and reusable components. Each app can contribute specific abstractions and features to a project (eg. models and migrations, templates, HTTP handlers and routes, etc). Another interesting benefit of apps is that they can be extracted and distributed as external shards: the goal behind that is to encourage the creation of a rich apps ecosystem over time and to allow projects to build features by installing and leveraging existing apps
The framework is certainly not feature complete (nor necessarily stable) but it can already be used for relatively simple web applications. I am looking for feedback from people who would like to play with the framework and / or leverage it in simple projects.
If you find a bug, don’t hesitate to open an issue into the project’s issue tracker on GitHub. Any help will be greatly appreciated!
Thanks for reading me!