Skip to content

Commit

Permalink
update docs (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
henriqueleite42 authored Oct 29, 2024
1 parent b22ac93 commit 9f7d77a
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 198 deletions.
52 changes: 12 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,26 @@

# Anvil

Anvil is like OpenAPI schemas for microservices, but instead of only documenting your http routes, it helps you to manage most of the aspects of all your microservices at a global scale. It's created to medium~big companies and suffer on delivering things with velocity and consistency.
Anvil is a boilerplate generator for APIs. It focuses on unifying all the parts of your API in one single source of truth and allowing you to change architectures, frameworks, and libraries with minimum effort.

It follows an _schema-first_ approach, of instead of writing your code first, you write an schema, and it generates most of the code for you, all that parts that are repetitive and doesn't influence in the performance, while letting you have 100% control of the part that matters: the business logic.
It follows a _schema-first_ approach, instead of writing your code first, you write a schema, and it generates most of the code for you, all the parts that are repetitive and don't influence the performance, while letting you have 100% control of the part that matters: the business logic.

The schema is designed for **Event-Oriented, Domain-Driven, Decoupled MicroServices, with a Delivery-Usecase-Repository architecture and SQL Databases**. It still can be used for monoliths and other types of architectures, but we don't maintain the schema to be extremely flexible and a silver bullet for all the projects. Or goal here **IS NOT** to allow creativity, is to have a way to create scalable, secure and maintainable applications.

## How Anvil can help you

- Documentation tool:
- Were data is used across your whole system and projects
- If data is confidential / has any legal protection
- Which services and domains depends on each other
- Which events and routes does a service has, so you can subscribe to them without having to communicate with the owner team, making process faster
- Code generation tool:
- Define your own project pattern and generate projects on your own way
- Ensure that developers follow a specific pattern
- Keep dependencies updated across all your projects
- Ensure that best practices / your practices are begin followed
- Automatic integrate observability tools, logging, anything you want, on your projects, by default
- Ensure standards on variable names, event names and patterns, folder structure and project architecture
- Refactoring tool:
- Want to refactor an old project in a new language / pattern? Use the same schema, a different generator, and you only have to copy-paste / do small adjusts on the business logic. Decrease the refactoring time by an immensurable amount of time.
- Test the same project on different languages and architectures, to see which one is the best. Use one schema, different generators, and generate the same API in multiple languages in a fraction of the time that it would took.

Anvil allows you to write once, document and generate everywhere. Once that you have your schema defined, a lot of doors opens to you.

## What INS'T Anvil

- Something to control/create/update your infrastructure like CloudFormation, Terraform or Serverless Framework
- A framework to magically implement things under the hood, hide complexity and make you dependent on it
- Something to guide exactly how you should implement your code, your architecture, your folder structure, and so on
- A message bus to help you send and receive events
It can be used for both micro-services and monoliths.

## Why use Anvil

**TL;DR**
Anvil will help you to:
- Need less developers to accomplish the same (probably even best) results
- Decrease the amount of time that it takes to create new products and features, without having to compromise the quality and security of the software
- Better divide the responsibilities of your team, to get the best that they can offer and not needing so many experienced developers to create amazing products

In large organizations, we usually have hundreds or even thousands of micro-services, teams, events, packages and team members changing teams in a daily basis. It's very hard and demanding to maintain everything, to share these knowledge of the best practices, to ensure that all developers not only know how to implement certain patterns but know the way that the company implements certain patterns.

Anvil is created for these kind of ecosystems. It allows you to have one centralized small team of extremely capable developers that say how the things will work, define rules, best practices, standard libraries, and everything else that you need or want to defined, and all the other teams and members of your organization will follow these rules and patterns.
- Document you code, APIs and database with almost no effort

## How Anvil does these things?

Anvil by itself:
- _Schema-first_ approaches help you to visualize the current state of your system in a very easy and fast way: Instead of having to understand code, the project pattern, searching in a bunch of files, go directly to the ONE file definition anf figure it out right away.
- _Schema-first_ approaches help you to visualize the current state of your system in a very easy and fast way: Instead of having to understand code, the project pattern, searching in a bunch of files, go directly to the ONE file definition and figure it out right away.
- Instead of trying to reinvent the wheel, you can follow a standardized architecture that is scalable, clean, flexible, follows the best practices and allows the work to be divided in multiple steps that can be executed in parallel
- Standardize all you micro-services to follow the exact same patterns for EVERYTHING, decreasing a lot the learning curve and the effort necessary to maintain them
- Standardize all you domains / services to follow the exact same patterns for EVERYTHING, decreasing a lot the learning curve and the effort necessary to maintain them
- Allows tracking and usage of confidential and private data, like user's emails, to complain with regulations

Anvil generators:
Expand All @@ -63,10 +32,13 @@ Anvil generators:
- Generate database migrations and automatically handle them, begin able to easily see the current state of your database by looking at the schema file
- Generate standardized clients for your APIs, with automatically generate `CHANGELOG.md`s that follows [SemVer](https://semver.org)
- You are not stuck to Anvil. It's not a framework, it generates code that you have 100% control of. If you don't want to use Anvil anymore, it will have no impact on your systems.

Anvil plugins:
- Integration with other tools like Jira, Linear, Slack or your own custom system to send notifications / perform tasks
- Easy to change things at a global scale: Do not get stuck into a language, framework or architecture anymore, if you want to change it one day, it will be 100x times easier and faster.
- Run them in the pipeline to automatically update things without the need of a developer

Anvil platform (coming soon):
- Easily visualize your database and documentations
- Automatically notify all the teams dependent on your API about updates
- Integration with other tools like Jira and Linear, to automatically create tasks when the schema changes

## F.A.Q.

Expand Down
10 changes: 9 additions & 1 deletion docs/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,20 @@ No. We are very clear that Anvil is focused on **Event-Oriented, Domain-Driven,

## Can Anvil be used for monoliths?

Sure, it probably will work great with monoliths too, since they kinda are "big micro-services", we don't guarantee that it will be perfect, but for sure it will help.
Sure, it works great for both monoliths and micro-services, you only need to find the right generator.

## Can Anvil be used with NoSql databases?

You kinda can if you have the right plugin, but the schema is not and will not be designed for the specific needs that a NoSql database have. If you want to use a NoSql database as a SQL database, Anvil will probably fit your needs.

## Can Anvil be used in a large organization?

Yes, large organizations are the ones that most benefit from Anvil.

In large organizations, we usually have hundreds or even thousands of domains, micro-services, teams, events, packages and changes in the code in a daily basis. It's very hard and demanding to maintain everything, to share these knowledge of the best practices, to ensure that all developers not only know how to implement certain patterns but know the way that the company implements certain patterns.

Anvil works perfectly for these kind of ecosystems. It allows you to have one centralized small team of extremely capable developers that say how the things will work, define rules, best practices, standard libraries, and everything else that you need or want to defined, and all the other teams and members of your organization will follow these rules and patterns.

## Why does Anvil hates creativity, free thinking and innovation?

We don't hate it, but the main goal of any company is to serve their clients well, and all things that doesn't reach of this goal is a waste of time and money.
Expand Down
4 changes: 0 additions & 4 deletions docs/docs/generators/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ Generators are CLIs that generate things.

These things can be code, schemas, migrations, anything you want.

They should not be used to perform side-actions, like create tasks on Jira, or do things that aren't related to generate things: Your generator MUST have an output.

To do side actions use [plugins](../plugins/introduction.md).

## Do I need to use a specific language to create?

No, you can use any programming language that you want, you just need to make it executable by the final user.
Expand Down
24 changes: 7 additions & 17 deletions docs/docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ Anvil has 5 main parts, each one responsible for a specific complementary role.

## `*.anv` files

The schema definition is a `.anv` file that describes a domain of your service. Each project (micro-service) can have multiple domains in it, and they can be related or not (ideally, if they are in the same project, they should be).
The schema definition is a `*.anv` file that describes a domain of your project. Each project can have multiple domains in it, and they can be related or not.

Think about the `.anv` files like a `schemas.prisma` or an OpenApi spec, and from this we generate an infinity of things.
Think about the `.anv` files like a `schemas.prisma` or an OpenApi spec, and from this, we generate a variety of things.

## `.anvilconfig`
## `anvil.yaml`

`.anvilconfig` is the configuration file for Anvil, where you put information like the plugins that you are using, the things that you want to generate, and any other configuration that Anvil CLI or the plugins may need.

It is written in [INI](https://en.wikipedia.org/wiki/INI_file).
`anvil.yaml` is the configuration file for Anvil, where you put the paths for the schemas and configure the generators that you are using.

## CLI

Expand All @@ -26,17 +24,9 @@ It's designed to work with CI/CD too 🙌

## Generators

Generators allows you to generate code based on a `.anv` config. They come in various shapes and sizes, and can be used for practically anything:
- Generate an microservice with a specific code pattern, that uses a specific set of libraries
Generators allow you to generate code based on a `*.anv` config. They come in various shapes and sizes, and can be used for practically anything:
- Generate a project with a specific code pattern, that uses a specific set of libraries
- Generate e2e tests
- Generate changelogs

Generator are were the magic oh Anvil happens.

## Plugins

Plugins do side-effects with Anvil, like:
- Create tasks in Jira based on the changes of the schemas.
- Notify breaking changes to dependent projects

Very useful for Agile environments.
Generators are were the magic of Anvil happens.
64 changes: 24 additions & 40 deletions docs/docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,26 @@ sidebar_position: 1

# Introduction

Anvil is like OpenAPI schemas for microservices, but instead of only documenting your http routes, it helps you to manage most of the aspects of all your microservices at a global scale. It's created to medium~big companies and suffer on delivering things with velocity and consistency.
Anvil is a boilerplate generator for APIs. It focuses on unifying all the parts of your API in one single source of truth and allowing you to change architectures, frameworks, and libraries with minimum effort.

It follows an _schema-first_ approach, of instead of writing your code first, you write an schema, and it generates most of the code for you, all that parts that are repetitive and doesn't influence in the performance, while letting you have 100% control of the part that matters: the business logic.
It follows a _schema-first_ approach, instead of writing your code first, you write a schema, and it generates most of the code for you, all the parts that are repetitive and don't influence the performance, while letting you have 100% control of the part that matters: the business logic.

The schema is designed for **Event-Oriented, Domain-Driven, Decoupled MicroServices, with a Delivery-Usecase-Repository architecture and SQL Databases**. It still can be used for monoliths and other types of architectures, but we don't maintain the schema to be extremely flexible and a silver bullet for all the projects. Or goal here **IS NOT** to allow creativity, is to have a way to create scalable, secure and maintainable applications.

## How Anvil can help you

- Documentation tool:
- Were data is used across your whole system and projects
- If data is confidential / has any legal protection
- Which services and domains depends on each other
- Which events and routes does a service has, so you can subscribe to them without having to communicate with the owner team, making process faster
- Code generation tool:
- Define your own project pattern and generate projects on your own way
- Ensure that developers follow a specific pattern
- Keep dependencies updated across all your projects
- Ensure that best practices / your practices are begin followed
- Automatic integrate observability tools, logging, anything you want, on your projects, by default
- Ensure standards on variable names, event names and patterns, folder structure and project architecture
- Refactoring tool:
- Want to refactor an old project in a new language / pattern? Use the same schema, a different generator, and you only have to copy-paste / do small adjusts on the business logic. Decrease the refactoring time by an immensurable amount of time.
- Test the same project on different languages and architectures, to see which one is the best. Use one schema, different generators, and generate the same API in multiple languages in a fraction of the time that it would took.

Anvil allows you to write once, document and generate everywhere. Once that you have your schema defined, a lot of doors opens to you.

## What INS'T Anvil

- Something to control/create/update your infrastructure like CloudFormation, Terraform or Serverless Framework
- A framework to magically implement things under the hood, hide complexity and make you dependent on it
- Something to guide exactly how you should implement your code, your architecture, your folder structure, and so on
- A message bus to help you send and receive events
It can be used for both micro-services and monoliths.

## Why use Anvil

**TL;DR**
Anvil will help you to:
- Need less developers to accomplish the same (probably even best) results
- Decrease the amount of time that it takes to create new products and features, without having to compromise the quality and security of the software
- Better divide the responsibilities of your team, to get the best that they can offer and not needing so many experienced developers to create amazing products

In large organizations, we usually have hundreds or even thousands of micro-services, teams, events, packages and team members changing teams in a daily basis. It's very hard and demanding to maintain everything, to share these knowledge of the best practices, to ensure that all developers not only know how to implement certain patterns but know the way that the company implements certain patterns.

Anvil is created for these kind of ecosystems. It allows you to have one centralized small team of extremely capable developers that say how the things will work, define rules, best practices, standard libraries, and everything else that you need or want to defined, and all the other teams and members of your organization will follow these rules and patterns.
- Document you code, APIs and database with almost no effort

## How Anvil does these things?

Anvil by itself:
- _Schema-first_ approaches help you to visualize the current state of your system in a very easy and fast way: Instead of having to understand code, the project pattern, searching in a bunch of files, go directly to the ONE file definition anf figure it out right away.
- _Schema-first_ approaches help you to visualize the current state of your system in a very easy and fast way: Instead of having to understand code, the project pattern, searching in a bunch of files, go directly to the ONE file definition and figure it out right away.
- Instead of trying to reinvent the wheel, you can follow a standardized architecture that is scalable, clean, flexible, follows the best practices and allows the work to be divided in multiple steps that can be executed in parallel
- Standardize all you micro-services to follow the exact same patterns for EVERYTHING, decreasing a lot the learning curve and the effort necessary to maintain them
- Standardize all you domains / services to follow the exact same patterns for EVERYTHING, decreasing a lot the learning curve and the effort necessary to maintain them
- Allows tracking and usage of confidential and private data, like user's emails, to complain with regulations

Anvil generators:
Expand All @@ -63,7 +32,22 @@ Anvil generators:
- Generate database migrations and automatically handle them, begin able to easily see the current state of your database by looking at the schema file
- Generate standardized clients for your APIs, with automatically generate `CHANGELOG.md`s that follows [SemVer](https://semver.org)
- You are not stuck to Anvil. It's not a framework, it generates code that you have 100% control of. If you don't want to use Anvil anymore, it will have no impact on your systems.

Anvil plugins:
- Integration with other tools like Jira, Linear, Slack or your own custom system to send notifications / perform tasks
- Easy to change things at a global scale: Do not get stuck into a language, framework or architecture anymore, if you want to change it one day, it will be 100x times easier and faster.
- Run them in the pipeline to automatically update things without the need of a developer

Anvil platform (coming soon):
- Easily visualize your database and documentations
- Automatically notify all the teams dependent on your API about updates
- Integration with other tools like Jira and Linear, to automatically create tasks when the schema changes

## F.A.Q.

[See the F.A.Q. here.](./faq)

## Examples

[See the examples here.](https://github.com/henriqueleite42/anvil/cli/tree/master/examples)

## How it works

[Understand how it works here.](./how-it-works)
8 changes: 0 additions & 8 deletions docs/docs/plugins/_category_.json

This file was deleted.

5 changes: 0 additions & 5 deletions docs/docs/plugins/introduction.md

This file was deleted.

Loading

0 comments on commit 9f7d77a

Please sign in to comment.