# dinotaurent/notasappjava architecture

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

- Interactive diagram: https://gitdiagram.com/dinotaurent/notasappjava
- Repository: https://github.com/dinotaurent/notasappjava

## Overview

This is a Spring Boot notes API. Clients use the notes endpoints to list paginated notes, retrieve one, create, update, or delete; the controller delegates those operations to a service, which uses a Mongo repository for persistence. The API also exposes a separate status endpoint, validates note fields, and formats not-found and validation errors. MongoDB is indicated by the repository type and note document mapping; the runtime connection wiring was not shown, so that relationship is marked unverified.

Main entry points: [`src/main/java/com/dinotaurent/notas_app/service/NotaService.java`](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/service/NotaService.java) (Note Service), [`src/main/java/com/dinotaurent/notas_app/repository/NotaRepository.java`](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/repository/NotaRepository.java) (Note Repository), [`src/main/java/com/dinotaurent/notas_app/controller/NotaController.java`](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/controller/NotaController.java) (Notes Controller), [`src/main/java/com/dinotaurent/notas_app/exception/NotaNotFoundException.java`](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/exception/NotaNotFoundException.java) (Not Found Error)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_notes_controller["Notes Controller"]
  node_status_controller["Status Controller"]
  node_application["Spring Boot App"]
end

subgraph group_domain["Notes Domain"]
  node_note_service["Note Service<br/>[NotaService.java]"]
  node_page_response["Page Response"]
  node_nota["Note Document<br/>[Nota.java]"]
end

subgraph group_persistence["Persistence"]
  node_nota_repository["Note Repository"]
  node_mongodb[("MongoDB")]
end

subgraph group_errors["Error Handling"]
  node_not_found["Not Found Error"]
  node_exception_handler["API Exception Handler"]
end

node_client(("API Client"))

node_client -->|"calls notes API"| node_notes_controller
node_client -->|"checks status"| node_status_controller
node_notes_controller -->|"delegates operations"| node_note_service
node_note_service -->|"queries and saves"| node_nota_repository
node_note_service -->|"builds page"| node_page_response
node_nota_repository -->|"stores entities"| node_nota
node_nota_repository -.->|"persists via Mongo"| node_mongodb
node_note_service -->|"throws when absent"| node_not_found
node_exception_handler -->|"handles exception"| node_not_found

click node_notes_controller "https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/controller/NotaController.java"
click node_status_controller "https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/controller/StatusController.java"
click node_application "https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/NotasAppApplication.java"
click node_note_service "https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/service/NotaService.java"
click node_page_response "https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/service/NotaPageResponse.java"
click node_nota "https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/model/Nota.java"
click node_nota_repository "https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/repository/NotaRepository.java"
click node_not_found "https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/exception/NotaNotFoundException.java"
click node_exception_handler "https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/exception/GlobalExceptionHandler.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_notes_controller,node_status_controller,node_application,node_client toneBlue
class node_note_service,node_page_response,node_nota toneAmber
class node_nota_repository,node_mongodb toneMint
class node_not_found,node_exception_handler toneRose
```

## Components

### HTTP API

- [Notes Controller](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/controller/NotaController.java): `src/main/java/com/dinotaurent/notas_app/controller/NotaController.java`
- [Status Controller](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/controller/StatusController.java): `src/main/java/com/dinotaurent/notas_app/controller/StatusController.java`
- [Spring Boot App](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/NotasAppApplication.java): `src/main/java/com/dinotaurent/notas_app/NotasAppApplication.java`

### Notes Domain

- [Note Service](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/service/NotaService.java): `src/main/java/com/dinotaurent/notas_app/service/NotaService.java`
- [Page Response](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/service/NotaPageResponse.java): `src/main/java/com/dinotaurent/notas_app/service/NotaPageResponse.java`
- [Note Document](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/model/Nota.java): `src/main/java/com/dinotaurent/notas_app/model/Nota.java`

### Persistence

- [Note Repository](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/repository/NotaRepository.java): `src/main/java/com/dinotaurent/notas_app/repository/NotaRepository.java`
- **MongoDB**

### Error Handling

- [Not Found Error](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/exception/NotaNotFoundException.java): `src/main/java/com/dinotaurent/notas_app/exception/NotaNotFoundException.java`
- [API Exception Handler](https://github.com/dinotaurent/notasappjava/blob/main/src/main/java/com/dinotaurent/notas_app/exception/GlobalExceptionHandler.java): `src/main/java/com/dinotaurent/notas_app/exception/GlobalExceptionHandler.java`

### Other components

- **API Client**

## Connections

- API Client → Notes Controller: calls notes API (evidence: `src/main/java/com/dinotaurent/notas_app/controller/NotaController.java`)
- API Client → Status Controller: checks status (evidence: `src/main/java/com/dinotaurent/notas_app/controller/StatusController.java`)
- Notes Controller → Note Service: delegates operations (evidence: `src/main/java/com/dinotaurent/notas_app/controller/NotaController.java`)
- Note Service → Note Repository: queries and saves (evidence: `src/main/java/com/dinotaurent/notas_app/service/NotaService.java`)
- Note Service → Page Response: builds page (evidence: `src/main/java/com/dinotaurent/notas_app/service/NotaService.java`)
- Note Repository → Note Document: stores entities (evidence: `src/main/java/com/dinotaurent/notas_app/repository/NotaRepository.java`)
- Note Repository → MongoDB: persists via Mongo
- Note Service → Not Found Error: throws when absent (evidence: `src/main/java/com/dinotaurent/notas_app/service/NotaService.java`)
- API Exception Handler → Not Found Error: handles exception (evidence: `src/main/java/com/dinotaurent/notas_app/exception/GlobalExceptionHandler.java`)
