# mariocodev/spring-sso-google architecture

> Architecture diagram of the GitHub repository mariocodev/spring-sso-google, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mariocodev/spring-sso-google
- Repository: https://github.com/mariocodev/spring-sso-google

## Overview

##### Project type and purpose
- This is a backend web application (a Spring Boot “demo” service) that implements Single-Sign-On (SSO) using Google’s OAuth 2.0.
- There is no separate “frontend” code here – it’s a Spring Boot MVC web app that drives the SSO flow and returns simple HTML or JSON.

##### File structure
- Top-level build files: `pom.xml`, Maven wrapper files, `.mvn/`, `.gitignore`, `LICENSE`.
- Source code under `src/main/java/py/com/seto/google/auth/`:
- `SpringSsoGoogleApplication.java` – the `@SpringBootApplication` entry point with two endpoints (`/` and `/user`).
- `SecurityConfig.java` – configures Spring Security OAuth2 client for Google SSO.
- Configuration in `src/main/resources/`:
- `application-example.yml` – template for profile-specific settings (clientId, clientSecret).
- `application.yml` – picks up the active profile.
- Tests mirror the main code structure under `src/test/java/…`.

##### README for additional insights
- Describes 4 Maven profiles (`local`, `dev`, `uat`, `prod`) and instructions on copying `application-example.yml` to e.g. `application-local.yml`.
- Specifies Java 17, Spring Boot 3.2.5, Maven 3.9.6.
- No database, caching, message queues or other services: it’s purely OAuth2 SSO with Google.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client
    Browser["Client Browser"]:::browser

    %% Spring Boot Application Components
    subgraph "Spring Boot Application"
        entry["SpringSsoGoogleApplication"]:::spring
        security["SecurityConfig"]:::spring
        controllers["MVC Controllers (/ and /user)"]:::spring
        session["Session Store: In-Memory"]:::spring
    end

    %% External Service
    ExternalGoogle["Google OAuth2 Auth Server"]:::external

    %% Configuration Files
    subgraph "Configuration Files"
        exampleYml["application-example.yml"]:::config
        activeYml["application.yml"]:::config
    end

    %% Build and Profiles
    pom["pom.xml"]:::config

    subgraph "Maven Wrapper"
        mvnw["mvnw & mvnw.cmd"]:::config
        wrapperJar[".mvn/wrapper/maven-wrapper.jar"]:::config
        wrapperProps[".mvn/wrapper/maven-wrapper.properties"]:::config
    end

    %% Tests and Documentation
    tests["SpringSsoGoogleApplicationTests"]:::spring
    docsReadme["README.md"]:::doc
    license["LICENSE"]:::doc
    gitignore[".gitignore"]:::doc

    %% Flow Arrows
    Browser -->|"1: Access root '/'"| entry
    entry -->|"2: Redirect for auth code"| ExternalGoogle
    ExternalGoogle -->|"3: Callback with code"| entry
    entry -->|"Token exchange"| ExternalGoogle
    Browser -->|"4: Access '/user'"| controllers

    exampleYml --> entry
    activeYml --> entry
    pom --> activeYml
    mvnw --> pom
    wrapperJar --> pom
    wrapperProps --> pom
    tests --> entry
    docsReadme --> entry
    license --> entry
    gitignore --> entry

    %% Click Events
    click entry "https://github.com/mariocodev/spring-sso-google/blob/main/src/main/java/py/com/seto/google/auth/SpringSsoGoogleApplication.java"
    click security "https://github.com/mariocodev/spring-sso-google/blob/main/src/main/java/py/com/seto/google/auth/SecurityConfig.java"
    click exampleYml "https://github.com/mariocodev/spring-sso-google/blob/main/src/main/resources/application-example.yml"
    click activeYml "https://github.com/mariocodev/spring-sso-google/blob/main/src/main/resources/application.yml"
    click pom "https://github.com/mariocodev/spring-sso-google/blob/main/pom.xml"
    click tests "https://github.com/mariocodev/spring-sso-google/blob/main/src/test/java/py/com/seto/google/auth/SpringSsoGoogleApplicationTests.java"
    click docsReadme "https://github.com/mariocodev/spring-sso-google/blob/main/README.md"
    click license "https://github.com/mariocodev/spring-sso-google/tree/main/LICENSE"
    click gitignore "https://github.com/mariocodev/spring-sso-google/blob/main/.gitignore"
    click wrapperJar "https://github.com/mariocodev/spring-sso-google/blob/main/.mvn/wrapper/maven-wrapper.jar"
    click wrapperProps "https://github.com/mariocodev/spring-sso-google/blob/main/.mvn/wrapper/maven-wrapper.properties"
    click mvnw "https://github.com/mariocodev/spring-sso-google/tree/main/mvnw"
    click mvnw "https://github.com/mariocodev/spring-sso-google/blob/main/mvnw.cmd"

    %% Styles
    classDef browser fill:#a0d8f1,stroke:#333,stroke-width:1px
    classDef spring fill:#b7e4c7,stroke:#333,stroke-width:1px
    classDef external fill:#ffcc99,stroke:#333,stroke-width:1px
    classDef config fill:#eeeeee,stroke:#333,stroke-width:1px
    classDef doc fill:#f0e68c,stroke:#333,stroke-width:1px
```
