Avifors
A Model-Driven Engineering tool that generates code from a YAML definition of your app domain model.
Motivation / Objectives
I want the domain model of my application to be simple to understand. To achieve this goal, I want it to be written in a declarative way, and the actual code generated consistently. I also don't want to use an heavy software like Rational Rose to create it, I want it to be included as code in my project.
When Avifors will be stable I'd like to develop libraries allowing to make more complex work based on standards, like generating a full REST API with filtering, pagination, hypermedia links... with only the resources definition. I also plan to write a tool to visualize the model, like in an UML software, if it appears to be relevant.
Here are examples of what is possible to do with Avifors:
- Generate the domain part of an application source code
- Generate code from the model in different languages to share it between frontend/backend or between microservices
- Generate a full REST / GraphQL API
- Or simply simplify a repetitive part of your code by generating it from a single template
How to use it
- Define you app domain model declaratively using YAML
- Define generators to make sense of the model and Nunjucks templates to generate code from it
avifors generate
: your code is generated ✨
Features
- Can be used to generate code in any language - your domain model becomes independent of your app language
- Use builders and constructors functions to ease the model definition
- Use validators to avoid wrong definitions in the model
- Query the model to answer most questions (even complex ones) you could have about the model using Avifors queries
- Use the plugins system to extend Avifors: add Nunjucks global variables, create your own validators, builders, types or even commands 🚀
Installation
You can install Avifors using Yarn or npm:
yarn global add avifors# or npm install -g avifors
Documentation
- Getting started
- Define lists of items
- Use automatic generators
- Use constructors
- Types, validators and builders
- Query the model
- Print generators interfaces
- Avifors plugins
- Nunjucks templates environment
Contributions
Contributions are welcome 🙏
Though the codebase is not complex, I've added this file to describe the files structure of Avifors, to make life easier to newcomers.