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-spring-spa

v0.10.0

Published

Production ready stack to start with modern SPA FrontEnd Backend by Java Spring Boot Framework

Downloads

38

Readme

Spring SPA

This project is a yeoman generator that puts together best practices for single page apps using spring framework.

Effort's will be on Angular 2 and Aurelia SPA. You can use anything.

It generates a client and server application. The client application is a standard node angular-cli or aurelia-cli application.

The server is a standard Spring Boot application.

The two are bridged toggether using gradle and some spring config.

On developer you use the tools from NPM (ng serve, au start) and on production, gradle will build the client and cache everything.

It also provides more candy's like:

  • Test and integrationTest setups
  • Slick database setup
  • Keycloak setup
  • Docker
  • Continuous integration with wercker
  • Documentation generation from markdown

Note: Some code use Scala, it is not a requirement, you can substitute by Java. I highly recomment you keep at least the unit tests in scala, because is way more fun and less boilerplate.

What this project is not:

  • It do not try to compete with JHipster, but try to be more straight forward by ofering less customizations and features and not get in your way.
  • Not magic. I recommend that you understand how it works.
  • This project try not surprise you when you must need.
  • This project is not intended to provide alternatives. If some tech is choose, the other's will be ignored on the generator. It DO NOT mean you can't do it yourself, or override, it only means that the generator will not easy thing's for you in this cases. It can only provide a standard way.

This project is kind of a evolution of https://github.com/giovannicandido/slush-spring-aurelia . Has less stack build in, but delegates to other projects and let you choose, by example SASS integration can be configured in angular-cli: https://github.com/angular/angular-cli

Tech that compose this generator

The main technological stack is:

  • Angular cli
  • Aurelia cli
  • Spring Boot
  • Gradle
  • NPM and Node
  • Keycloak
  • Docker
  • Wercker
  • Scala and Java
  • Scalatest
  • Mkdocs
  • Slick database
  • FlywayDB

You don't need to know everything, some are just for the build, others are optional.

If you know Spring Boot, Gradle and Angular or Aurelia, you are good to go :-)

Usage

Lets create a angular project with everything the generator provides:

Install the things:

npm install -g yo generator-spring-spa angular-cli

Create a new project

yo spring-spa newProject

Add to git. This is required for gradle git and spring integration. Check http://localhost:8080/config If you want you can disable that in build.gradle, remove apply plugin: "com.gorylenko.gradle-git-properties"

cd newProject
git init
git add .
git commit -m "Initial commit"

Run a build and a test (lots of things will be downloaded, good time to have a coffe ;-)

cd newProject
./gradlew build

All testes should pass

Integrate slick database:

cd newProject
yo spring-spa:slick

Follow instructions

Run tests

./gradlew integTest

Integrate keycloak:

yo spring-spa:keycloak

Follow instructions

Run tests

./gradlew integTest

indexHtml test should fail, you now have security enabled. Update the test, see: http://docs.spring.io/spring-security/site/docs/current/reference/html/test-method.html

Create a SPA interceptor

cd newProject
yo spring-spa:interceptor

Follow instructions

You will need to fit for your needs

Cross Site Request Forgery is enabled by default in spring, but you need to integrate in your SPA

cd newProject
yo spring-spa:csrf

Follow instructions