# gowtham1103/restapi architecture

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

- Interactive diagram: https://gitdiagram.com/gowtham1103/restapi
- Repository: https://github.com/gowtham1103/restapi

## Overview

CloudGraze is a small Spring Boot REST service for storing and retrieving door-numbered usage records. A client POSTs a CloudGraze record to `/post`; the controller delegates saving through the service and repository. A GET to `/cg.spring` follows the same layers to retrieve all records. The entity defines the record fields, including time and usage totals. The excerpts show no reporting, aggregation, or database configuration; persistence beyond the Spring Data repository is therefore left unverified.

Main entry points: [`src/main/java/com/gowatr/cloudgraze/Controller/CgController.java`](https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Controller/CgController.java) (REST controller), [`src/main/java/com/gowatr/cloudgraze/Service/CgService.java`](https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Service/CgService.java) (Record service), [`src/main/java/com/gowatr/cloudgraze/Repository/CgRepository.java`](https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Repository/CgRepository.java) (JPA repository), [`src/main/java/com/gowatr/cloudgraze/Entity/CloudGraze.java`](https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Entity/CloudGraze.java) (Usage record)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_application["Spring Boot app"]
  node_controller["REST controller<br/>[CgController.java]"]
end

subgraph group_domain["Record Model"]
  node_service["Record service<br/>[CgService.java]"]
  node_entity["Usage record<br/>[CloudGraze.java]"]
end

subgraph group_persistence["Persistence"]
  node_repository["JPA repository<br/>[CgRepository.java]"]
  node_database[("Backing database")]
end

node_client(("HTTP client"))

node_client -->|"sends HTTP"| node_controller
node_controller -->|"delegates requests"| node_service
node_controller -->|"accepts and returns"| node_entity
node_service -->|"reads and saves"| node_repository
node_service -->|"handles records"| node_entity
node_repository -->|"persists type"| node_entity
node_application -.->|"hosts routes"| node_controller
node_repository -.->|"persists records"| node_database

click node_application "https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/CloudgrazeApplication.java"
click node_controller "https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Controller/CgController.java"
click node_service "https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Service/CgService.java"
click node_entity "https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Entity/CloudGraze.java"
click node_repository "https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Repository/CgRepository.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_application,node_controller,node_client toneBlue
class node_service,node_entity toneAmber
class node_repository,node_database toneMint
```

## Components

### HTTP API

- [Spring Boot app](https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/CloudgrazeApplication.java): `src/main/java/com/gowatr/cloudgraze/CloudgrazeApplication.java`
- [REST controller](https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Controller/CgController.java): `src/main/java/com/gowatr/cloudgraze/Controller/CgController.java`

### Record Model

- [Record service](https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Service/CgService.java): `src/main/java/com/gowatr/cloudgraze/Service/CgService.java`
- [Usage record](https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Entity/CloudGraze.java): `src/main/java/com/gowatr/cloudgraze/Entity/CloudGraze.java`

### Persistence

- [JPA repository](https://github.com/gowtham1103/restapi/blob/main/src/main/java/com/gowatr/cloudgraze/Repository/CgRepository.java): `src/main/java/com/gowatr/cloudgraze/Repository/CgRepository.java`
- **Backing database**

### Other components

- **HTTP client**

## Connections

- HTTP client → REST controller: sends HTTP (evidence: `src/main/java/com/gowatr/cloudgraze/Controller/CgController.java`)
- REST controller → Record service: delegates requests (evidence: `src/main/java/com/gowatr/cloudgraze/Controller/CgController.java`)
- REST controller → Usage record: accepts and returns (evidence: `src/main/java/com/gowatr/cloudgraze/Controller/CgController.java`)
- Record service → JPA repository: reads and saves (evidence: `src/main/java/com/gowatr/cloudgraze/Service/CgService.java`)
- Record service → Usage record: handles records (evidence: `src/main/java/com/gowatr/cloudgraze/Service/CgService.java`)
- JPA repository → Usage record: persists type (evidence: `src/main/java/com/gowatr/cloudgraze/Repository/CgRepository.java`)
- Spring Boot app → REST controller: hosts routes
- JPA repository → Backing database: persists records
