SPA is a multi-technology Open Source project that aims to provide fully working starter or reference projects for Single Page web Applications (SPA) that use REST-style web-services implemented on various middleware platforms.
Single Page Applications using JSON web-service APIs are the de facto standard used to develop responsive web applications for the modern web.
One of the main advantages of an SPA is to avoid full-page refreshes when switching from one page ("view") in the application to another. Traditional web applications had previously required a round-trip to the server for each interaction, with inherent and noticeable lag and obvious "flashes" when the page refreshes.
An SPA is generally a smoother user experience, trips to the sever to fetch data can be pushed to the background while maintaining a responsive non-blocking user interface.
There are many other advantages to building applications this way, not least is the option to build a Progressive Web Application (PWA) that could even work offline and feel more like a native application.
Setting up SPA projects to work properly with some middle-tier frameworks can be very difficult and frustrating and can require specialist configuration.
Spring/SpringMVC especially is notorious for complex configuration and copious boilerplate.
An SPA also has particular routing requirements.
Routing is mainly a client-side solution after the initial page-load for the application, but nothing prevents a user from forcing a full-page refresh or bookmarking and returning to "deep" links in the application. These deep links require server-side routing to make sure the SPA initial page is loaded before client routing again takes over.
On top of this, web-service API calls and requests for static resources must also have proper routing configuration.
The necessary routing can be difficult to achieve properly.
This project aims to solve these initial project structure, configuration and routing requirements in a minimal and easy to comprehend set of template projects at Github.
Spring and SpringMVC, while somewhat complex, bloated and long in the tooth, are still very popular frameworks for server-side Java developers.
Spring Boot, opinionated Spring. I heard you liked frameworks so we put a framework in your framework so you can framework while you framework - Spring, the framework so complex it needs another framework just to use it. To be fair, Spring Boot is easier than using SpringMVC directly.
Vert.x is a toolkit for building reactive applications on the JVM and has similarities with node. Vert.x was much easier to deal with than SpringMVC.
Javalin is a simple web framework for Java and Kotlin. This framework was the easiest and quickest to get up and running with, the server-side routing was particularly nice and simple.
AngularJS is another component-based user interface library that uses Typescript. It is somewhat more verbose and syntax-heavy than ReactJS and significantly more complex to learn and use. The Github project has almost 60,000 stars.
EmberJS is a framework for "amibtious" web developers and aims to be "highy productive out of the box". The Github project has over 20,000 stars and is used by over 18,000 other Github projects.
Some of the reference projects are template projects available at our Github repository (there are too many combinations to include all of them):
A convenient link to all SPA projects.
The "HTML" versions are just vanilla projects without any front-end framework integrated and really aren't all that interesting, but they do show fully working routing.
Other variations may be added as time goes on.
Generate Your Own Projects
We created a Yeoman generator to create the various combinations of SPA projects.
Currently there are 128 possible project combinations, allowing you to mix any of these technologies...
- Spring Boot
Front-end package manager
The generator project is available at the npm registry.