<commit_before># my-company-monolith [![CircleCI](https://circleci.com/gh/ivans-innovation-lab/my-company-monolith.svg?style=svg)](https://circleci.com/gh/ivans-innovation-lab/my-company-monolith)
This version of the application is deployed as a single monolithic application. 

Domain Driven Design is applied through Event Sourcing and CQRS. How Event Sourcing enables deployment flexibility - the application can be migrated and deployed as a microservices.

## Table of Contents

   * [Application 'My Company' (Monolithic version)](#application-my-company-monolithic-version)
      * [Patterns and techniques:](#patterns-and-techniques)
      * [Technologies](#technologies)
      * [Key benefits](#key-benefits)
      * [How it works](#how-it-works)
      * [Running instructions](#running-instructions)
         * [Prerequisite](#prerequisite)
         * [Step 1: Clone the project](#step-1-clone-the-project)
         * [Step 2: Build the project](#step-2-build-the-project)
         * [Step 3: Run it](#step-3-run-it)
         * [Issuing Commands &amp; Queries with CURL](#issuing-commands--queries-with-curl)
            * [Get the JWT token ](#get-the-jwt-token )
            * [Create Blog post](#create-blog-post)
            * [Publish Blog post](#publish-blog-post)
            * [Query Blog posts](#query-blog-posts)
            * [Create Project](#create-project)
            * [Query Projects](#query-projects)
         * [Angular application](#angular-application)
      * [References and further reading](#references-and-further-reading)


## Patterns and techniques:

1. Command and Query Responsibility Separation (CQRS)
2. Event Sourcing

## Technologies

- [Spring Boot](http://projects.spring.io/spring-boot/) (v1.4.1.RELEASE)
- [Spring Data](http://projects.spring.io/spring-data/)
- [Spring Data REST](http://projects.spring.io/spring-data-rest/)
- [Axon Framework](http://www.axonframework.org/) (v3.0-RC1)


## Key benefits
1. Simple to develop - the goal of current development tools and IDEs is to support the development of monolithic applications
2. Simple to deploy - you simply need to deploy the WAR/JAR file on the appropriate runtime
3. Simple to scale - you can scale the application by running multiple copies of the application behind a load balancer
4. Easy implementation of eventually consistent business transactions that could span multiple components
5. Automatic publishing of events whenever data changes
6. Reliable auditing for all updates

## How it works

The application is literally split into a *command-side (domain)* component and a *query-side (materialized view)* component (this is CQRS in its most literal form).

Communication between the two components is `event-driven` and the demo uses simple event store (Database in this case - JPA) as a means of passing the [events](https://github.com/ivans-innovation-lab/my-company-common) between components.

The **command-side (domain)** processes commands. Commands are actions which change state in some way. The execution of these commands results in `Events` being generated which are persisted by Axon, and propagated out to other components. In event-sourcing, events are the sole records in the system. They are used by the system to describe and re-build domain aggregates on demand, one event at a time.

- https://github.com/ivans-innovation-lab/my-company-blog-domain
- https://github.com/ivans-innovation-lab/my-company-project-domain

The **query-side (materialized view)** is an event-listener and processor. It listens for the `Events` and processes them in whatever way makes the most sense. In this application, the query-side just builds and maintains a *materialised view* which tracks the state of the individual agregates (Project, Blog, ...).

- https://github.com/ivans-innovation-lab/my-company-blog-materialized-view
- https://github.com/ivans-innovation-lab/my-company-project-materialized-view

This application have REST API's which can be used to access capabilities of a the domain and all materialized views.


## Running instructions

### Prerequisite

- [Java JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
- [Git](https://git-scm.com/) 

### Step 1: Clone the project

```bash
$ git clone https://github.com/ivans-innovation-lab/my-company-monolithic-web.git
```

### Step 2: Build the project

This application depends on other librariries (please make them available in your local maven repository):

- [my-company-blog-domain (**command-side**)](https://github.com/ivans-innovation-lab/my-company-blog-domain.git)
- [my-company-project-domain (**command-side**)](https://github.com/ivans-innovation-lab/my-company-project-domain.git)
- [my-company-blog-materialized-view (**query-side**)](https://github.com/ivans-innovation-lab/my-company-blog-materialized-view.git)
- [my-company-project-materialized-view (**query-side**)](https://github.com/ivans-innovation-lab/my-company-project-materialized-view.git)


### Step 3: Run it

```bash
$ cd my-company-monolithic-web
$ ./mvnw spring-boot:run
```<commit_msg>Updating the README<commit_after># my-company-monolith [![CircleCI](https://circleci.com/gh/ivans-innovation-lab/my-company-monolith.svg?style=svg)](https://circleci.com/gh/ivans-innovation-lab/my-company-monolith)
This version of the application is deployed as a single monolithic application. 

Domain Driven Design is applied through Event Sourcing and CQRS. How Event Sourcing enables deployment flexibility - the application can be migrated and deployed as a microservices.

## Table of Contents

   * [Application 'My Company' (Monolithic version)](#application-my-company-monolithic-version)
      * [Patterns and techniques:](#patterns-and-techniques)
      * [Technologies](#technologies)
      * [Key benefits](#key-benefits)
      * [How it works](#how-it-works)
      * [Running instructions](#running-instructions)
         * [Prerequisite](#prerequisite)
         * [Step 1: Clone the project](#step-1-clone-the-project)
         * [Step 2: Build the project](#step-2-build-the-project)
         * [Step 3: Run it](#step-3-run-it)
         * [Issuing Commands &amp; Queries with CURL](#issuing-commands--queries-with-curl)
            * [Get the JWT token ](#get-the-jwt-token )
            * [Create Blog post](#create-blog-post)
            * [Publish Blog post](#publish-blog-post)
            * [Query Blog posts](#query-blog-posts)
            * [Create Project](#create-project)
            * [Query Projects](#query-projects)
         * [Angular application](#angular-application)
      * [References and further reading](#references-and-further-reading)


## Patterns and techniques:

1. Command and Query Responsibility Separation (CQRS)
2. Event Sourcing

## Technologies

- [Spring Boot](http://projects.spring.io/spring-boot/) (v1.4.1.RELEASE)
- [Spring Data](http://projects.spring.io/spring-data/)
- [Spring Data REST](http://projects.spring.io/spring-data-rest/)
- [Axon Framework](http://www.axonframework.org/) (v3.0-RC1)


## Key benefits
1. Simple to develop - the goal of current development tools and IDEs is to support the development of monolithic applications
2. Simple to deploy - you simply need to deploy the WAR/JAR file on the appropriate runtime
3. Simple to scale - you can scale the application by running multiple copies of the application behind a load balancer
4. Easy implementation of eventually consistent business transactions that could span multiple components
5. Automatic publishing of events whenever data changes
6. Reliable auditing for all updates

## How it works

The application is literally split into a *command-side (domain)* component and a *query-side (materialized view)* component (this is CQRS in its most literal form).

Communication between the two components is `event-driven` and the demo uses simple event store (Database in this case - JPA) as a means of passing the [events](https://github.com/ivans-innovation-lab/my-company-common) between components.

The **command-side (domain)** processes commands. Commands are actions which change state in some way. The execution of these commands results in `Events` being generated which are persisted by Axon, and propagated out to other components. In event-sourcing, events are the sole records in the system. They are used by the system to describe and re-build domain aggregates on demand, one event at a time.

- https://github.com/ivans-innovation-lab/my-company-blog-domain
- https://github.com/ivans-innovation-lab/my-company-project-domain

The **query-side (materialized view)** is an event-listener and processor. It listens for the `Events` and processes them in whatever way makes the most sense. In this application, the query-side just builds and maintains a *materialised view* which tracks the state of the individual agregates (Project, Blog, ...).

- https://github.com/ivans-innovation-lab/my-company-blog-materialized-view
- https://github.com/ivans-innovation-lab/my-company-project-materialized-view

This application have REST API's which can be used to access capabilities of a the domain and all materialized views.


## Running instructions

### Prerequisite

- [Java JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
- [Git](https://git-scm.com/) 

### Step 1: Clone the project

```bash
$ git clone https://github.com/ivans-innovation-lab/my-company-monolithic-web.git
```

### Step 2: Build the project

This application depends on other librariries (all available under http://maven.idugalic.pro/)

- [my-company-blog-domain (**command-side**)](https://github.com/ivans-innovation-lab/my-company-blog-domain.git)
- [my-company-project-domain (**command-side**)](https://github.com/ivans-innovation-lab/my-company-project-domain.git)
- [my-company-blog-materialized-view (**query-side**)](https://github.com/ivans-innovation-lab/my-company-blog-materialized-view.git)
- [my-company-project-materialized-view (**query-side**)](https://github.com/ivans-innovation-lab/my-company-project-materialized-view.git)


### Step 3: Run it

```bash
$ cd my-company-monolithic-web
$ ./mvnw clean install
$ ./mvnw spring-boot:run
```
{'fraction_non_alphanumeric': 0.12175785455613193, 'fraction_numerical': 0.0062640696877752765, 'mean_word_length': 4.050914483440435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 26, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1480256', 'n_tokens_mistral': 3094, 'n_tokens_neox': 2867, 'n_words': 914}