Grace is a fork of Grails 5.1.x that started development in early 2022, it's a powerful and open-source One-Person web framework used to build enterprise-grade Spring Boot applications with the powerful Groovy programming language. The core framework is very extensible and there are numerous Plugins available that provide easy integration of add-on features.
Grace inherits the excellent concepts and designs of Grails, and based on this, has undergone significant restructuring to ensure that each module is independent and decoupled, such as Grace API, Grace Boot, Grace CLI, Grace Plugin API, Grace Spring Boot, Grace Util. Meanwhile, in order to better focus on maintenance and upgrades, Grace also merged the previously spun-off modules, Converters plugin, GSP, Grace Test Support. Grace Boot, as an Auto-configuration, it will load all other modules and plugins. Grace follows good modular design, and these modules can be used independently in Spring Boot applications.
Spring is the foundation for Grace, which is built on top of Spring Boot. To better support Spring Boot and integrate with other Spring ecosystems, Grace has rewritten Plugin.doWithSpring()
using Spring Boot's Auto-configuration, which also reduces redundant configurations and provides significant performance improvements. Grace has also provided Configuration Metadata files include in Grace plugins' jars, the files are designed to let IDE developers offer contextual help and “code completion” as users are working with application.properties or application.yaml files. So, a Grace plugin is an extended Spring Boot Starter.
It is worth mentioning that Grace supports all current versions of Spring Boot, including 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, and the upcoming 3.5. This makes the upgrade path easier and more manageable.
Grace has been actively developing, bringing numerous improvements and new features, including Plugins, GSP, Console, Shell, and Profiles. Of course, it has also fixed a large number of legacy defects left in Grails 5, this makes developers happy.
You can learn more on the page What's New in Grace Framework.
Grace and Spring Boot frameworks are excellent for building web applications, but their use depends on what you want. Generally, Grace framework may be advantageous in full-stack and monolithic applications, but Spring Boot is preferred for developing complex and microservice applications.
Grace is not a replacement for Spring Boot, it is built on top of Spring Boot. It provides its' own Spring Boot Starters - Grace Boot, as an AutoConfiguration, it will load all other modules and plugins. Grace follows good modular design, and these modules can be used independently in Spring Boot applications. So, a Grace application is really a Spring Boot application.
Grace has better developer productivity than Spring Boot. Because it follows the convention over the configuration principle, it minimizes code requirements. This enhances productivity and fosters faster app development. The framework creates faster and more functional prototypes than Spring Boot due to its simple code generation like scaffolding and CoC.
Grace has better support Groovy than Spring Boot. Grace fully embraces Groovy to enable many features that would not be possible using Java alone, including flexible and powerful Plug-in architecture and a rich Plugin ecosystem and many built-in Dynamic Module types, many DSLs, AST Transformations, Trait-based solutions, and much more.
Grace provides a powerful CLI that allows you to quickly create new projects of many different types using Application Profiles and Templates and get started easily. These are all extensible and easy to customize, you can create your own Profiles, Templates, and Commands to meet any of your needs. The learning curve for Grace is moderate and more straightforward than Spring Boot due to its emphasis on convention and simplicity.
You can learn more on the page Grace vs Spring Boot.
You need a Java Development Kit (JDK) installed, but it is not necessary to install Groovy because it's bundled with the Grace distribution.
To install Grace, visit https://github.com/graceframework/grace-framework/releases and download the version you would like to use. Set a GRACE_HOME
environment variable to point to the root of the extracted download and add GRACE_HOME/bin
to your executable PATH
. Then in a shell, type the following:
$ grace create-app com.example.blog
$ cd blog
$ grace run-app
SDKMAN! (The Software Development Kit Manager) can be used for managing multiple versions of various binary SDKs, including Groovy, Gradle and the Grace. Get SDKMAN! from sdkman.io and install Grace by using the following commands:
$ sdk install grace
To build Grace, clone this GitHub repository and execute the install Gradle target:
$ git clone https://github.com/graceframework/grace-framework.git
$ cd grace-framework
$ ./gradlew pTML zipDist
If you encounter out of memory errors when trying to run the install target, try adjusting Gradle build settings. For example:
$ export GRADLE_OPTS="-Xmx2G -Xms2G -XX:NewSize=512m -XX:MaxNewSize=512m"
For installation instructions see INSTALL.txt.
Grace is first and foremost a web application framework, but it is also a platform. Grace provide Plugin API to expose a number of extension points that let you extend anything from the command line interface to the runtime configuration engine.
Grace Framework repository contains core plugins and most commonly used plugins, which are provided by default when creating a project.
- Grace Asset Pipeline Plugin is a plugin used for managing and processing static assets in Grace applications.
- Grace Async and Events provides asynchronous, parallel programming, Events APIs, which integrate Grace with various asynchronous libraries and frameworks such as GPars and RxJava.
- Grace Cache provides powerful and easy to use caching functionality to Grace applications and plugins.
- Grace Data Hibernate provides a GORM implementation for Hibernate ORM.
- Grace Data MongoDB provides a GORM implementation for the MongodB Document Database.
- Grace Database Migration helps you manage database changes uses the Liquibase library.
- Grace Scaffolding is a plugin to generate scaffolded controllers and views for your Grace application.
- Grace Fields is a plugin allows you to customize the rendering of input fields for properties of domain objects, command beans and POGOs based on their type, name, etc.
- Grace Geb provides the Geb dependencies and a
create-functional-test
command for generating Geb tests. - Grace Views includes JSON views powered by Groovy's JsonBuilder, also provides the basis for implementation other view types.
Grace Plugins repository contains several plugins to develop applications more easier and productive.
- Grace Admin is a powerful and flexible, extensible administration framework and management console for Grace, which use Grace Dynamic Modules.
- Grace Dynamic Modules Plugin is a powerful and flexible, extensible administration framework and management console for Grace.
- Grace Htmx is a plugin provide helpers to easy use HTMX.
- Grace Hotwire is a plugin for using Hotwire Stimulus and Turbo.
- Grace Unpoly is a plugin for using Unpoly.
- Grace View Components is a plugin for creating reusable, testable and encapsulated view components.
Grace profile is a simple directory that contains a profile.yml
file and directories containing the "commands", "skeleton" and "templates" defined by the profile.
Grace provides several profiles in the Grace Profiles repository,
base
- a profile for other profiles to extend fromplugin
- a profie to create a pluginprofile
- a profie to create a custom profilerest-api
- a profie for REST API applicationsstarter
- A profile for getting start to create anything you likeweb-plugin
- a profile for Web plugin that contains web resourcescss
js
images
web
- default profile to creae a web app
Grace Guides repository contains several guides that show how to use Grace.
- Spring Boot Application with Plugins is a how-to guide that shows you how to use Grace Plugins in your Spring Boot application.
- Spring Boot Application with GSP is a how-to guide that shows you how to use GSP as view templates in your Spring Boot application.
- Spring Boot Application with GORM is a how-to guide that shows you how to use GORM as data persistence layer in your Spring Boot application.
- Grace app and Spring Boot Test is a how-to guide that shows you how to use
@SpringBootTest
to test your Grace application. - Build Admin Console with Grace Admin Plugin is a how-to guide that shows you how to use Grace Admin plugin to build flexible, extensible management console in your application.
Grace framework is Open Source software released under the Apache License, Version 2.0.