# rohitgit20/spring-boot-assignment architecture

> Architecture diagram of the GitHub repository rohitgit20/spring-boot-assignment, 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/rohitgit20/spring-boot-assignment
- Repository: https://github.com/rohitgit20/spring-boot-assignment

## Overview

This is a Spring Boot backend with a configured H2 in-memory database and basic REST API. The tree suggests a post-oriented API, plus a separate student API; the sampled entity classes describe users, posts, and bots. The README does not document endpoint behavior, and controller, service, repository, and application source was not sampled, so their wiring and the exact request-to-storage workflow cannot be confirmed. The graph shows the apparent product components without asserting unsupported calls.

Main entry points: [`src/main/java/com/example/demo/controller/PostController.java`](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/controller/PostController.java) (Post controller), [`src/main/java/com/example/demo/com.example.demo/controller/StudentController.java`](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/com.example.demo/controller/StudentController.java) (Student controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_app["Spring Boot app"]
  node_post_service["Post service<br/>[PostService.java]"]
  node_h2[("H2 database")]
end

subgraph group_api["REST APIs"]
  node_post_api["Post controller"]
  node_student_api["Student controller"]
end

subgraph group_domain["Domain and persistence"]
  node_post_repo["Post repository"]
  node_user_repo["User repository"]
  node_bot_repo["Bot repository<br/>[BotRepository.java]"]
  node_comment_repo["Comment repository"]
  node_student_repo["Student repository"]
  node_post["Post entity<br/>[Post.java]"]
  node_user["User entity<br/>[User.java]"]
  node_bot["Bot entity<br/>[Bot.java]"]
  node_comment["Comment model<br/>[Comment.java]"]
  node_student["Student model<br/>[Student.java]"]
end

node_client(("API client"))

node_client -->|"HTTP requests"| node_post_api
node_client -->|"HTTP requests"| node_student_api

click node_app "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/DemoApplication.java"
click node_post_api "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/controller/PostController.java"
click node_student_api "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/com.example.demo/controller/StudentController.java"
click node_post_service "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/service/PostService.java"
click node_post_repo "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/PostRepository.java"
click node_user_repo "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/UserRepository.java"
click node_bot_repo "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/BotRepository.java"
click node_comment_repo "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/CommentRepository.java"
click node_student_repo "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/StudentRepository.java"
click node_post "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/model/Post.java"
click node_user "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/model/User.java"
click node_bot "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/model/Bot.java"
click node_comment "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/Comment.java"
click node_student "https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/model/Student.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_post_service,node_h2,node_client toneBlue
class node_post_api,node_student_api toneAmber
class node_post_repo,node_user_repo,node_bot_repo,node_comment_repo,node_student_repo,node_post,node_user,node_bot,node_comment,node_student toneMint
```

## Components

### Application runtime

- [Spring Boot app](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/DemoApplication.java): `src/main/java/com/example/demo/DemoApplication.java`
- [Post service](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/service/PostService.java): `src/main/java/com/example/demo/service/PostService.java`
- **H2 database**

### REST APIs

- [Post controller](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/controller/PostController.java): `src/main/java/com/example/demo/controller/PostController.java`
- [Student controller](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/com.example.demo/controller/StudentController.java): `src/main/java/com/example/demo/com.example.demo/controller/StudentController.java`

### Domain and persistence

- [Post repository](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/PostRepository.java): `src/main/java/com/example/demo/repository/PostRepository.java`
- [User repository](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/UserRepository.java): `src/main/java/com/example/demo/repository/UserRepository.java`
- [Bot repository](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/BotRepository.java): `src/main/java/com/example/demo/repository/BotRepository.java`
- [Comment repository](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/CommentRepository.java): `src/main/java/com/example/demo/repository/CommentRepository.java`
- [Student repository](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/repository/StudentRepository.java): `src/main/java/com/example/demo/repository/StudentRepository.java`
- [Post entity](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/model/Post.java): `src/main/java/com/model/Post.java`
- [User entity](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/model/User.java): `src/main/java/com/model/User.java`
- [Bot entity](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/model/Bot.java): `src/main/java/com/model/Bot.java`
- [Comment model](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/Comment.java): `src/main/java/com/example/Comment.java`
- [Student model](https://github.com/rohitgit20/spring-boot-assignment/blob/main/src/main/java/com/example/demo/model/Student.java): `src/main/java/com/example/demo/model/Student.java`

### Other components

- **API client**

## Connections

- API client → Post controller: HTTP requests
- API client → Student controller: HTTP requests
