Skip to content

Swaraj07082/BlogAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlogAgent (The Curator)

Generate technical blog drafts from a single topic using an AI workflow (LangGraph + LangChain). The web app signs in with Google, then sends a topic to the backend to produce a Markdown draft.

What you get

  • An endpoint to generate a full blog outline + sectioned Markdown (POST /create-blog)
  • Research routing (when the workflow decides web research is needed)
  • Frontend preview UI with NextAuth authentication

Stack

  • Frontend: Next.js + NextAuth (Google OAuth)
  • Backend: FastAPI + LangGraph/LangChain (Groq + Tavily)
  • Database: Postgres (via DATABASE_URL)

Setup

  1. Copy the env template:
    • cp .env.example .env
  2. Fill in the required values in .env:
    • NEXTAUTH_SECRET
    • GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET
    • DATABASE_URL
    • GROQ_API_KEY
    • TAVILY_API_KEY
    • (optional) NEXT_PUBLIC_API_URL (defaults to http://127.0.0.1:4000 in code)

Run (Docker Compose - recommended)

docker compose up --build

Run locally (no Docker)

Backend:

cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn server:app --host 127.0.0.1 --port 4000 --reload

Frontend:

cd ../frontend
npm install
npm run dev

Backend API

POST /create-blog

Request body:

{ "topic": "Describe your topic here" }

Response:

{ "response": { "...": "draft data" } }

Auth flow (high level)

  • User signs in via Google (NextAuth)
  • Frontend calls GET /api/auth/token to mint a short-lived HS256 JWT using NEXTAUTH_SECRET
  • Backend validates that JWT with the same NEXTAUTH_SECRET and generates the blog draft

Security note

  • .env is gitignored, but this repo had real secrets in it previously.
  • Those values have been removed/sanitized in this working directory—if you had already shared/committed them elsewhere, you should rotate the impacted keys.

About

“The Curator” is an AI-assisted technical writing workflow that turns a topic into a structured, publish-ready Markdown draft.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors