# arvindkumar028/api-playground architecture

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

- Interactive diagram: https://gitdiagram.com/arvindkumar028/api-playground
- Repository: https://github.com/arvindkumar028/api-playground

## Overview

fsit-journey is a Spring Boot API testing playground. Users register or log in for JWT access, manage posts, and publish posts; post events can enqueue signed webhook deliveries, which are sent to configured receivers and recorded for inspection. Users can also register webhooks, send test events, and review delivery history. The README documents PostgreSQL, Redis caching, and Mailhog integrations. Webhook dispatch is asynchronous after transaction commit per the publisher documentation; the listener’s implementation was not sampled, so that internal handoff is not shown.

Main entry points: [`api/src/main/java/org/api/playground/post/PostService.java`](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/post/PostService.java) (Post workflow), [`api/src/main/java/org/api/playground/webhook/WebhookEventPublisher.java`](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookEventPublisher.java) (Event enqueueing), [`api/src/main/java/org/api/playground/webhook/WebhookService.java`](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookService.java) (Webhook management), [`api/src/main/java/org/api/playground/webhook/WebhookDeliverer.java`](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookDeliverer.java) (Signed delivery retries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_auth_api["Authentication API"]
  node_jwt["JWT issuance<br/>[TokenService.java]"]
  node_users["Users and roles<br/>[User.java]"]
  node_user_store["User repository"]
end

subgraph group_content["Posts and publishing"]
  node_posts_api["Posts API"]
  node_post_logic["Post workflow<br/>[PostService.java]"]
  node_post_store["Post repository"]
  node_post_model["Post lifecycle<br/>[Post.java]"]
end

subgraph group_webhooks["Webhook management and delivery"]
  node_webhook_api["Webhook API"]
  node_webhook_logic["Webhook management"]
  node_webhook_model["Webhook subscriptions<br/>[Webhook.java]"]
  node_webhook_store["Webhook repository"]
  node_event_publisher["Event enqueueing"]
  node_delivery_store["Delivery history"]
  node_delivery_model["Delivery state"]
  node_deliverer["Signed delivery retries"]
end

subgraph group_runtime["Runtime integrations"]
  node_mail["Publication email<br/>[MailService.java]"]
  node_receiver["Webhook receiver<br/>[receiver.py]"]
  node_postgres[("PostgreSQL")]
  node_redis[("Post cache")]
  node_mailhog["Mailhog"]
end

node_client(("API client"))

node_client -->|"logs in"| node_auth_api
node_auth_api -->|"looks up users"| node_user_store
node_auth_api -->|"issues token"| node_jwt
node_client -->|"manages posts"| node_posts_api
node_posts_api -->|"delegates actions"| node_post_logic
node_post_logic -->|"reads and writes"| node_post_store
node_post_logic -->|"publishes events"| node_event_publisher
node_post_logic -->|"sends publication email"| node_mail
node_post_logic -->|"caches post reads"| node_redis
node_post_logic -.->|"persists posts"| node_postgres
node_mail -->|"delivers email"| node_mailhog
node_client -->|"manages webhooks"| node_webhook_api
node_webhook_api -->|"delegates requests"| node_webhook_logic
node_webhook_logic -->|"manages subscriptions"| node_webhook_store
node_webhook_logic -->|"reads history"| node_delivery_store
node_webhook_logic -->|"publishes test event"| node_event_publisher
node_event_publisher -->|"records deliveries"| node_delivery_store
node_event_publisher -->|"selects subscribers"| node_webhook_store
node_deliverer -->|"claims and updates"| node_delivery_store
node_deliverer -->|"loads webhook secret"| node_webhook_store
node_deliverer -->|"sends signed requests"| node_receiver
node_event_publisher -.->|"dispatches after commit"| node_deliverer
node_webhook_store -.->|"persists subscriptions"| node_postgres
node_delivery_store -.->|"persists history"| node_postgres

click node_auth_api "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/auth/AuthController.java"
click node_jwt "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/auth/TokenService.java"
click node_users "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/user/User.java"
click node_user_store "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/user/UserRepository.java"
click node_posts_api "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/post/PostController.java"
click node_post_logic "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/post/PostService.java"
click node_post_store "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/post/PostRepository.java"
click node_post_model "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/post/Post.java"
click node_mail "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/mail/MailService.java"
click node_webhook_api "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookController.java"
click node_webhook_logic "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookService.java"
click node_webhook_model "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/Webhook.java"
click node_webhook_store "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookRepository.java"
click node_event_publisher "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookEventPublisher.java"
click node_delivery_store "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookDeliveryRepository.java"
click node_delivery_model "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookDelivery.java"
click node_deliverer "https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookDeliverer.java"
click node_receiver "https://github.com/arvindkumar028/api-playground/blob/main/webhook-receiver/receiver.py"

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_jwt,node_users,node_user_store,node_client toneBlue
class node_posts_api,node_post_logic,node_post_store,node_post_model toneAmber
class node_webhook_api,node_webhook_logic,node_webhook_model,node_webhook_store,node_event_publisher,node_delivery_store,node_delivery_model,node_deliverer toneMint
class node_mail,node_receiver,node_postgres,node_redis,node_mailhog toneRose
```

## Components

### Identity and access

- [Authentication API](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/auth/AuthController.java): `api/src/main/java/org/api/playground/auth/AuthController.java`
- [JWT issuance](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/auth/TokenService.java): `api/src/main/java/org/api/playground/auth/TokenService.java`
- [Users and roles](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/user/User.java): `api/src/main/java/org/api/playground/user/User.java`
- [User repository](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/user/UserRepository.java): `api/src/main/java/org/api/playground/user/UserRepository.java`

### Posts and publishing

- [Posts API](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/post/PostController.java): `api/src/main/java/org/api/playground/post/PostController.java`
- [Post workflow](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/post/PostService.java): `api/src/main/java/org/api/playground/post/PostService.java`
- [Post repository](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/post/PostRepository.java): `api/src/main/java/org/api/playground/post/PostRepository.java`
- [Post lifecycle](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/post/Post.java): `api/src/main/java/org/api/playground/post/Post.java`

### Webhook management and delivery

- [Webhook API](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookController.java): `api/src/main/java/org/api/playground/webhook/WebhookController.java`
- [Webhook management](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookService.java): `api/src/main/java/org/api/playground/webhook/WebhookService.java`
- [Webhook subscriptions](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/Webhook.java): `api/src/main/java/org/api/playground/webhook/Webhook.java`
- [Webhook repository](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookRepository.java): `api/src/main/java/org/api/playground/webhook/WebhookRepository.java`
- [Event enqueueing](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookEventPublisher.java): `api/src/main/java/org/api/playground/webhook/WebhookEventPublisher.java`
- [Delivery history](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookDeliveryRepository.java): `api/src/main/java/org/api/playground/webhook/WebhookDeliveryRepository.java`
- [Delivery state](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookDelivery.java): `api/src/main/java/org/api/playground/webhook/WebhookDelivery.java`
- [Signed delivery retries](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/webhook/WebhookDeliverer.java): `api/src/main/java/org/api/playground/webhook/WebhookDeliverer.java`

### Runtime integrations

- [Publication email](https://github.com/arvindkumar028/api-playground/blob/main/api/src/main/java/org/api/playground/mail/MailService.java): `api/src/main/java/org/api/playground/mail/MailService.java`
- [Webhook receiver](https://github.com/arvindkumar028/api-playground/blob/main/webhook-receiver/receiver.py): `webhook-receiver/receiver.py`
- **PostgreSQL**
- **Post cache**
- **Mailhog**

### Other components

- **API client**

## Connections

- API client → Authentication API: logs in (evidence: `README.md`)
- Authentication API → User repository: looks up users (evidence: `api/src/main/java/org/api/playground/auth/AuthController.java`)
- Authentication API → JWT issuance: issues token (evidence: `api/src/main/java/org/api/playground/auth/AuthController.java`)
- API client → Posts API: manages posts (evidence: `README.md`)
- Posts API → Post workflow: delegates actions (evidence: `api/src/main/java/org/api/playground/post/PostController.java`)
- Post workflow → Post repository: reads and writes (evidence: `api/src/main/java/org/api/playground/post/PostService.java`)
- Post workflow → Event enqueueing: publishes events (evidence: `api/src/main/java/org/api/playground/post/PostService.java`)
- Post workflow → Publication email: sends publication email (evidence: `api/src/main/java/org/api/playground/post/PostService.java`)
- Post workflow → Post cache: caches post reads (evidence: `README.md`)
- Post workflow → PostgreSQL: persists posts
- Publication email → Mailhog: delivers email (evidence: `README.md`)
- API client → Webhook API: manages webhooks (evidence: `README.md`)
- Webhook API → Webhook management: delegates requests (evidence: `api/src/main/java/org/api/playground/webhook/WebhookController.java`)
- Webhook management → Webhook repository: manages subscriptions (evidence: `api/src/main/java/org/api/playground/webhook/WebhookService.java`)
- Webhook management → Delivery history: reads history (evidence: `api/src/main/java/org/api/playground/webhook/WebhookService.java`)
- Webhook management → Event enqueueing: publishes test event (evidence: `api/src/main/java/org/api/playground/webhook/WebhookService.java`)
- Event enqueueing → Delivery history: records deliveries (evidence: `api/src/main/java/org/api/playground/webhook/WebhookEventPublisher.java`)
- Event enqueueing → Webhook repository: selects subscribers (evidence: `api/src/main/java/org/api/playground/webhook/WebhookEventPublisher.java`)
- Signed delivery retries → Delivery history: claims and updates (evidence: `api/src/main/java/org/api/playground/webhook/WebhookDeliverer.java`)
- Signed delivery retries → Webhook repository: loads webhook secret (evidence: `api/src/main/java/org/api/playground/webhook/WebhookDeliverer.java`)
- Signed delivery retries → Webhook receiver: sends signed requests (evidence: `README.md`)
- Event enqueueing → Signed delivery retries: dispatches after commit
- Webhook repository → PostgreSQL: persists subscriptions
- Delivery history → PostgreSQL: persists history
