Getting started

Prerequisite

  • Java 1.8 or higher
  • Maven3

Maven archetype

You can create an Enkan’s blank project from maven archetype.

% mvn archetype:generate -DarchetypeGroupId=net.unit8.enkan -DarchetypeArtifactId=kotowari-archetype -DarchetypeVersion=0.2.0

By default, following components is enabled.

  • undertow
  • flyway
  • doma2
  • HikariCP
  • freemarker
  • jackson

Start REPL

% mvn -e compile exec:java

If you execute the /start command, application will start.

enkan> /start /

Scaffolding

enkan-devel is a useful tool in development. it contains the command to generate an application scaffold.

Create table

enkan> /generate table PRODUCT (id identity primary key, name varchar(255))

If automatic building is unavailable, the /compile command is useful.

enkan> /compile

When you reset your application, Flyway component will execute the generated migration.

enkan> /reset

Generate a CRUD controller and templates

When you execute /generate command, a CRUD controller and templates will be generated.

enkan> /generate crud PRODUCT

If necessary, compile it.

enkan> /compile

When you reset your application, the generated routes are reloaded and become available.

enkan> /reset

Try to access http://localhost:3000/product in your browser.