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 with a Python FastAPI backend that automatically generates and publishes technical blog posts whenever you solve a LeetCode problem.
It extracts the problem statement, solution code, and author details directly from the LeetCode page, then uses AI providers like Gemini, OpenAI, or Perplexity to generate a beginner-friendly and structured blog post.
The generated content can be published to platforms like Dev.to, Hashnode, Medium, or even a custom blog webhook โ helping developers share their coding journey quickly and consistently.
No manual copy-pasting or formatting required โ just solve the problem and let the AI handle the rest.
| Feature | Description |
|---|---|
| ๐ค AI Blog Generation | Gemini, OpenAI, or Perplexity generate 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/ (Provider System) โ
โ (sends to backend) โ โ โ โ
โ โ โ โผ โ
โ popup.html / popup.js โโโJSONโโ devto.py (publishers) โ
โ (shows status) โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Python 3.10+
- Google Chrome (for the extension)
- At least one AI provider 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
# backend/.env
# value can be gemini || openai || perplexity
AI_PROVIDER=gemini
GEMINI_API_KEY=your_google_gemini_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
PERPLEXITY_API_KEY=your_perplexity_api_key_here
DEVTO_API_KEY=your_devto_api_key_here
TWILIO_ACCOUNT_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number
ELEVENLABS_API_KEY=your_elevenlabs_api_key
โ ๏ธ Never commit your.envfile. It is already listed in.gitignore.
python main.pyThe server will start at http://localhost:10000.
LeetCode Problem
โ
Chrome Extension
โ
FastAPI Backend
โ
Gemini API
โ
Generated Blog
Daily reminders are scheduled in each user's local timezone. The API process checks every 15 minutes for opted-in users whose local time is currently 11:00 PM, then queues one Celery job per due user so progress checks and alerts run concurrently.
Start Redis, then run a worker from the backend folder:
cd backend
celery -A celery_app.celery_app worker --loglevel=info -Q remindersSet REDIS_URL, CELERY_BROKER_URL, or CELERY_RESULT_BACKEND when Redis is not running at redis://localhost:6379/0.
The dashboard gives each user a visual onboarding flow for account creation, login, and integration settings. Saved settings are stored in MongoDB and used by authenticated API calls, so users no longer need to edit .env for their own Dev.to, LinkedIn, WhatsApp, timezone, or AI-provider preferences.
cd frontend
npm install
npm run devOpen http://localhost:5173.
Set VITE_API_URL if your FastAPI backend is not running at http://localhost:10000.
VITE_API_URL=https://your-backend-url npm run dev- 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 # FastAPI entry point and API routes
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # โ ๏ธ Your secrets (NOT committed)
โ โ
โ โโโ ai
โ โ โโโ blog_generator.py
โ โ โโโ __init__.py
โ โ โโโ prompts.py
โ โ โโโ provider_manager.py
โ โ โโโ providers
โ โ โโโ base.py
โ โ โโโ gemini_provider.py
โ โ โโโ openai_provider.py
โ โ โโโ perplexity_provider.py
โ
โโโ extension/ # Chrome Extension (MV3)
โ โโโ manifest.json # Extension config
โ โโโ content.js # Scrapes LeetCode page data
โ โโโ background.js # Chrome extension service worker for backend communication
โ โโโ 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: Support publishing generated blogs to Dev.to, Medium, Hashnode, and custom personal blog webhooks.
- Customizable Prompts: Allow users to configure prompts for Gemini, OpenAI, or Perplexity so they can customize the tone and style of generated blog posts.
- 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 (
AI_PROVIDER, AI API keys, and publishing platform API keys) in the Render dashboard - Copy your public Render URL and update
API_URLinextension/background.js
We โค๏ธ contributions! LeetLog AI is part of GSSoC 2026 and welcomes contributors of all experience levels, including beginners who are getting started with open source.
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 provider
- OpenAI โ AI provider
- Perplexity AI โ AI provider
- Dev.to API, Hashnode, Medium, and custom webhooks โ Publishing platforms
- FastAPI โ Backend framework
- All GSSoC contributors ๐ช
