npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-springboot-api

v1.6.1

Published

SpringBoot REST API Generator

Downloads

39

Readme

How this springboot-api generator works

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.

Installation

Prerequisites

  1. Java JDK 11 or newer (can be an open-jdk distro)
  2. Maven 3+
  3. NPM
  4. Yeoman
  5. docker
  6. docker-compose

To install yeoman:

$ npm install -g yo@latest

To install this generator:

$ npm install -g generator-springboot-api

Features

Generation of fully-functional springboot REST API, using:

  • Java 11
  • Maven 3+
  • Spring-boot 2.2 REST API

Integrations

This generator allows to integrate the springboot REST API with:

  • PostgreSQL
  • Oracle
  • RabbitMQ
  • Apache Kafka
  • Redis for cache
  • MQTT (for IoT)
  • InfluxDB for metrics

Additionally, this generator creates:

  • Two docker-compose yaml files, describing the complete stack to running on localhost and server;
  • A complete docker stack with all depedencies (including all the integrations above listed)
  • A set of curl requests serving as a basis for implementing new features
  • A Postman collection with functional requests

Get started

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:

  • Invoke the springboot generator with yeoman
$ 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)
  • Select the aditional options as below
Devtools
Mongo DB
Redis for Cache
Spring Actuator
InfluxDB for Metrics
Swagger Docs
  • Select a message-queue system, if you want
None
RabbitMQ
Apache Kafka
MQTT

After this simple options, the generator will assembly your springboot api, using all the choosen resources.

  • Compile with Maven Once your application is assembled, compile it using maven:
$ cd path_to_your_app
$ mvn package -U
  • After this maven command, all the resources compiled can be found in the target directory

    1. JAR file compiled;
    2. Scripts shell to setting up a complete docker stack (and a docker-compose file) for two environments: local machine and server;
    3. Script shell to use your API with standalone docker container dependencies;
    4. A complete set of curl requests, corresponding to the integrations you have chosen;
    5. A postman collection to test your API.
$ cd target

Setting up the complete stack on local machine

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.

  • First, make the script executable:
$ chmod +x dev-stack.sh
  • And finnaly execute the script:
$ ./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