Skip to main content

Prerequisites

Before installing the Chat Server API, ensure you have the following installed on your system:
1

Java Development Kit (JDK) 25

The server requires JDK 25 as specified in build.gradle.kts:13. Download and install from Oracle or use a package manager.
# Verify Java installation
java -version
You should see output indicating Java 25 or higher.
2

Gradle (optional)

The project includes Gradle wrapper scripts (gradlew and gradlew.bat), so you don’t need to install Gradle separately. The wrapper will download the correct Gradle version automatically.
If you’re on Windows, use gradlew.bat instead of ./gradlew in all commands throughout this documentation.

Clone the repository

Clone the Chat Server API repository to your local machine:
git clone <repository-url>
cd server

Dependencies

The project uses Spring Boot 4.0.2 and includes the following key dependencies (from build.gradle.kts:27-62):

Core dependencies

  • Spring Boot Starter Data JPA - Database persistence
  • Spring Boot Starter Validation - Request validation
  • Spring Boot Starter WebMVC - REST API endpoints
  • Spring Boot Starter WebSocket - Real-time messaging
  • Spring Boot Starter Security - Authentication and authorization
  • Spring Boot Starter Actuator - Health checks and metrics

Database

  • SQLite JDBC (3.41.2.2) - Primary database driver
  • H2 Database - Alternative embedded database (runtime)
  • Hibernate Community Dialects - SQLite dialect support

Security

  • JJWT API (0.11.5) - JWT token generation and validation
  • JJWT Implementation (0.11.5) - JWT runtime implementation
  • JJWT Jackson (0.11.5) - JSON parsing for JWTs
  • BCrypt Password Encoder - Password hashing

Documentation

  • SpringDoc OpenAPI Starter Common (3.0.1)
  • SpringDoc OpenAPI Starter WebMVC UI (3.0.1) - Swagger UI integration

Development tools

  • Lombok - Reduces boilerplate code
  • Spring Boot DevTools - Hot reload during development

Build the project

1

Navigate to the server directory

cd server
2

Build the project

Use the Gradle wrapper to download dependencies and build the project:
./gradlew build
This command will:
  • Download all dependencies from Maven Central
  • Compile the Java source code
  • Run unit tests
  • Package the application into a JAR file
3

Skip tests (optional)

If you want to build without running tests:
./gradlew build -x test
The first build may take several minutes as Gradle downloads all dependencies. Subsequent builds will be much faster.

Build output

After a successful build, you’ll find the compiled JAR file at:
server/build/libs/server-0.0.1-SNAPSHOT.jar
You can run this JAR directly using:
java -jar build/libs/server-0.0.1-SNAPSHOT.jar

Troubleshooting

Java version mismatch

If you see an error about Java version compatibility:
Unsupported class file major version
Verify you’re using JDK 25:
java -version
./gradlew --version

Permission denied on gradlew

On Linux/macOS, if you get a permission error:
chmod +x gradlew
./gradlew build

Build failures

For general build issues, try cleaning the build directory:
./gradlew clean build

Build docs developers (and LLMs) love