# jaswanthsai14/blog-generator architecture

> Architecture diagram of the GitHub repository jaswanthsai14/blog-generator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jaswanthsai14/blog-generator
- Repository: https://github.com/jaswanthsai14/blog-generator

## Overview

BlogGen is a web app for signing up or logging in, generating AI-assisted blog posts from links, and viewing or deleting saved posts. The frontend maintains login state and calls the backend for authentication; the generation endpoint invokes an agent and stores results, with caching and an admin email notification. The graph also preserves the documented history and page capabilities. Some frontend-to-content API wiring is not shown in the excerpts, so those links are omitted; dashed edges mark unverified integration points.

Main entry points: [`backend/content/views.py`](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/content/views.py) (Generate endpoint), [`backend/users/signin.py`](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/signin.py) (Authentication endpoints), [`frontend/front/app/contextprovider/provider.tsx`](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/contextprovider/provider.tsx) (Login state), [`backend/agents.py`](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/agents.py) (Blog agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_web["BlogGen UI<br/>[page.tsx]"]
  node_auth_state["Login state<br/>[provider.tsx]"]
  node_home["Dashboard<br/>[page.tsx]"]
  node_signup_ui["Sign-up form<br/>[page.tsx]"]
  node_login_ui["Login form<br/>[page.tsx]"]
  node_navbar["Navigation and logout<br/>[page.tsx]"]
  node_blog_ui["Blog generation page<br/>[page.tsx]"]
  node_history_ui["Blog history<br/>[page.tsx]"]
  node_history_detail["History detail<br/>[page.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_api["Authentication endpoints<br/>[signin.py]"]
  node_users[("User accounts<br/>[signin.py]")]
end

subgraph group_content["Blog content"]
  node_generate_api["Generate endpoint<br/>[views.py]"]
  node_history_api["History endpoints<br/>[data.py]"]
  node_saved_posts[("User blog records<br/>[models.py]")]
  node_generated_posts[("Generated-link records<br/>[models1.py]")]
  node_cache[("Generation cache<br/>[views.py]")]
end

subgraph group_generation["AI generation"]
  node_agent["Blog agent<br/>[agents.py]"]
  node_mcp{{"MCP tool server"}}
  node_gemini{{"Gemini model"}}
  node_groq{{"Groq title model"}}
end

subgraph group_operations["Async notifications"]
  node_notify_task["Admin notification task<br/>[tasks.py]"]
  node_celery["Celery runtime<br/>[celery.py]"]
  node_mail{{"Email service"}}
end

node_visitor(("Visitor"))

node_visitor -->|"uses"| node_web
node_web -->|"renders"| node_home
node_web -.->|"provides state"| node_auth_state
node_home -->|"reads and updates"| node_auth_state
node_signup_ui -->|"posts signup"| node_auth_api
node_login_ui -->|"posts login"| node_auth_api
node_navbar -->|"checks and logs out"| node_auth_api
node_signup_ui -->|"updates state"| node_auth_state
node_login_ui -->|"updates state"| node_auth_state
node_navbar -->|"reads and updates"| node_auth_state
node_auth_api -->|"creates and authenticates"| node_users
node_home -->|"checks session"| node_auth_api
node_blog_ui -.->|"submits link"| node_generate_api
node_history_ui -.->|"requests history"| node_history_api
node_history_detail -.->|"uses selected post"| node_history_api
node_generate_api -->|"invokes"| node_agent
node_agent -->|"loads tools"| node_mcp
node_agent -->|"creates agent with"| node_gemini
node_agent -->|"requests title"| node_groq
node_generate_api -->|"reads and writes"| node_cache
node_generate_api -->|"reads and writes"| node_generated_posts
node_generate_api -->|"saves user blog"| node_saved_posts
node_history_api -->|"reads and updates"| node_saved_posts
node_generate_api -->|"dispatches"| node_notify_task
node_notify_task -->|"sends email"| node_mail
node_notify_task -->|"runs as task"| node_celery

click node_web "https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/page.tsx"
click node_auth_state "https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/contextprovider/provider.tsx"
click node_home "https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/home/page.tsx"
click node_signup_ui "https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/signin/page.tsx"
click node_login_ui "https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/logiin/page.tsx"
click node_navbar "https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/navbar/page.tsx"
click node_blog_ui "https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/blog/page.tsx"
click node_history_ui "https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/history/page.tsx"
click node_history_detail "https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/history/%5Bid%5D/page.tsx"
click node_auth_api "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/signin.py"
click node_users "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/signin.py"
click node_generate_api "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/content/views.py"
click node_history_api "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/content/data.py"
click node_saved_posts "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/models.py"
click node_generated_posts "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/models1.py"
click node_cache "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/content/views.py"
click node_agent "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/agents.py"
click node_notify_task "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/tasks.py"
click node_celery "https://github.com/jaswanthsai14/blog-generator/blob/main/backend/config/celery.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_web,node_auth_state,node_home,node_signup_ui,node_login_ui,node_navbar,node_blog_ui,node_history_ui,node_history_detail toneBlue
class node_auth_api,node_users toneAmber
class node_generate_api,node_history_api,node_saved_posts,node_generated_posts,node_cache toneMint
class node_agent,node_mcp,node_gemini,node_groq toneRose
class node_notify_task,node_celery,node_mail,node_visitor toneIndigo
```

## Components

### Web interface

- [BlogGen UI](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/page.tsx): `frontend/front/app/page.tsx`
- [Login state](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/contextprovider/provider.tsx): `frontend/front/app/contextprovider/provider.tsx`
- [Dashboard](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/home/page.tsx): `frontend/front/app/home/page.tsx`
- [Sign-up form](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/signin/page.tsx): `frontend/front/app/signin/page.tsx`
- [Login form](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/logiin/page.tsx): `frontend/front/app/logiin/page.tsx`
- [Navigation and logout](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/navbar/page.tsx): `frontend/front/app/navbar/page.tsx`
- [Blog generation page](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/blog/page.tsx): `frontend/front/app/blog/page.tsx`
- [Blog history](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/history/page.tsx): `frontend/front/app/history/page.tsx`
- [History detail](https://github.com/jaswanthsai14/blog-generator/blob/main/frontend/front/app/history/%5Bid%5D/page.tsx): `frontend/front/app/history/[id]/page.tsx`

### Identity and access

- [Authentication endpoints](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/signin.py): `backend/users/signin.py`
- [User accounts](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/signin.py): `backend/users/signin.py`

### Blog content

- [Generate endpoint](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/content/views.py): `backend/content/views.py`
- [History endpoints](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/content/data.py): `backend/content/data.py`
- [User blog records](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/models.py): `backend/users/models.py`
- [Generated-link records](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/models1.py): `backend/users/models1.py`
- [Generation cache](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/content/views.py): `backend/content/views.py`

### AI generation

- [Blog agent](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/agents.py): `backend/agents.py`
- **MCP tool server**
- **Gemini model**
- **Groq title model**

### Async notifications

- [Admin notification task](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/users/tasks.py): `backend/users/tasks.py`
- [Celery runtime](https://github.com/jaswanthsai14/blog-generator/blob/main/backend/config/celery.py): `backend/config/celery.py`
- **Email service**

### Other components

- **Visitor**

## Connections

- Visitor → BlogGen UI: uses
- BlogGen UI → Dashboard: renders (evidence: `frontend/front/app/page.tsx`)
- BlogGen UI → Login state: provides state
- Dashboard → Login state: reads and updates (evidence: `frontend/front/app/home/page.tsx`)
- Sign-up form → Authentication endpoints: posts signup (evidence: `frontend/front/app/signin/page.tsx`)
- Login form → Authentication endpoints: posts login (evidence: `frontend/front/app/logiin/page.tsx`)
- Navigation and logout → Authentication endpoints: checks and logs out (evidence: `frontend/front/app/navbar/page.tsx`)
- Sign-up form → Login state: updates state (evidence: `frontend/front/app/signin/page.tsx`)
- Login form → Login state: updates state (evidence: `frontend/front/app/logiin/page.tsx`)
- Navigation and logout → Login state: reads and updates (evidence: `frontend/front/app/navbar/page.tsx`)
- Authentication endpoints → User accounts: creates and authenticates (evidence: `backend/users/signin.py`)
- Dashboard → Authentication endpoints: checks session (evidence: `frontend/front/app/home/page.tsx`)
- Blog generation page → Generate endpoint: submits link
- Blog history → History endpoints: requests history
- History detail → History endpoints: uses selected post
- Generate endpoint → Blog agent: invokes (evidence: `backend/content/views.py`)
- Blog agent → MCP tool server: loads tools (evidence: `backend/agents.py`)
- Blog agent → Gemini model: creates agent with (evidence: `backend/agents.py`)
- Blog agent → Groq title model: requests title (evidence: `backend/agents.py`)
- Generate endpoint → Generation cache: reads and writes (evidence: `backend/content/views.py`)
- Generate endpoint → Generated-link records: reads and writes (evidence: `backend/content/views.py`)
- Generate endpoint → User blog records: saves user blog (evidence: `backend/content/views.py`)
- History endpoints → User blog records: reads and updates (evidence: `backend/content/data.py`)
- Generate endpoint → Admin notification task: dispatches (evidence: `backend/content/views.py`)
- Admin notification task → Email service: sends email (evidence: `backend/users/tasks.py`)
- Admin notification task → Celery runtime: runs as task (evidence: `backend/users/tasks.py`)
