# shaikumarr/post-craft architecture

> Architecture diagram of the GitHub repository shaikumarr/post-craft, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shaikumarr/post-craft
- Repository: https://github.com/shaikumarr/post-craft

## Overview

PostCraft collects an achievement, tone, and skills in a browser form, sends them to the Spring endpoint, generates post content with Gemini, and returns content, hashtags, and engagement tips for display. The README also documents saving generated posts to a database. The persistence implementation is not present in the supplied tree, so it is represented without an invented source path. The agent-service implementation and request DTO were not excerpted; their relationships are included only where the README explicitly describes them.

Main entry points: [`src/main/java/com/linkedin_agent_ai/service/LinkedinAgentService.java`](https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/service/LinkedinAgentService.java) (Post generation workflow), [`src/main/java/com/linkedin_agent_ai/controller/LinkedinController.java`](https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/controller/LinkedinController.java) (Generate endpoint), [`src/main/resources/static/index.html`](https://github.com/shaikumarr/post-craft/blob/main/src/main/resources/static/index.html) (PostCraft interface), [`src/main/resources/static/app.js`](https://github.com/shaikumarr/post-craft/blob/main/src/main/resources/static/app.js) (Form and results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser experience"]
  node_browser["PostCraft interface<br/>[index.html]"]
  node_form_logic["Form and results<br/>[app.js]"]
  node_styles["Responsive styling<br/>[style.css]"]
end

subgraph group_backend["Generation backend"]
  node_controller["Generate endpoint"]
  node_request["Post request<br/>[PostRequest.java]"]
  node_agent["Post generation workflow"]
  node_gemini_service["Gemini prompt and parsing<br/>[GeminiService.java]"]
  node_response["Post response<br/>[PostResponse.java]"]
  node_history["Post history persistence"]
  node_application["Spring Boot application"]
  node_rest_config["HTTP client configuration"]
end

subgraph group_external["External services"]
  node_database[("Post history database")]
  node_gemini{{"Google Gemini API"}}
end

node_user(("Post creator"))

node_user -->|"enters details"| node_browser
node_browser -->|"loads interface"| node_form_logic
node_form_logic -->|"POSTs request"| node_controller
node_controller -->|"accepts"| node_request
node_controller -->|"delegates"| node_agent
node_agent -->|"requests generation"| node_gemini_service
node_gemini_service -->|"calls generateContent"| node_gemini
node_agent -->|"saves post"| node_history
node_history -->|"stores history"| node_database
node_agent -->|"returns result"| node_response
node_form_logic -->|"renders result"| node_response
node_browser -->|"uses styling"| node_styles
node_application -.->|"serves endpoint"| node_controller

click node_browser "https://github.com/shaikumarr/post-craft/blob/main/src/main/resources/static/index.html"
click node_form_logic "https://github.com/shaikumarr/post-craft/blob/main/src/main/resources/static/app.js"
click node_styles "https://github.com/shaikumarr/post-craft/blob/main/src/main/resources/static/style.css"
click node_controller "https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/controller/LinkedinController.java"
click node_request "https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/dto/PostRequest.java"
click node_agent "https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/service/LinkedinAgentService.java"
click node_gemini_service "https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/service/GeminiService.java"
click node_response "https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/dto/PostResponse.java"
click node_application "https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/LinkedinAgentAiApplication.java"
click node_rest_config "https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/config/RestTemplateConfig.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_browser,node_form_logic,node_styles toneBlue
class node_controller,node_request,node_agent,node_gemini_service,node_response,node_history,node_application,node_rest_config toneAmber
class node_database,node_gemini toneMint
class node_user toneIndigo
```

## Components

### Browser experience

- [PostCraft interface](https://github.com/shaikumarr/post-craft/blob/main/src/main/resources/static/index.html): `src/main/resources/static/index.html`
- [Form and results](https://github.com/shaikumarr/post-craft/blob/main/src/main/resources/static/app.js): `src/main/resources/static/app.js`
- [Responsive styling](https://github.com/shaikumarr/post-craft/blob/main/src/main/resources/static/style.css): `src/main/resources/static/style.css`

### Generation backend

- [Generate endpoint](https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/controller/LinkedinController.java): `src/main/java/com/linkedin_agent_ai/controller/LinkedinController.java`
- [Post request](https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/dto/PostRequest.java): `src/main/java/com/linkedin_agent_ai/dto/PostRequest.java`
- [Post generation workflow](https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/service/LinkedinAgentService.java): `src/main/java/com/linkedin_agent_ai/service/LinkedinAgentService.java`
- [Gemini prompt and parsing](https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/service/GeminiService.java): `src/main/java/com/linkedin_agent_ai/service/GeminiService.java`
- [Post response](https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/dto/PostResponse.java): `src/main/java/com/linkedin_agent_ai/dto/PostResponse.java`
- **Post history persistence**
- [Spring Boot application](https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/LinkedinAgentAiApplication.java): `src/main/java/com/linkedin_agent_ai/LinkedinAgentAiApplication.java`
- [HTTP client configuration](https://github.com/shaikumarr/post-craft/blob/main/src/main/java/com/linkedin_agent_ai/config/RestTemplateConfig.java): `src/main/java/com/linkedin_agent_ai/config/RestTemplateConfig.java`

### External services

- **Post history database**
- **Google Gemini API**

### Other components

- **Post creator**

## Connections

- Post creator → PostCraft interface: enters details (evidence: `README.md`)
- PostCraft interface → Form and results: loads interface (evidence: `README.md`)
- Form and results → Generate endpoint: POSTs request (evidence: `README.md`)
- Generate endpoint → Post request: accepts (evidence: `src/main/java/com/linkedin_agent_ai/controller/LinkedinController.java`)
- Generate endpoint → Post generation workflow: delegates (evidence: `src/main/java/com/linkedin_agent_ai/controller/LinkedinController.java`)
- Post generation workflow → Gemini prompt and parsing: requests generation (evidence: `README.md`)
- Gemini prompt and parsing → Google Gemini API: calls generateContent (evidence: `src/main/java/com/linkedin_agent_ai/service/GeminiService.java`)
- Post generation workflow → Post history persistence: saves post (evidence: `README.md`)
- Post history persistence → Post history database: stores history (evidence: `README.md`)
- Post generation workflow → Post response: returns result (evidence: `README.md`)
- Form and results → Post response: renders result (evidence: `README.md`)
- PostCraft interface → Responsive styling: uses styling (evidence: `README.md`)
- Spring Boot application → Generate endpoint: serves endpoint
