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.
- 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
- Frontend: Next.js + NextAuth (Google OAuth)
- Backend: FastAPI + LangGraph/LangChain (Groq + Tavily)
- Database: Postgres (via
DATABASE_URL)
- Copy the env template:
cp .env.example .env
- Fill in the required values in
.env:NEXTAUTH_SECRETGOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRETDATABASE_URLGROQ_API_KEYTAVILY_API_KEY- (optional)
NEXT_PUBLIC_API_URL(defaults tohttp://127.0.0.1:4000in code)
docker compose up --build- Frontend: http://localhost:3000
- Backend: http://localhost:4000
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 --reloadFrontend:
cd ../frontend
npm install
npm run devPOST /create-blog
Request body:
{ "topic": "Describe your topic here" }Response:
{ "response": { "...": "draft data" } }- User signs in via Google (NextAuth)
- Frontend calls
GET /api/auth/tokento mint a short-lived HS256 JWT usingNEXTAUTH_SECRET - Backend validates that JWT with the same
NEXTAUTH_SECRETand generates the blog draft
.envis 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.