Skip to content

Micronaut Starter Project API, REST, Java 11, GraalVM, Docker, JPA, Gradle6, JUnit5, and More Features

License

Notifications You must be signed in to change notification settings

rbarbioni/micronaut-api

Repository files navigation

CI

micronaut-api

Micronaut Rest API Playground With Java 11, GraalVM, Docker, JPA, Gradle6, JUnit5, and More Features

Micronaut

Micronaut is a modern, JVM-based, full stack microservices framework designed for building modular, easily testable microservice applications.

Micronaut is developed by the creators of the Grails framework and takes inspiration from lessons learnt over the years building real-world applications from monoliths to microservices using Spring, Spring Boot and Grails.

Micronaut aims to provide all the tools necessary to build full-featured microservice applications, including:

  • Dependency Injection and Inversion of Control (IoC)
  • Sensible Defaults and Auto-Configuration
  • Configuration and Configuration Sharing
  • Service Discovery
  • HTTP Routing
  • HTTP Client with client-side load-balancing

At the same time Micronaut aims to avoid the downsides of frameworks like Spring, Spring Boot and Grails by providing:

  • Fast startup time
  • Reduced memory footprint
  • Minimal use of reflection
  • Minimal use of proxies
  • Easy unit testing

Source: https://docs.micronaut.io/latest/guide/index.html

Application Checklist

  • Micronaut 1.3.4
  • Java 11
  • Github Actions CI
  • Postgres
  • Graal VM 11
  • Docker
  • Docker-Compose
  • Docker Swarm
  • Sentry
  • Prometheus
  • Swagger
  • Unit-Tests
  • Integration-Tests

Build and Startup

Startup

Setup

Download and configure GraalVM 20.x (Embbeded Java11) for your operacional system https://github.com/graalvm/graalvm-ce-builds/releases

How To Build

Build and install dependencies

make install

Build, install dependencies and run unit-tests

make build

How To Run

Run docker-compose

make run

Run docker-compose structure only (db)

make run/docker-compose-structure

Run docker (db should be running)

make run/docker

Run local (db should be running)

make run/local

How To Run Tests

Run all tests

make test

Run unit tests

make test/unit

Run integration tests

make test/integration

Swagger

http://localhost:8080/swagger-ui/

Prometheus Metrics

To learn more about Prometheus, visit https://prometheus.io To access local metrics, access: http://localhost:8080/prometheus

Sentry

To learn more about Sentry, visit https://sentry.io Create a free Sentry account Passing as application arguments or environment variable SENTRY_DSN

export SENTRY_DSN=YOUR-SENTRY-DSN

Docker Swarm

To learn more about Docker Swarm, visit https://prometheus.io This project is configured to run with docker swarm. First configure docker swarm Create Docker Swarm node

docker swarm init --advertise-addr [your-localhost-ip-v4]

Create and initialize stack

docker stack deploy --compose-file="docker-compose.yml" micronaut-api

Will running application in docker containers management by Docker Swarm.

Docker Swarm configuration is defined in deploy configuration in docker-compose.yml file

Contributors

Just don't commit directly on master, push a branch and Pull Request.

About

Micronaut Starter Project API, REST, Java 11, GraalVM, Docker, JPA, Gradle6, JUnit5, and More Features

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published