Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
henriqueleite42 committed Aug 21, 2024
1 parent 2934681 commit 59d6dec
Show file tree
Hide file tree
Showing 33 changed files with 85 additions and 63 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
paths:
- docs/**

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"files.associations": {
"*.anv": "yaml",
},
"files.exclude": {
"vendor/**": true,
},
"cSpell.words": [
"anvil",
"anvilconfig",
Expand Down
5 changes: 0 additions & 5 deletions CONTRIBUTING.md

This file was deleted.

45 changes: 5 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img src="./static/img/logo.webp" alt="anvil" width="500" height="500">
<img src="./docs/static/img/logo.webp" alt="anvil" width="500" height="500">
<div>

# Anvil
Expand Down Expand Up @@ -70,47 +70,12 @@ Anvil plugins:

## F.A.Q.

[See the F.A.Q. here.](./FAQ.md)
[See the F.A.Q. here.](https://henriqueleite42.github.io/anvil/docs/faq)

## Examples

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

## How Anvil work
## How it works

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).

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

### `.anvilconfig`

`.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 [TOML](https://toml.io/en/).

### CLI

The CLI is the way that you interact with all Anvil things. You can use it to validate your files, generate things, install plugins, run your migrations, and much more.

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
- 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 schema.
- Notify breaking changes to dependent projects

Very useful for Agile environments.
[Understand how it works here.](https://henriqueleite42.github.io/anvil/docs/how-it-works)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func Authentication() {
fileData, err := os.ReadFile("./examples/advanced/authentication.anv")
fileData, err := os.ReadFile("../examples/advanced/authentication.anv")
if err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 4 additions & 0 deletions FAQ.md → docs/docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 2
---

# F.A.Q.

## Is Anvil ready to use right out the box?
Expand Down
14 changes: 7 additions & 7 deletions docs/docs/generators/_category_.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"label": "Generators",
"position": 4,
"link": {
"type": "generated-index",
"description": "How to develop generators"
}
}
"label": "Generators",
"position": 20,
"link": {
"type": "generated-index",
"description": "How to develop generators"
}
}
42 changes: 42 additions & 0 deletions docs/docs/how-it-works.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
sidebar_position: 3
---

## How it work

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).

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

### `.anvilconfig`

`.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 [TOML](https://toml.io/en/).

### CLI

The CLI is the way that you interact with all Anvil things. You can use it to validate your files, generate things, install plugins, run your migrations, and much more.

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
- 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 schema.
- Notify breaking changes to dependent projects

Very useful for Agile environments.
3 changes: 2 additions & 1 deletion docs/docs/intro.md → docs/docs/introduction.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
sidebar_position: 1
---
# Anvil

# 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.

Expand Down
14 changes: 7 additions & 7 deletions docs/docs/plugins/_category_.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"label": "Plugins",
"position": 3,
"link": {
"type": "generated-index",
"description": "How to develop plugins"
}
}
"label": "Plugins",
"position": 30,
"link": {
"type": "generated-index",
"description": "How to develop plugins"
}
}
4 changes: 4 additions & 0 deletions ROADMAP.md → docs/docs/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 4
---

# Roadmap

## Critical features
Expand Down
8 changes: 7 additions & 1 deletion TECHNICAL-DECISIONS.md → docs/docs/tech-decisions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Our Technical Decisions and how we took them
---
sidebar_position: 9
---

# Technical Decisions

See our technical decisions and why we took them.

### Why is Anvil written in Golang?

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/use/schema.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 2
sidebar_position: 10
---

# Schema
Expand Down

0 comments on commit 59d6dec

Please sign in to comment.