# harshpatel-08/spring-boot-file-storage-system architecture

> Architecture diagram of the GitHub repository harshpatel-08/spring-boot-file-storage-system, 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/harshpatel-08/spring-boot-file-storage-system
- Repository: https://github.com/harshpatel-08/spring-boot-file-storage-system

## Overview

Practice is a Spring Boot file-management API. Clients register or log in to receive JWTs, then use authenticated endpoints to upload, list/search, download, stream, or obtain temporary URLs for files. File metadata is handled through JPA repositories while file bytes use MinIO. The README documents role-based access, validation, and Swagger; sampled source shows the auth and file-service responsibilities, but some wiring and endpoint implementations were not fully excerpted, so uncertain links are omitted.

Main entry points: [`src/main/java/com/springProject/Practice/service/FileServiceImpl.java`](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/service/FileServiceImpl.java) (File Operations), [`src/main/java/com/springProject/Practice/service/AuthService.java`](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/service/AuthService.java) (Registration and Login), [`src/main/java/com/springProject/Practice/repository/UserRepository.java`](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/repository/UserRepository.java) (User Repository), [`src/main/java/com/springProject/Practice/controller/AuthController.java`](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/controller/AuthController.java) (Auth Endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST API"]
  node_auth_api["Auth Endpoints"]
  node_file_api["File Endpoints"]
end

subgraph group_identity["Identity and Security"]
  node_auth_logic["Registration and Login<br/>[AuthService.java]"]
  node_jwt_service["JWT Tokens<br/>[JwtService.java]"]
  node_jwt_filter["JWT Request Filter<br/>[JwtFilter.java]"]
  node_security_config["Access Control"]
end

subgraph group_files["File Management"]
  node_file_ops["File Operations"]
end

subgraph group_persistence["Persistence and Storage"]
  node_users["User Records<br/>[User.java]"]
  node_user_repo["User Repository"]
  node_file_data["File Metadata<br/>[FileData.java]"]
  node_file_repo["File Repository"]
end

subgraph group_support["API Support"]
  node_error_handler["Exception Responses"]
  node_response_dto["API Response DTO<br/>[ResponseAPI.java]"]
  node_swagger["Swagger UI<br/>[SwaggerConfig.java]"]
end

node_client(("API Client"))
node_mysql[("MySQL")]
node_minio[("MinIO Object Storage")]

node_client -->|"registers or logs in"| node_auth_api
node_auth_api -->|"delegates auth"| node_auth_logic
node_auth_logic -->|"checks and saves"| node_user_repo
node_auth_logic -->|"generates token"| node_jwt_service
node_user_repo -->|"queries users"| node_users
node_jwt_filter -->|"validates token"| node_jwt_service
node_security_config -->|"registers filter"| node_jwt_filter
node_client -->|"calls file endpoints"| node_file_api
node_file_api -->|"delegates file actions"| node_file_ops
node_file_ops -->|"stores and queries metadata"| node_file_repo
node_file_repo -->|"persists metadata"| node_file_data
node_file_ops -->|"resolves current user"| node_user_repo
node_file_ops -->|"uploads and retrieves objects"| node_minio
node_file_ops -->|"persists metadata via JPA"| node_mysql
node_error_handler -->|"builds error responses"| node_response_dto
node_swagger -->|"documents API"| node_client

click node_auth_api "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/controller/AuthController.java"
click node_file_api "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/controller/FileController.java"
click node_auth_logic "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/service/AuthService.java"
click node_jwt_service "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/security/JwtService.java"
click node_jwt_filter "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/security/JwtFilter.java"
click node_security_config "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/security/SecurityConfig.java"
click node_users "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/model/User.java"
click node_user_repo "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/repository/UserRepository.java"
click node_file_ops "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/service/FileServiceImpl.java"
click node_file_data "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/model/FileData.java"
click node_file_repo "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/repository/FileRepository.java"
click node_error_handler "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/exception/GlobalExceptionHandler.java"
click node_response_dto "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/dto/ResponseAPI.java"
click node_swagger "https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/config/SwaggerConfig.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_auth_api,node_file_api,node_client toneBlue
class node_auth_logic,node_jwt_service,node_jwt_filter,node_security_config,node_mysql,node_minio toneAmber
class node_file_ops toneMint
class node_users,node_user_repo,node_file_data,node_file_repo toneRose
class node_error_handler,node_response_dto,node_swagger toneIndigo
```

## Components

### REST API

- [Auth Endpoints](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/controller/AuthController.java): `src/main/java/com/springProject/Practice/controller/AuthController.java`
- [File Endpoints](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/controller/FileController.java): `src/main/java/com/springProject/Practice/controller/FileController.java`

### Identity and Security

- [Registration and Login](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/service/AuthService.java): `src/main/java/com/springProject/Practice/service/AuthService.java`
- [JWT Tokens](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/security/JwtService.java): `src/main/java/com/springProject/Practice/security/JwtService.java`
- [JWT Request Filter](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/security/JwtFilter.java): `src/main/java/com/springProject/Practice/security/JwtFilter.java`
- [Access Control](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/security/SecurityConfig.java): `src/main/java/com/springProject/Practice/security/SecurityConfig.java`

### File Management

- [File Operations](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/service/FileServiceImpl.java): `src/main/java/com/springProject/Practice/service/FileServiceImpl.java`

### Persistence and Storage

- [User Records](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/model/User.java): `src/main/java/com/springProject/Practice/model/User.java`
- [User Repository](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/repository/UserRepository.java): `src/main/java/com/springProject/Practice/repository/UserRepository.java`
- [File Metadata](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/model/FileData.java): `src/main/java/com/springProject/Practice/model/FileData.java`
- [File Repository](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/repository/FileRepository.java): `src/main/java/com/springProject/Practice/repository/FileRepository.java`

### API Support

- [Exception Responses](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/exception/GlobalExceptionHandler.java): `src/main/java/com/springProject/Practice/exception/GlobalExceptionHandler.java`
- [API Response DTO](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/dto/ResponseAPI.java): `src/main/java/com/springProject/Practice/dto/ResponseAPI.java`
- [Swagger UI](https://github.com/harshpatel-08/spring-boot-file-storage-system/blob/main/src/main/java/com/springProject/Practice/config/SwaggerConfig.java): `src/main/java/com/springProject/Practice/config/SwaggerConfig.java`

### Other components

- **API Client**
- **MySQL**
- **MinIO Object Storage**

## Connections

- API Client → Auth Endpoints: registers or logs in (evidence: `README.md`)
- Auth Endpoints → Registration and Login: delegates auth (evidence: `src/main/java/com/springProject/Practice/controller/AuthController.java`)
- Registration and Login → User Repository: checks and saves (evidence: `src/main/java/com/springProject/Practice/service/AuthService.java`)
- Registration and Login → JWT Tokens: generates token (evidence: `src/main/java/com/springProject/Practice/service/AuthService.java`)
- User Repository → User Records: queries users (evidence: `src/main/java/com/springProject/Practice/repository/UserRepository.java`)
- JWT Request Filter → JWT Tokens: validates token (evidence: `src/main/java/com/springProject/Practice/security/JwtFilter.java`)
- Access Control → JWT Request Filter: registers filter (evidence: `src/main/java/com/springProject/Practice/security/SecurityConfig.java`)
- API Client → File Endpoints: calls file endpoints (evidence: `README.md`)
- File Endpoints → File Operations: delegates file actions (evidence: `src/main/java/com/springProject/Practice/controller/FileController.java`)
- File Operations → File Repository: stores and queries metadata (evidence: `src/main/java/com/springProject/Practice/service/FileServiceImpl.java`)
- File Repository → File Metadata: persists metadata (evidence: `src/main/java/com/springProject/Practice/repository/FileRepository.java`)
- File Operations → User Repository: resolves current user (evidence: `src/main/java/com/springProject/Practice/service/FileServiceImpl.java`)
- File Operations → MinIO Object Storage: uploads and retrieves objects (evidence: `src/main/java/com/springProject/Practice/service/FileServiceImpl.java`)
- File Operations → MySQL: persists metadata via JPA (evidence: `README.md`)
- Exception Responses → API Response DTO: builds error responses (evidence: `src/main/java/com/springProject/Practice/exception/GlobalExceptionHandler.java`)
- Swagger UI → API Client: documents API (evidence: `README.md`)
