# pollob-kumar/springboot-social-media architecture

> Architecture diagram of the GitHub repository pollob-kumar/springboot-social-media, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pollob-kumar/springboot-social-media
- Repository: https://github.com/pollob-kumar/springboot-social-media

## Overview

##### Project type and purpose
- This is a monolithic Spring Boot social-media web application that provides user authentication, post sharing, and basic social features.
- The tech stack is Java, Spring Boot (MVC + DI + Data JPA), MySQL for persistence, and Thymeleaf or REST endpoints (no separate “frontend” folder present – assume server-side rendered views or a thin JS client).

##### File structure
- Top-level: pom.xml, mvnw scripts, .mvn/ wrapper → standard Maven-based Spring Boot project.
- src/main/java/com/pollob/controller → HTTP controllers (presentation layer).
- src/main/java/com/pollob/service & …/service/UserServiceImplementation → business logic layer.
- src/main/java/com/pollob/repository → persistence layer interfaces (Spring Data JPA).
- src/main/java/com/pollob/models → domain entities (User, Post, etc.).
- src/main/resources/application.properties → configuration for datasource, server ports, security, etc.
- src/test → unit/integration tests.

##### README
- Confirms the goal: “social media web application with user authentication, post sharing, and basic social features”
- Mentions MySQL → external relational database.

##### Detail without over-splitting
- Essential layers and data flows.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Client"
        Browser["Browser / Mobile App"]:::frontend
    end

    subgraph "Pollob-Social-Media Spring Boot App"
        PSM["PollobSocialMediaApplication"]:::backend
        subgraph "Controllers"
            HC["HomeController"]:::backend
            UC["UserController"]:::backend
        end
        subgraph "Service Layer"
            USvc["UserService"]:::backend
            USvcImpl["UserServiceImplementation"]:::backend
        end
        subgraph "Repository Layer"
            URepo["UserRepository"]:::backend
        end
        subgraph "Domain Model"
            User["User Entity"]:::backend
        end
        Config["application.properties"]:::backend
        Tests["PollobSocialMediaApplicationTests"]:::backend
    end

    MySQL["MySQL Database"]:::database
    Email["Email/SMS Service"]:::external

    Browser -->|"HTTP/HTTPS"| HC
    Browser -->|"HTTP/HTTPS"| UC
    HC -->|"handles request"| USvc
    UC -->|"handles request"| USvc
    USvc -->|"business logic"| USvcImpl
    USvcImpl -->|"uses"| URepo
    URepo -->|"CRUD via JPA"| MySQL
    USvcImpl -->|"sends notification"| Email
    PSM -->|"loads config"| Config
    Tests -->|"test context"| PSM

    click PSM "https://github.com/pollob-kumar/springboot-social-media/blob/main/src/main/java/com/pollob/PollobSocialMediaApplication.java"
    click HC "https://github.com/pollob-kumar/springboot-social-media/blob/main/src/main/java/com/pollob/controller/HomeController.java"
    click UC "https://github.com/pollob-kumar/springboot-social-media/blob/main/src/main/java/com/pollob/controller/UserController.java"
    click USvc "https://github.com/pollob-kumar/springboot-social-media/blob/main/src/main/java/com/pollob/service/UserService.java"
    click USvcImpl "https://github.com/pollob-kumar/springboot-social-media/blob/main/src/main/java/com/pollob/service/UserServiceImplementation.java"
    click URepo "https://github.com/pollob-kumar/springboot-social-media/blob/main/src/main/java/com/pollob/repository/UserRepository.java"
    click User "https://github.com/pollob-kumar/springboot-social-media/blob/main/src/main/java/com/pollob/models/User.java"
    click Config "https://github.com/pollob-kumar/springboot-social-media/blob/main/src/main/resources/application.properties"
    click Tests "https://github.com/pollob-kumar/springboot-social-media/blob/main/src/test/java/com/pollob/PollobSocialMediaApplicationTests.java"

    classDef frontend fill:#D0E6FF,stroke:#0366D6,color:#0366D6;
    classDef backend fill:#E6F4EA,stroke:#22863A,color:#22863A;
    classDef database fill:#FFEFD5,stroke:#DAA520,color:#DAA520;
    classDef external fill:#F0F0F0,stroke:#6A737D,color:#6A737D;
```
