Problem
For indie developers and small teams, publishing a blog post or newsletter often means juggling several repetitive tasks: writing a headline, crafting a meta description, and ensuring the content meets SEO best practices. These steps are usually done manually in the UI, which slows down the content pipeline and introduces human error. When a developer wants to ship a side project, the marketing automation stack should handle these details automatically, freeing time for coding.
Solution
DoAide Pulse introduces an AI‑powered feature that auto‑generates SEO titles and descriptions. Instead of clicking a “Generate” button that runs a basic templating engine, the system now calls an LLM to produce high‑quality, keyword‑rich fields. The generated content feeds directly into the content calendar and the dev.to API, ensuring that every published article is optimised for search and ready for distribution.
The feature is built on top of the existing FastAPI back‑end, SQLAlchemy models, and a Celery worker that queues AI calls. The React front‑end exposes a single button that, when pressed, triggers a FastAPI POST endpoint. The response is streamed back to the UI, updating the SEO fields in real time.
Implementation
Database Model
The ProjectContent model already contains seo_title and seo_description columns. The new generate_seo method calls the AI service and persists the result:
class ProjectContent(Base):
__tablename__ = "project_content"
id = Column(Integer, primary_key=True)
title = Column(String, nullable=False)
body = Column(Text, nullable=False)
seo_title = Column(String, nullable=True)
seo_description = Column(String, nullable=True)
def generate_seo(self, ai_client: OpenAIClient):
prompt = f"Generate a concise SEO title and meta description for the following content:\n\n{self.title}\n\n{self.body[:200]}"
result = ai_client.complete(prompt)
self.seo_title, self.seo_description = result.split("\n", 1)
FastAPI Endpoint
The endpoint receives the content ID and triggers the generation asynchronously:
@router.post("/content/{content_id}/seo")
async def generate_seo(content_id: int, db: Session = Depends(get_db)):
content = db.query(ProjectContent).filter_by(id=content_id).one()
task = celery.send_task("tasks.generate_seo", args=[content.id])
return {"task_id": task.id}
Celery Worker
The worker fetches the content, calls the AI client, and updates the database:
@celery.task(name="tasks.generate_seo")
def generate_seo_task(content_id: int):
db = SessionLocal()
content = db.query(ProjectContent).filter_by(id=content_id).one()
ai_client = OpenAIClient(api_key=os.getenv("OPENAI_KEY"))
content.generate_seo(ai_client)
db.commit()
React Component
A minimal component shows the button and displays the generated fields:
function SeoGenerator({ contentId }) {
const [seo, setSeo] = useState(null);
const generate = async () => {
const res = await fetch(`/api/content/${contentId}/seo`, { method: "POST" });
const { task_id } = await res.json();
const poll = setInterval(async () => {
const r = await fetch(`/api/tasks/${task_id}`);
if (r.status === 200) {
const data = await r.json();
setSeo(data);
clearInterval(poll);
}
}, 500);
};
return (
<div>
<button onClick={generate}>Generate SEO</button>
{seo && (
<div className="mt-4">
<h3>{seo.seo_title}</h3>
<p>{seo.seo_description}</p>
</div>
)}
</div>
);
}
The component uses Tailwind CSS for styling and Vite for bundling, keeping the UI lightweight.
User Experience
From the developer’s perspective, the process is straightforward:
- Create or edit a post in the Pulse editor.
- Click the Generate SEO button.
- The UI shows a spinner while the Celery task processes.
- Once finished, the SEO title and description appear instantly.
- The fields are automatically populated in the content calendar, colour‑coded for visibility.
- When the post is scheduled, the dev.to API publishes the article with the SEO metadata attached.
This workflow eliminates the need for a separate marketing person to draft SEO copy, integrating the entire promotion pipeline into the developer’s existing tools.
Technical Details
- FastAPI handles the HTTP layer, providing a lightweight API that scales with the number of concurrent requests.
- SQLAlchemy ensures that the generated SEO fields are stored in PostgreSQL, maintaining ACID guarantees.
- Celery with Redis as the broker queues AI calls, preventing API rate‑limit spikes and allowing retries.
- The dev.to API consumes the
seo_titleandseo_descriptionfields when publishing, ensuring consistent metadata across platforms. - The content calendar uses calendar color‑coding to differentiate posts with AI‑generated SEO, giving a quick visual cue.
Conclusion
The AI‑generated SEO feature in DoAide Pulse exemplifies how marketing automation can be tightly coupled with developer workflows. By leveraging FastAPI, SQLAlchemy, Celery, and an LLM, the platform removes a manual bottleneck and delivers SEO‑optimised content ready for publication on dev.to and other channels. Indie developers can now ship side projects faster, with professional marketing support built directly into their codebase.
Top comments (0)