Skip to main content
The Brautcloud backend is a Spring Boot 4.0.2 application that requires Java 25, PostgreSQL database, and AWS S3 for image storage.

Prerequisites

1

Install Java 25

The backend requires Java 25 to run. Verify your installation:
java -version
You should see output indicating Java 25 is installed.
2

Install Maven

Apache Maven is required to build the application:
mvn -version
3

Set up PostgreSQL

Ensure you have a PostgreSQL database running and accessible. See the database setup guide for details.
4

Configure AWS S3

You’ll need an AWS S3 bucket or S3-compatible storage for image uploads. Obtain your access credentials before proceeding.

Environment variables

The backend requires several environment variables to be configured. Create these before running the application:
export POSTGRES_URL="jdbc:postgresql://localhost:5432/brautcloud"
export POSTGRES_USER="your_db_user"
export POSTGRES_PW="your_db_password"
export JWT_SECRET="your-secret-key-min-256-bits"
export AWS_ACCESS_KEY_ID="your_aws_access_key"
export AWS_SECRET_ACCESS_KEY="your_aws_secret_key"
export AWS_ENDPOINT="https://s3.us-east-1.amazonaws.com"

Configuration details

VariableDescriptionExample
POSTGRES_URLJDBC connection string to your PostgreSQL databasejdbc:postgresql://localhost:5432/brautcloud
POSTGRES_USERDatabase usernamebrautcloud_user
POSTGRES_PWDatabase passwordsecure_password
JWT_SECRETSecret key for JWT token signing (minimum 256 bits)Generated using openssl rand -base64 32
AWS_ACCESS_KEY_IDAWS access key for S3From AWS IAM
AWS_SECRET_ACCESS_KEYAWS secret key for S3From AWS IAM
AWS_ENDPOINTS3 endpoint URLhttps://s3.us-east-1.amazonaws.com
The JWT secret should be a strong, randomly generated string. You can generate one using:
openssl rand -base64 32
Never commit environment variables or secrets to version control. Use environment-specific configuration management.

Build the application

Navigate to the backend directory and build the application using Maven:
cd brautcloud-backend
mvn clean package
This will:
  1. Compile the Java source code
  2. Run all tests
  3. Create an executable JAR file in the target/ directory
The build process includes the Spring Java Format plugin that validates code formatting during the build.
If you want to skip tests during the build, use mvn clean package -DskipTests

Run the application

After building, you can run the application in several ways:
mvn spring-boot:run
The application will start on port 8080 by default (Spring Boot default). You should see output indicating:
  • Database connection established
  • JPA entities mapped to database tables
  • Application started successfully

Application configuration

The backend uses the following key configurations from application.properties:
# Application name
spring.application.name=brautcloud

# Database initialization
spring.sql.init.mode=always

# File upload limits
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB

# AWS S3 configuration
aws.s3.region=us-east-1
aws.s3.bucket=brautcloud

# JWT token configuration
jwt.token.expires=86400000
jwt.token.refreshExpires=30d

Key settings

  • File upload limit: 10MB per file
  • JWT access token expiry: 24 hours (86400000ms)
  • JWT refresh token expiry: 30 days
  • S3 bucket: brautcloud in us-east-1 region
You can override any property using environment variables or command-line arguments:
java -jar target/brautcloud-0.0.1-SNAPSHOT.jar --spring.servlet.multipart.max-file-size=20MB

Health checks

The application includes Spring Boot Actuator for monitoring. Once running, you can check the application health:
curl http://localhost:8080/actuator/health
Expected response:
{
  "status": "UP"
}

Production considerations

1

Use production database

Configure a production PostgreSQL instance with proper backups and high availability.
2

Secure environment variables

Use a secrets management service (AWS Secrets Manager, HashiCorp Vault, etc.) instead of plain environment variables.
3

Enable HTTPS

Configure SSL/TLS certificates for secure communication. Use a reverse proxy like Nginx or deploy behind a load balancer.
4

Configure logging

Set up centralized logging and reduce debug logging:
logging.level.org.springframework.security=WARN
5

Set up monitoring

Configure actuator endpoints for production monitoring and integrate with monitoring tools.

Troubleshooting

Database connection failed

If you see database connection errors:
  1. Verify PostgreSQL is running
  2. Check the POSTGRES_URL format is correct
  3. Ensure the database exists
  4. Verify user credentials and permissions

S3 upload errors

If image uploads fail:
  1. Verify AWS credentials are correct
  2. Check S3 bucket exists and is accessible
  3. Ensure bucket permissions allow PUT operations
  4. Verify the endpoint URL matches your region

JWT token errors

If authentication fails:
  1. Ensure JWT_SECRET is set and is at least 256 bits
  2. Check token expiry settings
  3. Verify the secret is consistent across restarts

Next steps

Frontend deployment

Deploy the Angular frontend application

Database setup

Configure PostgreSQL database and schema

Build docs developers (and LLMs) love