# luismangoataulfo/cinematch-backend architecture

> Architecture diagram of the GitHub repository luismangoataulfo/cinematch-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/luismangoataulfo/cinematch-backend
- Repository: https://github.com/luismangoataulfo/cinematch-backend

## Overview

Cinematch Backend is a Spring REST/WebSocket application for discovering shared movie and series recommendations. Users authenticate, create or join a room, apply content filters, and retrieve room matches; they can then chat and receive real-time room events. Supporting flows manage profiles, platforms, ratings, evaluations, feedback, metrics, and administration. The sampled code confirms authentication, JWT invalidation, room lifecycle, filtering repositories, and WebSocket notifications; several surrounding capabilities are represented from the repository tree, with uncertain internal call wiring omitted.

Main entry points: [`src/main/java/com/cinematchbackend/services/impl/SalaServiceImpl.java`](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/SalaServiceImpl.java) (Room Service), [`src/main/java/com/cinematchbackend/config/JwtService.java`](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/config/JwtService.java) (JWT Service), [`src/main/java/com/cinematchbackend/controllers/AuthController.java`](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/controllers/AuthController.java) (Auth API), [`src/main/java/com/cinematchbackend/repositories/UsuarioRepository.java`](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/UsuarioRepository.java) (User Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API Layer"]
  node_auth_controller["Auth API"]
  node_sala_controller["Room API"]
  node_filtro_controller["Filter API"]
end

subgraph group_identity["Identity"]
  node_jwt_filter["JWT Filter"]
  node_jwt_service["JWT Service<br/>[JwtService.java]"]
  node_usuario_service["User Service"]
  node_usuario_repo["User Store"]
  node_token_repo["Token Store"]
end

subgraph group_discovery["Discovery"]
  node_filter_service["Filter Service"]
  node_filter_context["Filter Context<br/>[FiltroContext.java]"]
  node_filter_strategies["Filter Strategies"]
  node_content_repo["Content Store"]
  node_match_service["Match Service"]
end

subgraph group_collab["Room Collaboration"]
  node_room_service["Room Service"]
  node_room_repo["Room Store"]
  node_match_repo["Match Store"]
  node_realtime["Realtime Gateway"]
  node_presence["Presence Events"]
  node_chat_service["Chat Service"]
  node_message_repo["Message Store"]
end

subgraph group_support["Supporting Domains"]
  node_platform_service["Platform Service"]
  node_feedback_service["Feedback Services"]
  node_metrics_service["Metrics Service"]
end

node_user(("User"))
node_admin(("Administrator"))
node_app_db[("Application Database")]

node_user -->|"authenticates"| node_auth_controller
node_admin -->|"authenticates"| node_auth_controller
node_auth_controller -->|"calls"| node_usuario_service
node_usuario_service -->|"reads/writes"| node_usuario_repo
node_jwt_filter -->|"validates"| node_jwt_service
node_jwt_service -->|"checks invalidation"| node_token_repo
node_jwt_service -->|"stores invalidation"| node_token_repo
node_usuario_repo -->|"persists users"| node_app_db
node_token_repo -->|"persists tokens"| node_app_db
node_user -->|"manages rooms"| node_sala_controller
node_sala_controller -->|"calls"| node_room_service
node_room_service -->|"reads/writes"| node_room_repo
node_room_service -->|"loads users"| node_usuario_repo
node_room_service -->|"loads matches"| node_match_repo
node_room_service -->|"clears messages"| node_message_repo
node_room_service -->|"broadcasts events"| node_realtime
node_presence -->|"handles presence"| node_realtime
node_user -->|"filters content"| node_filtro_controller
node_filtro_controller -->|"calls"| node_filter_service
node_filter_service -->|"selects strategy"| node_filter_context
node_filter_context -->|"dispatches"| node_filter_strategies
node_filter_strategies -->|"queries content"| node_content_repo
node_content_repo -->|"reads content"| node_app_db
node_match_service -->|"stores matches"| node_match_repo
node_chat_service -->|"stores messages"| node_message_repo
node_message_repo -->|"persists messages"| node_app_db
node_platform_service -.->|"supports availability"| node_content_repo

click node_auth_controller "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/controllers/AuthController.java"
click node_sala_controller "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/controllers/SalaController.java"
click node_filtro_controller "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/controllers/FiltroController.java"
click node_jwt_filter "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/config/JwtAuthenticationFilter.java"
click node_jwt_service "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/config/JwtService.java"
click node_usuario_service "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/UsuarioServiceImpl.java"
click node_usuario_repo "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/UsuarioRepository.java"
click node_token_repo "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/TokenInvalidadoRepository.java"
click node_room_service "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/SalaServiceImpl.java"
click node_room_repo "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/SalaRepository.java"
click node_match_repo "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/MatchRepository.java"
click node_realtime "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/config/WebSocketConfig.java"
click node_presence "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/config/PresenciaEventListener.java"
click node_chat_service "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/ChatServiceImpl.java"
click node_message_repo "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/MensajeRepository.java"
click node_filter_service "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/FiltroServiceImpl.java"
click node_filter_context "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/strategy/FiltroContext.java"
click node_filter_strategies "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/strategy/FiltroStrategy.java"
click node_content_repo "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/ContenidoRepository.java"
click node_match_service "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/MatchServiceImpl.java"
click node_platform_service "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/PlataformaServiceImpl.java"
click node_feedback_service "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/RetroalimentacionServiceImpl.java"
click node_metrics_service "https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/MetricasServiceImpl.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth_controller,node_sala_controller,node_filtro_controller,node_user toneBlue
class node_jwt_filter,node_jwt_service,node_usuario_service,node_usuario_repo,node_token_repo,node_app_db toneAmber
class node_filter_service,node_filter_context,node_filter_strategies,node_content_repo,node_match_service toneMint
class node_room_service,node_room_repo,node_match_repo,node_realtime,node_presence,node_chat_service,node_message_repo toneRose
class node_platform_service,node_feedback_service,node_metrics_service,node_admin toneIndigo
```

## Components

### API Layer

- [Auth API](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/controllers/AuthController.java): `src/main/java/com/cinematchbackend/controllers/AuthController.java`
- [Room API](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/controllers/SalaController.java): `src/main/java/com/cinematchbackend/controllers/SalaController.java`
- [Filter API](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/controllers/FiltroController.java): `src/main/java/com/cinematchbackend/controllers/FiltroController.java`

### Identity

- [JWT Filter](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/config/JwtAuthenticationFilter.java): `src/main/java/com/cinematchbackend/config/JwtAuthenticationFilter.java`
- [JWT Service](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/config/JwtService.java): `src/main/java/com/cinematchbackend/config/JwtService.java`
- [User Service](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/UsuarioServiceImpl.java): `src/main/java/com/cinematchbackend/services/impl/UsuarioServiceImpl.java`
- [User Store](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/UsuarioRepository.java): `src/main/java/com/cinematchbackend/repositories/UsuarioRepository.java`
- [Token Store](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/TokenInvalidadoRepository.java): `src/main/java/com/cinematchbackend/repositories/TokenInvalidadoRepository.java`

### Discovery

- [Filter Service](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/FiltroServiceImpl.java): `src/main/java/com/cinematchbackend/services/impl/FiltroServiceImpl.java`
- [Filter Context](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/strategy/FiltroContext.java): `src/main/java/com/cinematchbackend/strategy/FiltroContext.java`
- [Filter Strategies](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/strategy/FiltroStrategy.java): `src/main/java/com/cinematchbackend/strategy/FiltroStrategy.java`
- [Content Store](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/ContenidoRepository.java): `src/main/java/com/cinematchbackend/repositories/ContenidoRepository.java`
- [Match Service](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/MatchServiceImpl.java): `src/main/java/com/cinematchbackend/services/impl/MatchServiceImpl.java`

### Room Collaboration

- [Room Service](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/SalaServiceImpl.java): `src/main/java/com/cinematchbackend/services/impl/SalaServiceImpl.java`
- [Room Store](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/SalaRepository.java): `src/main/java/com/cinematchbackend/repositories/SalaRepository.java`
- [Match Store](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/MatchRepository.java): `src/main/java/com/cinematchbackend/repositories/MatchRepository.java`
- [Realtime Gateway](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/config/WebSocketConfig.java): `src/main/java/com/cinematchbackend/config/WebSocketConfig.java`
- [Presence Events](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/config/PresenciaEventListener.java): `src/main/java/com/cinematchbackend/config/PresenciaEventListener.java`
- [Chat Service](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/ChatServiceImpl.java): `src/main/java/com/cinematchbackend/services/impl/ChatServiceImpl.java`
- [Message Store](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/repositories/MensajeRepository.java): `src/main/java/com/cinematchbackend/repositories/MensajeRepository.java`

### Supporting Domains

- [Platform Service](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/PlataformaServiceImpl.java): `src/main/java/com/cinematchbackend/services/impl/PlataformaServiceImpl.java`
- [Feedback Services](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/RetroalimentacionServiceImpl.java): `src/main/java/com/cinematchbackend/services/impl/RetroalimentacionServiceImpl.java`
- [Metrics Service](https://github.com/luismangoataulfo/cinematch-backend/blob/master/src/main/java/com/cinematchbackend/services/impl/MetricasServiceImpl.java): `src/main/java/com/cinematchbackend/services/impl/MetricasServiceImpl.java`

### Other components

- **User**
- **Administrator**
- **Application Database**

## Connections

- User → Auth API: authenticates
- Administrator → Auth API: authenticates
- Auth API → User Service: calls
- User Service → User Store: reads/writes
- JWT Filter → JWT Service: validates
- JWT Service → Token Store: checks invalidation
- JWT Service → Token Store: stores invalidation
- User Store → Application Database: persists users
- Token Store → Application Database: persists tokens
- User → Room API: manages rooms
- Room API → Room Service: calls
- Room Service → Room Store: reads/writes
- Room Service → User Store: loads users
- Room Service → Match Store: loads matches
- Room Service → Message Store: clears messages
- Room Service → Realtime Gateway: broadcasts events
- Presence Events → Realtime Gateway: handles presence
- User → Filter API: filters content
- Filter API → Filter Service: calls
- Filter Service → Filter Context: selects strategy
- Filter Context → Filter Strategies: dispatches
- Filter Strategies → Content Store: queries content
- Content Store → Application Database: reads content
- Match Service → Match Store: stores matches
- Chat Service → Message Store: stores messages
- Message Store → Application Database: persists messages
- Platform Service → Content Store: supports availability
