# begzatmamatkarimov/iot-backend architecture

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

- Interactive diagram: https://gitdiagram.com/begzatmamatkarimov/iot-backend
- Repository: https://github.com/begzatmamatkarimov/iot-backend

## Overview

This Spring Boot backend exposes CRUD endpoints for IoT devices and stores device data in PostgreSQL. The README documents the API, the Device fields, and database configuration, but no source excerpts were provided; consequently, internal controller/service/repository wiring is shown only as unverified dashed relationships. The tree identifies those implementation layers, but their call paths could not be confirmed.

Main entry points: [`src/main/java/com/example/iotbackend/controller/DeviceController.java`](https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/controller/DeviceController.java) (Device controller), [`src/main/java/com/example/iotbackend/service/DeviceService.java`](https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/service/DeviceService.java) (Device service), [`src/main/java/com/example/iotbackend/repository/DeviceRepository.java`](https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/repository/DeviceRepository.java) (Device repository), [`src/main/resources/application.properties`](https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/resources/application.properties) (Database settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Device API"]
  node_controller["Device controller"]
  node_service["Device service<br/>[DeviceService.java]"]
end

subgraph group_domain["Device Domain"]
  node_device["Device model<br/>[Device.java]"]
end

subgraph group_persistence["Persistence"]
  node_repository["Device repository"]
  node_database[("PostgreSQL")]
  node_configuration["Database settings"]
end

node_client(("API client"))

node_client -->|"requests CRUD"| node_controller
node_controller -.->|"delegates to"| node_service
node_service -.->|"uses"| node_repository
node_repository -.->|"stores devices"| node_database
node_configuration -->|"configures connection"| node_database

click node_controller "https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/controller/DeviceController.java"
click node_service "https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/service/DeviceService.java"
click node_device "https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/model/Device.java"
click node_repository "https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/repository/DeviceRepository.java"
click node_configuration "https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/resources/application.properties"

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_controller,node_service,node_client toneBlue
class node_device toneAmber
class node_repository,node_database,node_configuration toneMint
```

## Components

### Device API

- [Device controller](https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/controller/DeviceController.java): `src/main/java/com/example/iotbackend/controller/DeviceController.java`
- [Device service](https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/service/DeviceService.java): `src/main/java/com/example/iotbackend/service/DeviceService.java`

### Device Domain

- [Device model](https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/model/Device.java): `src/main/java/com/example/iotbackend/model/Device.java`

### Persistence

- [Device repository](https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/java/com/example/iotbackend/repository/DeviceRepository.java): `src/main/java/com/example/iotbackend/repository/DeviceRepository.java`
- **PostgreSQL**
- [Database settings](https://github.com/begzatmamatkarimov/iot-backend/blob/main/src/main/resources/application.properties): `src/main/resources/application.properties`

### Other components

- **API client**

## Connections

- API client → Device controller: requests CRUD (evidence: `README.md`)
- Device controller → Device service: delegates to
- Device service → Device repository: uses
- Device repository → PostgreSQL: stores devices
- Database settings → PostgreSQL: configures connection (evidence: `README.md`)
