Skip to content

Commit

Permalink
Add description to README
Browse files Browse the repository at this point in the history
- change project description
- add "How was the project created?" section
- add "Author" section
  • Loading branch information
JonasHavers committed Nov 14, 2018
1 parent aac0634 commit 2dc8c6e
Showing 1 changed file with 58 additions and 3 deletions.
61 changes: 58 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# book-catalog

This is an example application written with [Micronaut](http://micronaut.io).
It publishes a catalog of books from a MongoDB database through an HTTP API and [Handlebars](http://jknack.github.io/handlebars.java/) view.
This is a basic example application written with [Micronaut](http://micronaut.io)
that publishes a catalog of books from a MongoDB database via an HTTP API and a server-side [Handlebars](http://jknack.github.io/handlebars.java/) view.

Please note that the Docker setup is explicitly not intended for use in production.
The example also includes Lombok integration, Jackson configuration, reactive MongoDB connectivity, ConfigurationProperties and a test environment stub.

Please note that additional security configuration is required to use the project in production.

## Requirements

Expand Down Expand Up @@ -46,3 +48,56 @@ This will:
- stop (or kill after 10sec) the Docker multi-container application (using docker-compose),
- remove all attached Docker resources,
- remove the Micronaut application image.

## How was the project created?

The project itself, the Java beans and controller skeletons were scaffolded using the
[Micronaut CLI](https://docs.micronaut.io/latest/guide/index.html#buildCLI):

```
$ mn create-app catalogservice.book-catalog --features mongo-reactive
| Generating Java project...
| Application created at /Volumes/projects/github.com/JonasHavers/book-catalog
$ cd book-catalog/
$ mn
| Starting interactive mode...
| Enter a command name to run. Use TAB for completion:
mn> create-bean catalogservice.application.FindBooksUseCase
| Rendered template Bean.java to destination src/main/java/catalogservice/application/FindBooksUseCase.java
mn> create-bean catalogservice.adapter.mongodb.MongoBooksRepository
| Rendered template Bean.java to destination src/main/java/catalogservice/adapter/mongodb/MongoBooksRepository.java
mn> create-controller catalogservice.adapter.web.BooksApiController
| Rendered template Controller.java to destination src/main/java/catalogservice/adapter/web/BooksApiController.java
| Rendered template ControllerTest.java to destination src/test/java/catalogservice/adapter/web/BooksApiControllerTest.java
mn> create-bean catalogservice.adapter.test.StubBooksRepository
| Rendered template Bean.java to destination src/main/java/catalogservice/adapter/test/StubBooksRepository.java
```

The Lombok dependency and annotation processor were added to the project in *build.gradle* right before Micronaut's annotation processors:

```
compileOnly "org.projectlombok:lombok:1.18.4" // added
annotationProcessor "org.projectlombok:lombok:1.18.4" // added
annotationProcessor "io.micronaut:micronaut-inject-java"
```

The Handlebars dependency was added to the project in *build.gradle* to support server-side view rendering:

```
runtime "com.github.jknack:handlebars:4.1.2"
```

The controller that is responsible for the routing and the view model creation was also scaffolded:

```
$ mn create-controller catalogservice.adapter.web.BooksViewController
| Rendered template Controller.java to destination src/main/java/catalogservice/adapter/web/BooksViewController.java
| Rendered template ControllerTest.java to destination src/test/java/catalogservice/adapter/web/BooksViewControllerTest.java
```

Implementation and configuration followed the scaffolding.
For further details, please refer to the Git history.

## Author

Jonas Havers ([@JonasHavers](https://twitter.com/JonasHavers)) - [https://jonas-havers.de](https://jonas-havers.de)

0 comments on commit 2dc8c6e

Please sign in to comment.