Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Rubick65/calenderyBack/llms.txt
Use this file to discover all available pages before exploring further.
What is CalenderyBack?
CalenderyBack is the backend service powering a social calendar application. It is built with Spring Boot 4 on Java 21 and exposes a combined REST + WebSocket API that handles everything from user accounts and publications to real-time chat.| Attribute | Value |
|---|---|
| Framework | Spring Boot 4.0.3 |
| Language | Java 21 |
| Architecture | Hexagonal (Ports & Adapters) |
| Database | PostgreSQL (via Spring Data JPA / Hibernate) |
| File Storage | Supabase Storage (profile avatars bucket) |
| Security | Spring Security — HTTP Basic authentication |
| Real-time | STOMP over WebSocket (/ws-endpoint) |
| Spring Mail (SMTP / Gmail) |
Functional Domains
CalenderyBack is organised into six cohesive functional domains, each with its own package tree undercom.rubenmartin.calenderyback:
| Domain | Responsibility |
|---|---|
| Users | Registration, authentication, profile settings, avatar upload, public-key exchange |
| Publications | Create, read, and manage social calendar posts |
| Comments & Likes | Threaded comments and like reactions on publications |
| Followers | Social graph — follow/unfollow, follower counts, feed curation |
| Chat | Peer-to-peer chat rooms created between two users |
| Messages | Individual messages within a chat, delivered in real-time over WebSocket |
Architecture Overview
CalenderyBack follows the hexagonal (ports-and-adapters) architecture: the domain layer has no dependency on the framework layer, and all cross-layer communication flows through well-defined interfaces.Layer breakdown
Mediator pattern
All application-layer operations — whether commands (writes) or queries (reads) — are dispatched through a centralMediator bean. Each operation is encapsulated in a Request object and handled by a dedicated RequestHandler:
Request + RequestHandler pair — the controller and the mediator wiring need no changes.
Authentication Model
CalenderyBack uses HTTP Basic authentication managed by Spring Security.- Public routes (no credentials required): registration, email confirmation, token resend, user validation.
- Protected routes (
/api/users/app/**,/api/publication/app/**,/api/chat/**,/ws-endpoint/**): requireROLE_USER. - Ownership-guarded routes: sensitive endpoints additionally use
@PreAuthorizeto verify the authenticated user matches the resource owner.
Real-time Capability
Chat messages are delivered in real-time using STOMP over WebSocket, mounted at/ws-endpoint. The WebSocket layer is secured by the same Spring Security filter chain — only ROLE_USER principals may connect. Clients subscribe to per-chat topics and receive pushed message events without polling.
Key Dependencies
| Library | Purpose |
|---|---|
spring-boot-starter-webmvc | REST API |
spring-boot-starter-security | HTTP Basic auth, method-level security |
spring-boot-starter-data-jpa | ORM / database access (PostgreSQL) |
spring-boot-starter-websocket | STOMP / WebSocket real-time messaging |
spring-boot-starter-mail | Email verification on registration |
spring-boot-starter-validation | Bean Validation (@NotBlank, @Valid) |
mapstruct 1.6.2 | DTO ↔ domain / entity mapping |
lombok | Boilerplate reduction (@Data, etc.) |
CalenderyBack follows the hexagonal (ports-and-adapters) architecture pattern. Domain entities and business rules live in the
domain package and are completely framework-free. The application layer contains use-case commands and queries. The infrastructure layer provides JPA implementations and REST controllers — both of which are treated as adapters that plug into the domain ports. This separation ensures the core business logic can be tested in isolation without loading the Spring context.Explore the Docs
Quickstart
Run the server locally, register a user, confirm your email, and make your first authenticated API call in five steps.
Authentication
Understand HTTP Basic auth, the registration + email verification flow, public vs protected routes, and public-key exchange.
Architecture Concepts
Dive deeper into the hexagonal architecture, the Mediator pattern, and how commands and queries are structured.
API Reference
Full endpoint reference for all six domains: Users, Publications, Comments & Likes, Followers, Chat, and Messages.