An open API service indexing awesome lists of open source software.

https://github.com/landzcape/landzcape

Landzcape - Visualize your architecture
https://github.com/landzcape/landzcape

angular architecture documentation gradle maven visualization

Last synced: 5 months ago
JSON representation

Landzcape - Visualize your architecture

Awesome Lists containing this project

README

          

# Landzcape
[![CircleCI](https://circleci.com/gh/landzcape/landzcape.svg?style=svg)](https://circleci.com/gh/landzcape/landzcape)

Landzcape visualizes components and their dependencies. This structure can be discovered using
plugins for Angular, Gradle and/or Maven.

**Available plugin tasks**

| Task | Gradle | Maven | Angular |
| -------------- |:------:|:-----:|:-------:|
| Discover | Yes | Yes | Yes |
| Merge | Yes | Yes | No |
| ExtractExplorer| Yes | Yes | No |

## Discovery
In essence the `discovery` process will scan your code, extract the module structure and write it to a file named `landscape.json`.
The generated `landscape.json` will be the source for visualizing your module landscape.

### Discovery with Maven

The discovery plugin needs to be run in the root `pom.xml` of your multi-module maven project.

```



io.landzcape
discovery-maven-plugin
1.0
false


process-resources

discover




surfshop
surfing

com.surfshop::


com.surfshop:excluded-module:



surfshop
My Surfshop!




surfing
Surfing
surfshop




es
Edge Service
*-es
1


cs
Core Service
*-cs
2




```

The plugin's configuration can be overridden in sub-projects. Example:

```



io.landzcape
discovery-maven-plugin
1.0
false

common


```

If you want to skip the discovery process conditionally, use `true`.

### Discovery with Gradle

The discovery plugin needs to be configured in the root `build.gradle` of your multi-module gradle project.
Just import the plugin ...
```
buildscript {
repositories { ... }

dependencies {
classpath 'io.landzcape:discovery-gradle-plugin:1.0'
}
}

apply plugin: 'io.landzcape.discovery'
```

... and configure it to your needs ...

```
landscape {
context = 'surfshop'
domain = 'surfing'
includes = ['com.surfshop::']
excludes = ['com.surfshop:excluded-module:']

contexts {
context name: 'surfshop', label: 'My Surfshop!'
context name: 'kiteshop', label: 'My Kiteshop'
}

domains {
domain name: 'surfing', label: 'Surfing', context: 'surfshop'
}

layers {
layer name: 'es', label: 'Edge Service', matching: '*-es', order: 1
layer name: 'cs', label: 'Core Service', matching: '*-cs', order: 2
}
}
```
The plugin's configuration can be overridden in sub-projects.

Execute the `discover` task to run start the discovery process.

### Discovery with Angular

In your `package.json` add ...

```
"devDependencies": {
"@landzcape/discovery-angular": "1.0.0",
...
}
```
... to import the dependency. The configuration goes into files named `discover.json`.
As an example, you could have a `discover.json` in your root directory (next to `tsconfig.json`) that defines your layers ...

```
{
"context": "surfshop",
"domain": "surfing",
"layer": "ui"
}
```

... and a separate `discover.json` in your `shared` folder to mark all your shared modules with the type `COMMON`.

```
{
"type": "COMMON"
}
```

To start the discovery, invoke this command using a terminal or npm build script:

```landzcape-discovery-angular```

As an optional argument you can specify the location of the projects `tsconfig.json`.

## Merging

Already discovered `landscape.json` files can be merged for visualization.

### Merging with Maven

```



io.landzcape
discovery-maven-plugin
1.0
false


process-resources

merge





first/landscape.json
second/landscape.json

landscape.json


```

If you want to skip the merge conditionally, use `true`.

### Merging with Gradle

```
import io.landzcape.gradle.MergeTask

...

apply plugin: 'io.landzcape.discovery'

task merge(type: MergeTask) {
discoveries = ['first/landscape.json', 'second/landscape.json']
mergeTo = 'landscape.json'
}
```
## Visualization

Landzcape Explorer is a web application that visualizes your landscape.
It is bundled with the Gradle and Maven discovery plugin. It can be extracted
during the build process and deployed with any HTTP server.

### Example using `nginx`
Assuming that you already discovered your landscape and your `landscape.json` is ready.
#### 1. Extract the visualization application
You can either use Maven to extract the visualization application ...
```



io.landzcape
discovery-maven-plugin
1.0
false


process-resources

extractExplorer




explorer


```
... or do the same with gradle ...
```
import io.landzcape.gradle.ExtractExplorerTask

...

apply plugin: 'io.landzcape.discovery'

task extract(type: ExtractExplorerTask) {
extractTo = 'explorer'
}
```

If you want to skip the extraction conditionally, use `true`.

#### 2. Bundle application and landscape with `nginx`

```
FROM nginx
COPY explorer /usr/share/nginx/html
COPY landscape.json /usr/share/nginx/html
```

#### 3. Build, deploy and run ...
... the docker image. Preferably all automated, so you always have an updated architecture visualization :)