Skip to content

CleverCloud/vaadin-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clever Cloud logo

Vaadin Example Application in Clever Cloud

Clever Cloud - PaaS

This is a simple Vaadin application that demonstrates how to build a Java web application with Vaadin and Spring Boot and deploy it to Clever Cloud.

About the Application

This application provides a simple task management UI built with Vaadin Flow components.

Technology Stack

  • Vaadin - A full-stack framework for building web apps in Java
  • Spring Boot - Java application framework
  • Java 21
  • Maven

Prerequisites

  • JDK 21+
  • Maven 3.8.1+

Maven Wrapper

This project uses the Maven Wrapper (mvnw) so that you don't need to have a specific Maven version installed. Clever Cloud natively supports the Maven Wrapper — if a .mvn/wrapper/maven-wrapper.properties file is present, it will use the Maven version specified there.

To generate the wrapper configuration, run:

mvn wrapper:wrapper

This creates the .mvn/wrapper/ directory with the required configuration. Once generated, you can use ./mvnw instead of mvn for all commands.

Running the Application Locally

Development Mode

./mvnw spring-boot:run

This command starts the application in development mode. The application will be accessible at http://localhost:8080.

Production Mode

./mvnw package -Pproduction
java -jar ./target/app-1.0-SNAPSHOT.jar

Deploying on Clever Cloud

You have two options to deploy your Vaadin application on Clever Cloud: using the Web Console or using the Clever Tools CLI.

Option 1: Deploy using the Web Console

1. Create an account on Clever Cloud

If you don't already have an account, go to the Clever Cloud console and follow the registration instructions.

2. Set up your application on Clever Cloud

  1. Log in to the Clever Cloud console
  2. Click on "Create" and select "An application"
  3. Choose "Java + Maven" as the runtime environment
  4. Configure your application settings (name, region, etc.)

3. Configure Environment Variables

Add the following environment variables in the Clever Cloud console:

Variable Value Description
CC_JAVA_VERSION 21 Specifies to use Java 21
MAVEN_PROFILES production Activates the Vaadin production profile
CC_RUN_COMMAND java -jar ./target/app-1.0-SNAPSHOT.jar Specifies the executable to run

4. Deploy Your Application

You can deploy your application using Git:

# Add Clever Cloud as a remote repository
git remote add clever git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/app_<your-app-id>.git

# Push your code to deploy
git push clever master

Option 2: Deploy using Clever Tools CLI

1. Install Clever Tools

Install the Clever Tools CLI following the official documentation:

# Using npm
npm install -g clever-tools

# Or using Homebrew (macOS)
brew install clever-tools

2. Log in to your Clever Cloud account

clever login

3. Create a new application

# Step 1: Initialize the current directory as a Clever Cloud application
clever create --type maven <YOUR_APP_NAME>

# Step 2: Add your domain (optional but recommended)
clever domain add <YOUR_DOMAIN_NAME>

# Step 3: Set the required environment variables
clever env set CC_JAVA_VERSION 21
clever env set MAVEN_PROFILES production
clever env set CC_RUN_COMMAND "java -jar ./target/app-1.0-SNAPSHOT.jar"

4. Deploy your application

clever deploy

5. Open your application in a browser

Once deployed, you can access your application at https://<YOUR_DOMAIN_NAME>/.

Screenshot

Monitoring Your Application

Once deployed, you can monitor your application through:

  • Web Console: The Clever Cloud console provides logs, metrics, and other tools to help you manage your application.
  • CLI: Use clever logs to view application logs and clever status to check the status of your application.

Additional Resources

About

# Vaadin Example Application in Clever Cloud Follow link (cmd + click) Follow link (cmd + click)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors