# dannyshayh/warrantyproject architecture

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

- Interactive diagram: https://gitdiagram.com/dannyshayh/warrantyproject
- Repository: https://github.com/dannyshayh/warrantyproject

## Overview

Warranty Project is a Javalin backend for managing users’ products, registrations, receipts, and warranties. The principal workflow is a client request routed to a controller, through entity services and DAOs, into Hibernate-backed persistence; DTO conversion supports API responses. Route filters authenticate JWTs and enforce roles. Separate startup workflows fetch and persist Danish warranty-law text and schedule expiration reminders through SendGrid. The README documents the layered CRUD architecture and background capabilities; unsampled domain wiring is represented only at the documented layer boundaries.

Main entry points: [`src/main/java/app/daos`](https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/daos) (Domain DAOs), [`src/main/java/app/services/xmlServices/XmlService.java`](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/xmlServices/XmlService.java) (Law XML ingestion), [`src/main/java/app/routes/Routes.java`](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/routes/Routes.java) (REST routes), [`src/main/java/app/App.java`](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/App.java) (Application startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and security"]
  node_app["Application startup<br/>[App.java]"]
  node_routes["REST routes<br/>[Routes.java]"]
  node_controllers["Domain controllers"]
  node_security["Security controller"]
  node_security_service["JWT authorization"]
  node_jwt["JWT tokens"]
end

subgraph group_domain["Warranty domain"]
  node_services["Entity services"]
  node_converters["DTO converters"]
  node_entities["Domain entities"]
end

subgraph group_persistence["Persistence"]
  node_daos["Domain DAOs"]
  node_hibernate["Hibernate/JPA"]
  node_database[("PostgreSQL")]
end

subgraph group_background["Background services"]
  node_xml_service["Law XML ingestion<br/>[XmlService.java]"]
  node_xml_extractor["XML extraction<br/>[XMLExtractor.java]"]
  node_scheduler["Warranty scheduler"]
  node_sendgrid_service["Reminder startup"]
  node_email["Email service<br/>[EmailService.java]"]
end

node_client(("API client"))
node_law_source["Danish law XML"]
node_sendgrid["SendGrid"]

node_client -->|"sends requests"| node_routes
node_app -->|"configures"| node_routes
node_routes -->|"dispatches"| node_controllers
node_routes -->|"runs filters"| node_security
node_controllers -->|"delegates"| node_services
node_security -->|"validates tokens"| node_security_service
node_security -->|"verifies credentials"| node_daos
node_security_service -->|"creates and checks"| node_jwt
node_services -->|"converts DTOs"| node_converters
node_services -->|"accesses data"| node_daos
node_daos -->|"persists entities"| node_hibernate
node_hibernate -->|"reads and writes"| node_database
node_app -->|"starts ingestion"| node_xml_service
node_xml_service -->|"fetches XML"| node_law_source
node_xml_service -->|"extracts content"| node_xml_extractor
node_xml_service -->|"stores law data"| node_daos
node_app -->|"starts reminders"| node_sendgrid_service
node_sendgrid_service -->|"starts scheduler"| node_scheduler
node_scheduler -->|"checks warranties"| node_daos
node_scheduler -->|"sends reminders"| node_email
node_email -->|"submits email"| node_sendgrid

click node_app "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/App.java"
click node_routes "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/routes/Routes.java"
click node_controllers "https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/controllers"
click node_security "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/controllers/SecurityController.java"
click node_security_service "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/securityService/SecurityControllerService.java"
click node_jwt "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/tokenService/JwtTokenService.java"
click node_services "https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/services/entityServices"
click node_converters "https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/services/dtoConverter"
click node_entities "https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/entity"
click node_daos "https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/daos"
click node_hibernate "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/config/HibernateConfig.java"
click node_xml_service "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/xmlServices/XmlService.java"
click node_xml_extractor "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/xmlServices/XMLExtractor.java"
click node_scheduler "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/notificationServices/WarrantyScheduler.java"
click node_sendgrid_service "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/notificationServices/SendGridService.java"
click node_email "https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/notificationServices/EmailService.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_app,node_routes,node_controllers,node_security,node_security_service,node_jwt,node_client toneBlue
class node_services,node_converters,node_entities toneAmber
class node_daos,node_hibernate,node_database toneMint
class node_xml_service,node_xml_extractor,node_scheduler,node_sendgrid_service,node_email toneRose
class node_law_source,node_sendgrid toneIndigo
```

## Components

### API and security

- [Application startup](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/App.java): `src/main/java/app/App.java`
- [REST routes](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/routes/Routes.java): `src/main/java/app/routes/Routes.java`
- [Domain controllers](https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/controllers): `src/main/java/app/controllers`
- [Security controller](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/controllers/SecurityController.java): `src/main/java/app/controllers/SecurityController.java`
- [JWT authorization](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/securityService/SecurityControllerService.java): `src/main/java/app/services/securityService/SecurityControllerService.java`
- [JWT tokens](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/tokenService/JwtTokenService.java): `src/main/java/app/services/tokenService/JwtTokenService.java`

### Warranty domain

- [Entity services](https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/services/entityServices): `src/main/java/app/services/entityServices`
- [DTO converters](https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/services/dtoConverter): `src/main/java/app/services/dtoConverter`
- [Domain entities](https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/entity): `src/main/java/app/entity`

### Persistence

- [Domain DAOs](https://github.com/dannyshayh/warrantyproject/tree/main/src/main/java/app/daos): `src/main/java/app/daos`
- [Hibernate/JPA](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/config/HibernateConfig.java): `src/main/java/app/config/HibernateConfig.java`
- **PostgreSQL**

### Background services

- [Law XML ingestion](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/xmlServices/XmlService.java): `src/main/java/app/services/xmlServices/XmlService.java`
- [XML extraction](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/xmlServices/XMLExtractor.java): `src/main/java/app/services/xmlServices/XMLExtractor.java`
- [Warranty scheduler](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/notificationServices/WarrantyScheduler.java): `src/main/java/app/services/notificationServices/WarrantyScheduler.java`
- [Reminder startup](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/notificationServices/SendGridService.java): `src/main/java/app/services/notificationServices/SendGridService.java`
- [Email service](https://github.com/dannyshayh/warrantyproject/blob/main/src/main/java/app/services/notificationServices/EmailService.java): `src/main/java/app/services/notificationServices/EmailService.java`

### Other components

- **API client**
- **Danish law XML**
- **SendGrid**

## Connections

- API client → REST routes: sends requests
- Application startup → REST routes: configures
- REST routes → Domain controllers: dispatches
- REST routes → Security controller: runs filters
- Domain controllers → Entity services: delegates
- Security controller → JWT authorization: validates tokens
- Security controller → Domain DAOs: verifies credentials
- JWT authorization → JWT tokens: creates and checks
- Entity services → DTO converters: converts DTOs
- Entity services → Domain DAOs: accesses data
- Domain DAOs → Hibernate/JPA: persists entities
- Hibernate/JPA → PostgreSQL: reads and writes
- Application startup → Law XML ingestion: starts ingestion
- Law XML ingestion → Danish law XML: fetches XML
- Law XML ingestion → XML extraction: extracts content
- Law XML ingestion → Domain DAOs: stores law data
- Application startup → Reminder startup: starts reminders
- Reminder startup → Warranty scheduler: starts scheduler
- Warranty scheduler → Domain DAOs: checks warranties
- Warranty scheduler → Email service: sends reminders
- Email service → SendGrid: submits email
