Skip to main content

Chat Server API

A modern real-time chat application with REST API backend and JavaFX desktop client. Build secure, scalable chat experiences with JWT authentication and WebSocket messaging.

Quick start

Get up and running with the Chat Server API in minutes

1

Install dependencies

Clone the repository and install Java 25+ and Gradle.
git clone https://github.com/brys0/CompSci330Final.git
cd CompSci330Final
2

Start the server

Launch the Spring Boot server on your local machine.
cd server
./gradlew bootRun
The server will start on http://localhost:8080 with OpenAPI docs at /swagger-ui.html.
3

Register a user

Create your first user account via the REST API.
cURL
curl -X POST http://localhost:8080/users/register \
  -H "Content-Type: application/json" \
  -d '{"username": "alice", "password": "mySecurePass123"}'
The server returns a JWT token valid for 30 days:
eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhbGljZSIsImlhdCI6MTcwOTU2NzgwMCwiZXhwIjoxNzEyMTU5ODAwfQ...
4

Make your first API call

Use the JWT token to authenticate and fetch your user profile.
cURL
curl -X GET http://localhost:8080/users/@me \
  -H "Authorization: YOUR_JWT_TOKEN"
All authenticated endpoints require the Authorization header with your JWT token.

Core features

Everything you need to build a production-ready chat application

JWT Authentication

Secure user authentication with BCrypt password hashing and JWT tokens valid for 30 days

Friend Relationships

Send, accept, and manage friend requests with bidirectional relationship tracking

Real-time Messaging

WebSocket support for instant message delivery with conversation management

OpenAPI Documentation

Interactive API documentation with Swagger UI for easy testing and exploration

Explore by topic

Deep dive into specific areas of the API

Server Setup

Install and configure the Spring Boot server

JavaFX Client

Set up the desktop client application

Architecture

Understand the system design and data models

Authentication

User registration, login, and token management

Relationships

Friend request and relationship endpoints

Error Handling

HTTP status codes and error response formats

Ready to build?

Follow the quickstart guide to get your chat server running in under 5 minutes.

Get started

Build docs developers (and LLMs) love