Building promobot: # From Code to Content: Buildi...
Source: Dev.to
The Problem
As developers we pour our hearts and souls into building amazing projects.
But once the code is written, a new, often dreaded challenge arises: marketing.
Crafting unique launch announcements for Reddit, Dev.to, Twitter (X), and Peerlist – each with its own tone and audience – can be a time‑consuming and demotivating chore.
What if your project could market itself?
What if yourREADME.mdwas all it took to kick off a multi‑platform launch campaign tailored to each audience?
That’s the problem I set out to solve with PromoBot.
What is PromoBot?
PromoBot is an autonomous “Marketing Agent” designed specifically for developers.
It bridges the gap between your codebase and your community by automatically generating and publishing launch posts across multiple platforms.
Core Workflow
- Code → Content – PromoBot reads your project’s source code or, more commonly, your
README.md. - AI‑Powered Tone Adaptation – Leveraging Google Gemini, it crafts unique content tailored to the specific tone and style required by each platform.
- Multi‑Platform Publishing – It then publishes these posts to Reddit, Dev.to, Twitter (X), and Peerlist.
- API‑less Integration – For platforms without robust public APIs (like X and Reddit), PromoBot employs browser automation (Playwright) to seamlessly interact with the web interface.
Essentially, PromoBot turns your project’s documentation into a dynamic marketing campaign, freeing you up to focus on what you do best: building.
Architecture Overview
PromoBot is built with an event‑driven, microservices‑like architecture, allowing for modularity, scalability, and resilience.
1. Gemini 1.5 Flash (AI Engine)
A custom REST client sends the project context (from README.md) and platform requirements to Gemini, which is responsible for:
- Understanding Project Context – Analyzing the provided text to grasp purpose, features, and target audience.
- Tone Adaptation – Dynamically adjusting voice, style, and structure for Reddit, Dev.to, X, and Peerlist.
- Drafting Posts – Generating the initial draft of the launch post for each platform.
2. Playwright (Browser Automation)
For platforms lacking robust public APIs, Playwright (Python) acts as PromoBot’s “hands”, simulating real user interactions in a headless browser:
- Navigate Websites – Log in, locate submission forms, interact with UI elements.
- Bypass Restrictions – Mimic human browsing behavior to avoid bot detection.
- Publish Content – Paste AI‑generated content and submit posts programmatically.
3. Celery + Redis (Task Queue & Message Broker)
Publishing to multiple platforms—especially those involving browser automation—can be time‑consuming and prone to transient failures. Celery and Redis form PromoBot’s “nerves”, ensuring reliable execution:
- Decoupled Operations – Each publishing task (e.g., “post to Reddit”, “post to X”) is an independent Celery task.
- Reliable Delivery – Failed tasks (network error, temporary platform issue) are automatically retried.
- Concurrency – Multiple tasks run in parallel, speeding up the overall campaign.
4. PostgreSQL + SQLAlchemy (Persistence Layer)
To keep track of campaigns, user sessions, and configurations, PromoBot utilizes PostgreSQL as its relational database. SQLAlchemy abstracts raw SQL queries:
- Session Management – Securely stores encrypted session cookies for universal authentication.
- Campaign History – Logs details of each launch, including targeted platforms and post statuses.
- Configuration – Stores platform‑specific settings and user preferences.
5. Strategy Pattern (Extensible Platform Support)
PromoBot employs the Strategy Pattern to make adding new platforms painless:
- Plugin‑Based Architecture – Each platform (Reddit, X, Dev.to, Peerlist) is a separate “strategy” or plugin.
- Decoupled Logic – The main publishing orchestrator simply calls the
publishmethod on the appropriate strategy, abstracting away platform‑specific details. - Easy Expansion – Adding a new platform only requires implementing a new
PublisherStrategyclass.
Key Features
| Feature | Description |
|---|---|
| Universal Auth | Log into Reddit/X/Peerlist once. PromoBot securely saves the session state to the secrets/ directory, allowing subsequent runs without re‑authentication. |
| Context‑Aware | PromoBot automatically navigates to your current project folder, reads README.md, and uses it as the primary source of truth for content generation. No copy‑pasting needed! |
| Stealth Mode | Uses advanced browser flags and subtle interaction patterns via Playwright to bypass bot detection on X and Reddit, ensuring posts go live. |
| Dynamic Tone Matching | AI tailors the voice per platform: • Reddit – Casual, humble “I built this, what do you think?” vibe. • Dev.to – Technical, tutorial‑style, sharing insights or problem‑solving. • Twitter (X) – Short, punchy, hashtag‑optimized. • Peerlist – Professional “Indie Hacker” tone, focusing on problem solved, tech stack, and journey. |
Tech Stack
- Language: Python 3.11 (leveraging async capabilities)
- Frameworks: Celery (task management), SQLAlchemy (ORM)
- Infrastructure: Docker Compose (spins up Redis & PostgreSQL)
- Automation: Playwright (Python) for browser interactions
- AI: Google Gemini 1.5 Flash (via custom REST client)
Getting Started
Below is a minimal Docker‑Compose setup to spin up the required services:
# docker-compose.yml
version: "3.9"
services:
redis:
image: redis:7-alpine
ports:
- "6379:6379"
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: promobot
POSTGRES_PASSWORD: secretpassword
POSTGRES_DB: promobot_db
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata:
-
Clone the repository
git clone https://github.com/yourname/promobot.git cd promobot -
Start supporting services
docker compose up -d -
Install Python dependencies
pip install -r requirements.txt -
Run the initial migration
alembic upgrade head -
Launch the Celery worker
celery -A promobot.celery_app worker --loglevel=info -
Execute a campaign (example)
python -m promobot.run_campaign --project-path /path/to/your/project
Note: The first run will prompt you to log into each platform. Session cookies are stored encrypted under
secrets/.
Future Roadmap
- Add support for LinkedIn and Hacker News (new strategy plugins).
- Introduce a web UI for campaign scheduling and analytics.
- Integrate LangChain for more sophisticated prompt engineering.
- Implement rate‑limit handling per platform to improve reliability.
Conclusion
PromoBot transforms a simple README.md into a multi‑platform launch engine, letting developers focus on building while the bot handles the noisy, repetitive work of marketing. By combining Google Gemini, Playwright, Celery, Redis, and PostgreSQL under a clean, extensible architecture, PromoBot demonstrates how modern Python tooling can automate real‑world developer workflows.
Happy coding—and happy launching! 🚀
Playwright for headless browser control
Ready to give PromoBot a spin? Once you have Docker Compose running Redis and Postgres, and your Python environment set up, using PromoBot is incredibly straightforward.
Quick start
- Navigate to the root directory of any project you want to promote.
- Run:
promobot all
What the command does
- Read your current project’s
README.md. - Generate platform‑specific content using AI.
- Publish to all configured platforms (Reddit, Dev.to, X, Peerlist).
You can also run specific platform publishers if you only want to target certain channels.
Why use PromoBot?
PromoBot is more than just an automation tool; it’s a strategic partner for developers who want to share their work effectively without the marketing overhead. By combining the power of AI with robust browser automation and an extensible architecture, PromoBot empowers you to turn your code into compelling content, tailored for every audience.
Contribute / Learn more
Want to contribute or learn more about the internals? Check out the GitHub repository (if this were real, I’d link it here!):
🔗
Happy coding, and happy promoting!