Educational backend project implementing a messaging system with Spring Boot. REST API, user management, message threading and standard Spring layered architecture.
A backend-only messaging service built to explore Spring Boot architecture. Covers the full request lifecycle from REST controller through service layer to JPA repository, with Spring Security for auth.
Designed as a learning project, the codebase demonstrates idiomatic Spring patterns: dependency injection, transaction management, DTO mapping and integration testing with MockMvc.
src/main/java/
โโโ messenger/
โโโ controller/
โ โโโ AuthController.java # /api/auth/*
โ โโโ UserController.java # /api/users/*
โ โโโ MessageController.java # /api/messages/*
โโโ service/
โ โโโ AuthService.java
โ โโโ UserService.java
โ โโโ MessageService.java
โโโ repository/
โ โโโ UserRepository.java
โ โโโ MessageRepository.java
โโโ model/
โ โโโ User.java
โ โโโ Message.java
โโโ dto/ # Request/response DTOs
โโโ security/ # JWT filter, Spring Security config
โโโ config/
# Auth POST /api/auth/register # { username, email, password } POST /api/auth/login # { email, password } โ JWT # Users GET /api/users/me # current user profile PUT /api/users/me # update profile # Messages GET /api/messages # ?with=userId&page=0&size=20 POST /api/messages # { recipientId, content } GET /api/conversations # list all conversations
# Requires Java 17+ and Maven mvn spring-boot:run # Runs on http://localhost:8080 # H2 console: http://localhost:8080/h2-console