Prerequisites
Install Java 25
The backend requires Java 25 to run. Verify your installation:You should see output indicating Java 25 is installed.
Set up PostgreSQL
Ensure you have a PostgreSQL database running and accessible. See the database setup guide for details.
Environment variables
The backend requires several environment variables to be configured. Create these before running the application:Configuration details
| Variable | Description | Example |
|---|---|---|
POSTGRES_URL | JDBC connection string to your PostgreSQL database | jdbc:postgresql://localhost:5432/brautcloud |
POSTGRES_USER | Database username | brautcloud_user |
POSTGRES_PW | Database password | secure_password |
JWT_SECRET | Secret key for JWT token signing (minimum 256 bits) | Generated using openssl rand -base64 32 |
AWS_ACCESS_KEY_ID | AWS access key for S3 | From AWS IAM |
AWS_SECRET_ACCESS_KEY | AWS secret key for S3 | From AWS IAM |
AWS_ENDPOINT | S3 endpoint URL | https://s3.us-east-1.amazonaws.com |
The JWT secret should be a strong, randomly generated string. You can generate one using:
Build the application
Navigate to the backend directory and build the application using Maven:- Compile the Java source code
- Run all tests
- Create an executable JAR file in the
target/directory
If you want to skip tests during the build, use
mvn clean package -DskipTestsRun the application
After building, you can run the application in several ways:- Database connection established
- JPA entities mapped to database tables
- Application started successfully
Application configuration
The backend uses the following key configurations fromapplication.properties:
Key settings
- File upload limit: 10MB per file
- JWT access token expiry: 24 hours (86400000ms)
- JWT refresh token expiry: 30 days
- S3 bucket:
brautcloudinus-east-1region
You can override any property using environment variables or command-line arguments:
Health checks
The application includes Spring Boot Actuator for monitoring. Once running, you can check the application health:Production considerations
Use production database
Configure a production PostgreSQL instance with proper backups and high availability.
Secure environment variables
Use a secrets management service (AWS Secrets Manager, HashiCorp Vault, etc.) instead of plain environment variables.
Enable HTTPS
Configure SSL/TLS certificates for secure communication. Use a reverse proxy like Nginx or deploy behind a load balancer.
Troubleshooting
Database connection failed
If you see database connection errors:- Verify PostgreSQL is running
- Check the
POSTGRES_URLformat is correct - Ensure the database exists
- Verify user credentials and permissions
S3 upload errors
If image uploads fail:- Verify AWS credentials are correct
- Check S3 bucket exists and is accessible
- Ensure bucket permissions allow PUT operations
- Verify the endpoint URL matches your region
JWT token errors
If authentication fails:- Ensure
JWT_SECRETis set and is at least 256 bits - Check token expiry settings
- Verify the secret is consistent across restarts
Next steps
Frontend deployment
Deploy the Angular frontend application
Database setup
Configure PostgreSQL database and schema