blog: First checkin.
Change-Id: Ie68b2290933101506aa729186d4c7d8aa7b66785
diff --git a/blog/src/main/java/eu/mulk/demos/ReactiveGreetingResource.java b/blog/src/main/java/eu/mulk/demos/ReactiveGreetingResource.java
new file mode 100644
index 0000000..a8fc395
--- /dev/null
+++ b/blog/src/main/java/eu/mulk/demos/ReactiveGreetingResource.java
@@ -0,0 +1,16 @@
+package eu.mulk.demos;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Path("/hello-resteasy-reactive")
+public class ReactiveGreetingResource {
+
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String hello() {
+ return "Hello";
+ }
+}
diff --git a/blog/src/main/java/eu/mulk/demos/blog/Author.java b/blog/src/main/java/eu/mulk/demos/blog/Author.java
new file mode 100644
index 0000000..d9091be
--- /dev/null
+++ b/blog/src/main/java/eu/mulk/demos/blog/Author.java
@@ -0,0 +1,10 @@
+package eu.mulk.demos.blog;
+
+import io.quarkus.hibernate.orm.panache.PanacheEntity;
+import javax.persistence.Entity;
+
+@Entity
+public class Author extends PanacheEntity {
+
+ public String name;
+}
diff --git a/blog/src/main/java/eu/mulk/demos/blog/Category.java b/blog/src/main/java/eu/mulk/demos/blog/Category.java
new file mode 100644
index 0000000..a0c3d81
--- /dev/null
+++ b/blog/src/main/java/eu/mulk/demos/blog/Category.java
@@ -0,0 +1,10 @@
+package eu.mulk.demos.blog;
+
+import io.quarkus.hibernate.orm.panache.PanacheEntity;
+import javax.persistence.Entity;
+
+@Entity
+public class Category extends PanacheEntity {
+
+ public String name;
+}
diff --git a/blog/src/main/java/eu/mulk/demos/blog/Comment.java b/blog/src/main/java/eu/mulk/demos/blog/Comment.java
new file mode 100644
index 0000000..cfcbf84
--- /dev/null
+++ b/blog/src/main/java/eu/mulk/demos/blog/Comment.java
@@ -0,0 +1,13 @@
+package eu.mulk.demos.blog;
+
+import io.quarkus.hibernate.orm.panache.PanacheEntity;
+import java.time.Instant;
+import javax.persistence.Entity;
+
+@Entity
+public class Comment extends PanacheEntity {
+
+ public String authorName;
+ public Instant publicationDate;
+ public String text;
+}
diff --git a/blog/src/main/java/eu/mulk/demos/blog/Post.java b/blog/src/main/java/eu/mulk/demos/blog/Post.java
new file mode 100644
index 0000000..a12ba70
--- /dev/null
+++ b/blog/src/main/java/eu/mulk/demos/blog/Post.java
@@ -0,0 +1,31 @@
+package eu.mulk.demos.blog;
+
+import io.quarkus.hibernate.orm.panache.PanacheEntity;
+import java.time.Instant;
+import java.util.List;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+
+@Entity
+public class Post extends PanacheEntity {
+
+ public String title;
+
+ public Instant publicationDate;
+
+ @Column(columnDefinition = "TEXT")
+ public String body;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ public Author author;
+
+ @ManyToMany(fetch = FetchType.LAZY)
+ public List<Category> categories;
+
+ @OneToMany(fetch = FetchType.LAZY)
+ public List<Comment> comments;
+}
diff --git a/blog/src/main/resources/META-INF/resources/index.html b/blog/src/main/resources/META-INF/resources/index.html
new file mode 100644
index 0000000..0cec3b2
--- /dev/null
+++ b/blog/src/main/resources/META-INF/resources/index.html
@@ -0,0 +1,242 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>blog - 1.0.0-SNAPSHOT</title>
+ <style>
+ h1, h2, h3, h4, h5, h6 {
+ margin-bottom: 0.5rem;
+ font-weight: 400;
+ line-height: 1.5;
+ }
+
+ h1 {
+ font-size: 2.5rem;
+ }
+
+ h2 {
+ font-size: 2rem
+ }
+
+ h3 {
+ font-size: 1.75rem
+ }
+
+ h4 {
+ font-size: 1.5rem
+ }
+
+ h5 {
+ font-size: 1.25rem
+ }
+
+ h6 {
+ font-size: 1rem
+ }
+
+ .lead {
+ font-weight: 300;
+ font-size: 2rem;
+ }
+
+ .banner {
+ font-size: 2.7rem;
+ margin: 0;
+ padding: 2rem 1rem;
+ background-color: #0d1c2c;
+ color: white;
+ }
+
+ body {
+ margin: 0;
+ font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
+ }
+
+ code {
+ font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
+ font-size: 87.5%;
+ color: #e83e8c;
+ word-break: break-word;
+ }
+
+ .left-column {
+ padding: .75rem;
+ max-width: 75%;
+ min-width: 55%;
+ }
+
+ .right-column {
+ padding: .75rem;
+ max-width: 25%;
+ }
+
+ .container {
+ display: flex;
+ width: 100%;
+ }
+
+ li {
+ margin: 0.75rem;
+ }
+
+ .right-section {
+ margin-left: 1rem;
+ padding-left: 0.5rem;
+ }
+
+ .right-section h3 {
+ padding-top: 0;
+ font-weight: 200;
+ }
+
+ .right-section ul {
+ border-left: 0.3rem solid #71aeef;
+ list-style-type: none;
+ padding-left: 0;
+ }
+
+ .examples {
+ display: flex;
+ flex-wrap: wrap;
+ margin: 20px 0 20px -40px;
+ }
+
+ .example {
+ display: flex;
+ margin-left: 20px;
+ margin-bottom: 20px;
+ flex-direction: column;
+ width: 350px;
+ background-color: #205894;
+ color: white;
+ }
+
+ .example code {
+ color: lightgrey;
+ }
+
+ .example-header {
+ padding: 20px;
+ display: flex;
+ position: relative;
+ }
+
+ .example-header h4 {
+ margin: 0;
+ font-size: 1.4rem;
+ flex-grow: 1;
+ line-height: 1.5;
+ }
+
+ .example-description {
+ padding: 0 20px;
+ flex-grow: 1;
+ }
+
+ .example-paths {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .example-paths a {
+ display: block;
+ background-color: transparent;
+ font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
+ color: white;
+ padding: 10px;
+ text-decoration: none;
+ }
+
+ .example-paths a:before {
+ content: '⇨';
+ font-weight: bold;
+ font-size: 1.5rem;
+ margin: 20px;
+ }
+
+ .example-paths a:hover {
+ background-color: #0d1c2c;
+ }
+
+ .guide-link {
+ background-color: #71aeef;
+ position: absolute;
+ color: white;
+ text-decoration: none;
+ top: 0;
+ right: 0;
+ padding: 7px;
+ font-weight: bold;
+ }
+
+ .guide-link:hover {
+ background-color: #0d1c2c;
+ }
+ </style>
+</head>
+<body>
+
+<div class="banner lead">
+ Your new Cloud-Native application is ready!
+</div>
+
+<div class="container">
+ <div class="left-column">
+ <p class="lead"> Congratulations, you have created a new Quarkus cloud application.</p>
+
+ <h2>Why do you see this?</h2>
+
+ <p>This page is served by Quarkus. The source is in
+ <code>src/main/resources/META-INF/resources/index.html</code>.</p>
+
+ <h2>What can I do from here?</h2>
+
+ <p>If not already done, run the application in <em>dev mode</em> using: <code>./mvnw compile quarkus:dev</code>.
+ </p>
+ <ul>
+ <li>Play with your example code in <code>src/main/java</code>:
+ <div class="examples">
+<div class="example">
+ <div class="example-header">
+ <h4>RESTEasy Reactive</h4>
+ <a href="https://quarkus.io/guides/getting-started-reactive" target="_blank" class="guide-link">Guide</a>
+ </div>
+ <div class="example-description">
+ <p>A Hello World RESTEasy Reactive resource</p>
+
+ </div>
+ <div class="example-paths">
+ <a href="/hello-resteasy-reactive" class="path-link" target="_blank">GET /hello-resteasy-reactive</a>
+ </div>
+</div>
+
+ </div>
+ </li>
+ <li>Your static assets are located in <code>src/main/resources/META-INF/resources</code>.</li>
+ <li>Configure your application in <code>src/main/resources/application.properties</code>.</li>
+ </ul>
+ <h2>Do you like Quarkus?</h2>
+ <p>Go give it a star on <a href="https://github.com/quarkusio/quarkus">GitHub</a>.</p>
+ </div>
+ <div class="right-column">
+ <div class="right-section">
+ <h3>Application</h3>
+ <ul>
+ <li>GroupId: eu.mulk.demos</li>
+ <li>ArtifactId: blog</li>
+ <li>Version: 1.0.0-SNAPSHOT</li>
+ <li>Quarkus Version: 1.11.3.Final</li>
+ </ul>
+ </div>
+ <div class="right-section">
+ <h3>Next steps</h3>
+ <ul>
+ <li><a href="https://quarkus.io/guides/maven-tooling.html" target="_blank">Setup your IDE</a></li>
+ <li><a href="https://quarkus.io/guides/getting-started.html" target="_blank">Getting started</a></li>
+ <li><a href="https://quarkus.io" target="_blank">Quarkus Web Site</a></li>
+ </ul>
+ </div>
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/blog/src/main/resources/application.properties b/blog/src/main/resources/application.properties
new file mode 100644
index 0000000..9ba7752
--- /dev/null
+++ b/blog/src/main/resources/application.properties
@@ -0,0 +1,12 @@
+quarkus.datasource.db-kind = postgresql
+quarkus.datasource.jdbc.driver = org.postgresql.Driver
+
+%dev.quarkus.datasource.jdbc.url = jdbc:postgresql://localhost:5432/demo_blog
+%dev.quarkus.datasource.username = demo
+%dev.quarkus.datasource.password =
+%dev.quarkus.hibernate-orm.log.sql = true
+%dev.quarkus.hibernate-orm.log.format-sql = true
+%dev.quarkus.hibernate-orm.database.generation = drop-and-create
+
+quarkus.hibernate-orm.physical-naming-strategy = com.vladmihalcea.hibernate.type.util.CamelCaseToSnakeCaseNamingStrategy
+quarkus.hibernate-orm.dialect = io.quarkus.hibernate.orm.runtime.dialect.QuarkusPostgreSQL10Dialect
diff --git a/blog/src/main/resources/hibernate-types.properties b/blog/src/main/resources/hibernate-types.properties
new file mode 100644
index 0000000..ce36a3b
--- /dev/null
+++ b/blog/src/main/resources/hibernate-types.properties
@@ -0,0 +1 @@
+hibernate.types.print.banner = false