Skip to content

atul120212/genBlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– GenBlog β€” AI-Powered Blog Generation Platform

Transform any YouTube video, audio file, PDF document, or text topic into a fully polished, SEO-optimized blog post in seconds β€” powered by Groq LLaMA, AssemblyAI, and Pollinations.ai FLUX.


✨ Features

Feature Description
πŸŽ₯ YouTube β†’ Blog Paste a YouTube URL β†’ audio is downloaded via yt-dlp β†’ transcribed by AssemblyAI β†’ Groq writes the blog
πŸŽ™οΈ Audio β†’ Blog Upload any audio file β†’ Gemini transcribes β†’ Groq writes the blog
πŸ“„ PDF β†’ Blog (RAG) Upload a PDF β†’ stored in ChromaDB β†’ used as context for Groq blog generation
✍️ Text β†’ Blog Enter a topic or text β†’ Groq generates a full blog post with SEO metadata
πŸ–ΌοΈ AI Thumbnail Blog images generated by Pollinations.ai (FLUX)
πŸ“Š Content Scoring Auto-computes SEO Score, Readability Score, and Engagement Score
πŸ” Blog Versioning Every generation and regeneration is saved as a versioned snapshot
πŸ‘€ User Profiles Auth system with custom user model, profile image, public blog listing
πŸ’¬ Explore & Like Discover and like community blogs
πŸ“¬ Contact Form Built-in contact messages saved to DB

πŸ—οΈ Architecture & Flow

YouTube URL
    β”‚
    β”œβ”€β–Ί [yt-dlp]             Download best audio (m4a/webm) β€” no FFmpeg needed
    β”‚
    β”œβ”€β–Ί [AssemblyAI]         Transcribe audio using universal-3-pro speech model
    β”‚
    └─► [Groq LLaMA-3.3-70B] Generate blog + SEO metadata (single API call)
            β”‚
            └─► [Pollinations.ai FLUX]  Generate blog thumbnail image
                        β”‚
                        └─► [Django + SQLite]  Save blog post, version, thumbnail
Text / Topic
    β”‚
    β”œβ”€β–Ί [DuckDuckGo Search]  (optional) Web research context
    β”œβ”€β–Ί [ChromaDB RAG]       (optional) PDF document context
    β”‚
    └─► [Groq LLaMA-3.3-70B] Generate blog + SEO metadata (single API call)

🧰 Tech Stack

Backend

Python Django SQLite

AI / LLM

Groq AssemblyAI Pollinations.ai Gemini

Media & Audio

yt-dlp

Vector DB / RAG

ChromaDB

Frontend

HTML5 CSS3 JavaScript


πŸ“¦ Key Dependencies

Package Version Purpose
django 5.0.6 Web framework, ORM, auth
groq latest LLaMA 3.3 70B blog generation
assemblyai 0.59.0 Audio transcription (universal-3-pro)
yt-dlp 2026.3.17 YouTube audio download
chromadb latest Vector DB for PDF/RAG context
PyPDF2 latest PDF text extraction
textstat latest Readability score calculation
duckduckgo-search latest Web research context
google-generativeai 0.5.4 Audio file transcription fallback
youtube-transcript-api 0.6.2 YouTube captions (legacy route)
python-dotenv 1.0.1 Environment variable management
Pillow 10.3.0 Image handling

βš™οΈ Setup & Installation

1. Clone the repository

git clone https://github.com/atul120212/GenBlog.git
cd GenBlog

2. Create virtual environment

python -m venv .venv
.venv\Scripts\activate     # Windows
# source .venv/bin/activate  # macOS/Linux

3. Install dependencies

pip install -r requirements.txt
pip install groq assemblyai yt-dlp

4. Configure environment variables

Create a .env file in the project root:

GEMINI_API_KEY=your_gemini_api_key_here
GROQ_API_KEY=your_groq_api_key_here
ASSEMBLYAI_API_KEY=your_assemblyai_api_key_here
CONTACT_EMAIL=your_email@example.com

Where to get free API keys:

Service Free Tier Link
Groq 14,400 req/day console.groq.com
AssemblyAI 100 hours/month assemblyai.com
Pollinations.ai 100% Free / No Key pollinations.ai
Gemini 1,500 req/day aistudio.google.com/apikey

5. Run migrations

python manage.py migrate

6. Start the development server

python manage.py runserver

Visit http://127.0.0.1:8000


πŸ—‚οΈ Project Structure

genBlog-1/
β”œβ”€β”€ GenBlog/                  # Django project config (settings, urls, wsgi)
β”œβ”€β”€ generator/                # Main app
β”‚   β”œβ”€β”€ agents.py             # AI pipeline (Groq + AssemblyAI + Pollinations)
β”‚   β”œβ”€β”€ views.py              # API endpoints & page views
β”‚   β”œβ”€β”€ models.py             # BlogPost, CustomUser, Like, BlogVersion, Document
β”‚   β”œβ”€β”€ urls.py               # URL routing
β”‚   β”œβ”€β”€ rag_service.py        # ChromaDB PDF ingestion & querying
β”‚   β”œβ”€β”€ scoring.py            # SEO, readability, engagement scoring
β”‚   β”œβ”€β”€ signals.py            # Django signals
β”‚   └── migrations/           # DB migrations
β”œβ”€β”€ templates/                # HTML templates
β”‚   β”œβ”€β”€ generator.html        # Main blog generation UI
β”‚   β”œβ”€β”€ blog_detail.html      # Blog reading page
β”‚   β”œβ”€β”€ explore.html          # Community blog discovery
β”‚   β”œβ”€β”€ profile.html          # User profile page
β”‚   β”œβ”€β”€ index.html            # Landing page
β”‚   β”œβ”€β”€ login.html / register.html
β”‚   └── ...
β”œβ”€β”€ media/                    # Uploaded files (thumbnails, audio, PDFs)
β”œβ”€β”€ chroma_db/                # ChromaDB vector store (auto-created)
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env                      # API keys (not committed to git)
└── manage.py

🌐 API Endpoints

Method URL Description
GET / Landing page
GET /generate Blog generation UI
POST /generate_agent Main endpoint β€” handles all input types
POST /regenerate_blog Edit existing blog with instruction
POST /topic_view Legacy: text topic β†’ blog (Groq)
POST /yt_view Legacy: YouTube β†’ blog
POST /blog_submit Publish or cancel a draft blog
GET /explore Browse all public blogs
GET /blog/<slug> View a blog post
POST /like/<post_id>/ Like a blog
GET/POST /profile User profile
GET /profile/<id>/ Public profile by ID
POST /blog/update/<id>/ Update blog content
GET /blog/delete/<id>/ Delete blog
GET/POST /contact Contact form

🧠 AI Agent Pipeline (agents.py)

The entire pipeline is designed around one Groq API call per blog to maximize free-tier efficiency:

ResearchAgent (zero API calls)
    β”œβ”€β”€ DuckDuckGo web search (optional)
    └── ChromaDB RAG context (optional)

BlogGenerationWorkflow (ONE Groq call)
    └── Returns: blog content (Markdown) + SEO metadata (JSON)

generate_blog_image (Pollinations.ai call, free/no key, non-blocking)
    └── Returns: PNG bytes or None (failure is silent)

Content Scoring (zero API calls, local computation):

  • SEO Score β€” checks word count, meta tags, headings, keyword density
  • Readability Score β€” Flesch Reading Ease via textstat
  • Engagement Score β€” heuristic: questions, lists, bold text, exclamations

πŸ’‘ The Problem It Solves

In today's crowded blogging market, beginners struggle to create quality content consistently. GenBlog empowers new bloggers by letting them:

  • Convert any content format (video, audio, PDF, text) into professional blogs
  • Get SEO metadata generated automatically
  • Start publishing without needing writing expertise
  • Iterate on drafts using AI-powered regeneration

πŸ“Έ Screenshots

🏠 Home Page

Homepage

πŸ” Login Page

Login

✍️ Generation Page

Generator

πŸ“ Generated Blog

Generated


🀝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


πŸ“„ License

This project is open source. See LICENSE for details.


Built with ❀️ by Atul Sharma

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors