Solve a LeetCode problem โ Auto-publish a blog post to Dev.to, Hashnode, Medium, or your own site โ in seconds.
LeetLog AI is a Chrome Extension + Python backend that watches your LeetCode session and, the moment you solve a problem, automatically generates a professional, beginner-friendly blog post using Google Gemini AI and publishes it to your selected blogging platforms on your behalf.
No copy-paste. No formatting. Just solve, and let the AI do the rest.
| Feature | Description |
|---|---|
| ๐ค AI Blog Generation | Gemini generates a structured post: explanation, intuition, approach, code, complexity analysis |
| ๐ค Multi-platform publishing | Posts can be published to Dev.to, Hashnode, Medium, or a custom blog webhook |
| ๐งญ Platform selection | Choose publishing targets from the extension popup before generating a post |
| ๐ Per-platform status | The backend reports success or failure for each selected platform independently |
| โก One-click from Extension | Click "Generate Blog" in the popup โ that's it |
| ๐ Smart Code Extraction | Scrapes your solution code and problem details directly from the LeetCode page |
| ๐งโ๐ป Author Attribution | Automatically picks up your LeetCode username for the post footer |
โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Chrome Extension โ โ FastAPI Backend (Python) โ
โ โ โ โ
โ content.js โโโPOSTโโโถ /generate-blog โ
โ (scrapes LeetCode page)โ โ โ โ
โ โ โ โผ โ
โ background.js โ โ ai.py (Gemini API) โ
โ (sends to backend) โ โ โ โ
โ โ โ โผ โ
โ popup.html / popup.js โโโJSONโโโ devto.py (publishers) โ
โ (shows status) โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Python 3.10+
- Google Chrome (for the extension)
- A Google Gemini API Key
- At least one publishing API key:
- Dev.to API Key (Account โ Settings โ API Keys)
- Hashnode token + publication ID
- Medium integration token + user ID
- A custom webhook URL for personal blogs
git clone https://github.com/vanshaggarwal27/LeetcodeAI
cd LeetcodeAIcd backend
python -m venv venv
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activate
pip install -r requirements.txt# backend/.env
GEMINI_API_KEY=your_google_gemini_api_key_here
DEVTO_API_KEY=your_devto_api_key_here
HASHNODE_TOKEN=your_hashnode_token_here
HASHNODE_PUBLICATION_ID=your_hashnode_publication_id_here
MEDIUM_TOKEN=your_medium_integration_token_here
MEDIUM_USER_ID=your_medium_user_id_here
BLOG_WEBHOOK_URL=https://your-blog.example.com/api/publish
โ ๏ธ Never commit your.envfile. It is already listed in.gitignore.
python main.pyThe server will start at http://localhost:10000.
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (top-right toggle)
- Click "Load unpacked"
- Select the
extension/folder from this repository
The LeetLog AI extension icon will appear in your toolbar.
- Go to any LeetCode problem page (e.g.,
https://leetcode.com/problems/two-sum/) - Write or paste your solution
- Click the LeetLog AI extension icon
- Click "Generate Blog"
- Select one or more platforms in the popup
- Wait a few seconds โ the popup will show which platforms published successfully โ
LeetcodeAI/
โ
โโโ backend/ # Python FastAPI server
โ โโโ main.py # API routes (/generate-blog)
โ โโโ ai.py # Gemini AI blog generation logic
โ โโโ devto.py # Publishing provider registry and clients
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # โ ๏ธ Your secrets (NOT committed)
โ
โโโ extension/ # Chrome Extension (MV3)
โ โโโ manifest.json # Extension config
โ โโโ content.js # Scrapes LeetCode page data
โ โโโ background.js # Service worker โ calls backend
โ โโโ popup.html # Extension popup UI
โ โโโ popup.js # Popup event logic
โ
โโโ .gitignore
โโโ CONTRIBUTING.md
โโโ README.md
Here is a checklist of features that would be incredibly useful for the community. We welcome contributions for these!
- WhatsApp Reminder Service: Send automated daily reminders to solve LeetCode problems using the Twilio API.
- Automated Call Alerts: Trigger automated phone calls using ElevenLabs and Twilio if a user hasn't solved their daily problem by a specific time.
- Multi-platform Publishing: Add support for publishing to Medium, Hashnode, or an existing personal blog/website.
- Customizable Prompts: Allow users to configure the prompt used by Gemini so they can customize the tone and style of the generated blog post.
- Support for Other Coding Platforms: Extend support to platforms like HackerRank, Codeforces, or GeeksforGeeks.
- Dashboard/Stats Page: Create a simple dashboard to track the number of problems solved, posts published, and consistency streaks.
- Social Sharing: Automatically share the published Dev.to post to Twitter/X or LinkedIn.
The backend can be deployed for free on Render.
- Push your code to GitHub
- Create a new Web Service on Render
- Set Build Command:
pip install -r requirements.txt - Set Start Command:
uvicorn main:app --host 0.0.0.0 --port 10000 - Add your environment variables (
GEMINI_API_KEYand the API keys for your selected publishing platforms) in the Render dashboard - Copy your public Render URL and update
API_URLinextension/background.js
We โค๏ธ contributions! LeetLog AI is part of GSSoC 2025 and welcomes developers of all experience levels.
Please read our CONTRIBUTING.md for:
- How to set up your development environment
- Guidelines for submitting issues and pull requests
- Code style standards
This project is licensed under the MIT License โ see the LICENSE file for details.
- Google Gemini โ AI blog generation
- Dev.to API, Hashnode, Medium, and custom webhooks โ Publishing platforms
- FastAPI โ Backend framework
- All GSSoC contributors ๐ช