SpringBoot REST API Generator
MIT License
The generator-springboot-api is a yeoman generator that builds a springboot microservices from scratch. Its goal is to assemble a pre-configured, compilable and ready-to-code spring-boot project.
To install yeoman:
$ npm install -g yo@latest
To install this generator:
$ npm install -g generator-springboot-api
Generation of fully-functional springboot REST API, using:
This generator allows to integrate the springboot REST API with:
Remember you must install npm, yeoman and generator-springboot-api before use them. See the Prerequisites above.
Open your shell (or powershell) and type these follow commands:
$ yo springboot-api
Type a groupId using maven patterns (e.g. com.quasarbot.api)
Type an artifactId using maven patterns (e.g. myApplication)
Choose once embed server (mandatory)
undertow
tomcat
jetty
netty (webflux)
Devtools
Mongo DB
Redis for Cache
Spring Actuator
InfluxDB for Metrics
Swagger Docs
None
RabbitMQ
Apache Kafka
MQTT
After this simple options, the generator will assembly your springboot api, using all the choosen resources.
$ cd path_to_your_app
$ mvn package -U
After this maven command, all the resources compiled can be found in the target directory
$ cd target
If you want to set up the complete docker stack, use the shell script stack.sh. This script will start all the docker services to support the integrations of your microservice to run it in you local machine.
$ chmod +x dev-stack.sh
$ ./dev-stack.sh
The script above will create all the docker services necessary to start up your microservice. So you can import the maven project in your favourite IDE and start to code and debug.
Note: In order to use docker stack and docker service you must initialize the swarm-mode before:
$ docker swarm init