https://github.com/buttercms/java-starter-buttercms
Drop-in proof-of-concept Java + Spring app, fully integrated with your ButterCMS account
https://github.com/buttercms/java-starter-buttercms
blog blog-engine butter buttercms cms java starter starter-kit starter-project
Last synced: 3 months ago
JSON representation
Drop-in proof-of-concept Java + Spring app, fully integrated with your ButterCMS account
- Host: GitHub
- URL: https://github.com/buttercms/java-starter-buttercms
- Owner: ButterCMS
- Created: 2022-05-10T13:46:58.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-19T10:10:17.000Z (4 months ago)
- Last Synced: 2025-04-20T23:04:22.867Z (3 months ago)
- Topics: blog, blog-engine, butter, buttercms, cms, java, starter, starter-kit, starter-project
- Language: CSS
- Homepage: https://java-starter-buttercms.herokuapp.com/
- Size: 774 KB
- Stars: 0
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
  
# Java Spring Boot + ButterCMS Starter Project
This Java + Spring Boot starter project fully integrates with dynamic sample
content from your ButterCMS account, including main menu, pages, blog posts,
categories, and tags, all with a beautiful, custom theme with already-implemented
search functionality. All of the included sample content is automatically created
in your account dashboard when you sign up for a free trial of ButterCMS.[View our live demo hosted at Heroku](https://java-starter-buttercms.herokuapp.com/), or you can click a button below
to deploy your own copy of our starter project to the provider of your choice.[](https://heroku.com/deploy?template=https://github.com/ButterCMS/java-starter-buttercms&env%5BJAVA_BUTTER_CMS_API_KEY%5D=check%20https://buttercms.com/settings)
## 1. Installation
### Prerequisites
This project requires Java 17 and Maven. All other dependencies (Spring Boot, Java SDK for ButterCMS) are automatically managed by Maven.
#### Installing Java 17 and Maven on Ubuntu
```bash
# Update package list and install OpenJDK 17
sudo apt update && sudo apt install openjdk-17-jdk
# Install Maven
sudo apt install maven
```#### Installing Java 17 and Maven on macOS
```bash
# Using Homebrew
brew install --cask temurin@17
# Install Maven
brew install maven
```To get started, clone and cd into the repo.
```bash
git clone https://github.com/ButterCMS/java-starter-buttercms.git
cd java-starter-buttercms
```### 2. Set API Token
To fetch your ButterCMS content, add your API token as an environment variable.
```bash
$ echo 'JAVA_BUTTER_CMS_API_KEY=' >> .env
```### 3. Build the project
Build the project with the following command
```bash
$ mvn install
```### 4. Run the project
To view the app in the browser, you'll need to run the local development server:
```bash
$ mvn spring-boot:run
```
Alternatively, you can run it directly via the `java` command```bash
$ java -jar target/spring-starter-buttercms-*.jar
```where the file name `spring-starter-buttercms` will be appended by the value of the version tag `` in [pom.xml](pom.xml)
Congratulations! Your starter project is now live. To view your project,
point your browser to [http://localhost:8080](http://localhost:8080).## 5. Deploy on Heroku
Deploy your Spring Boot app using Heroku. With a single click, you'll create a
copy of our starter project in your Git provider account, instantly deploy it,
and institute a full content workflow connected to your ButterCMS account. Smooth.[](https://heroku.com/deploy?template=https://github.com/ButterCMS/java-starter-buttercms&env%5BJAVA_BUTTER_CMS_API_KEY%5D=check%20https://buttercms.com/settings)
### 6. Previewing Draft Changes
By default, your starter project is set up to allow previewing of draft changes
saved in your ButterCMS.com account. To disable this functionality, set the
following value in your .env file: `JAVA_BUTTER_CMS_PREVIEW=false`