A powerful automation system that transforms topics into professional LinkedIn posts with AI-generated visuals, and publishes them automatically. Manage topics directly in the web interface - no external tools needed!
Remove the "manual" from content creation. This app manages topics directly in the web interface, generates high-quality LinkedIn posts with AI, creates professional images, and publishes them automatically to your LinkedIn feed. If no topics are available, it automatically generates random tech-related topics.
We have made running this project as easy as possible with automated startup scripts for both Windows and Linux.
Before you start, ensure you have the following installed:
- Python 3.10+: Download Python
- Node.js 18+: Download Node.js (LTS recommended)
- PostgreSQL: Download PostgreSQL
Note for Windows Users: Make sure to check "Add Python to PATH" during installation.
Linux / macOS:
# 1. Clone the repository
git clone https://github.com/YOUR_USERNAME/Linkedin-automation.git
cd Linkedin-automation
# 2. Make the script executable
chmod +x start.sh
# 3. Run the automated setup & start script
./start.shWindows:
- Clone or download the repository.
- Double-click
start.bat. - The script will automatically:
- Check for Python and Node.js
- Create a virtual environment
- Install all dependencies
- Start the Backend and Frontend servers
If you prefer to set everything up manually:
Backend Setup:
cd backend
python -m venv venv # Create virtual environment
source venv/bin/activate # Linux/Mac
# venv\Scripts\activate # Windows
pip install -e . # Install dependencies (run in root directory)Frontend Setup:
cd frontend
npm install # Install dependenciesDatabase (PostgreSQL):
Ensure PostgreSQL is running and you have a database created (default is linkedin_bot).
If the automated script cannot create the database (usually due to permissions), follow these steps:
-
Switch to the postgres user:
sudo -i -u postgres
-
Access the PostgreSQL shell:
psql
-
Run the following SQL commands:
-- Create the database CREATE DATABASE linkedin_bot; -- Create a user with a password CREATE USER bot_user WITH PASSWORD 'your_password'; -- Grant privileges GRANT ALL PRIVILEGES ON DATABASE linkedin_bot TO bot_user; -- (Optional) If using PostgreSQL 15+ \c linkedin_bot GRANT ALL ON SCHEMA public TO bot_user;
-
Exit: Type
\qto exit psql, thenexitto logout of the postgres user.
- Open the "SQL Shell (psql)" application from your Start Menu.
- Press
Enterthrough the defaults (Server, Database, Port, Username) until it asks for your password. - Enter the password you set during installation.
- Run the same SQL commands as above:
CREATE DATABASE linkedin_bot; CREATE USER bot_user WITH PASSWORD 'your_password'; GRANT ALL PRIVILEGES ON DATABASE linkedin_bot TO bot_user;
- Note: By default, Windows PostgreSQL usually installs with the user
postgresand the password you selected. You can use that directly in your.envfile if you prefer not to create a new user:DATABASE_URL=postgresql://postgres:YOUR_INSTALL_PASSWORD@localhost/linkedin_bot
The project uses a .env file for configuration. The startup scripts will create a default one for you from .env.example.
Once the app is running, go to the Settings Tab in the dashboard (http://localhost:5173) to configure:
- Google Gemini API Key: Get Key (For text generation)
- Flux.1 (Fal.ai) API Key: Get Key (For image generation)
- LinkedIn OAuth: Create App
- Redirect URL:
http://localhost:8000/api/linkedin/callback - Permissions:
w_member_social,openid,profile
- Redirect URL:
If you want to use a custom database user/password, edit the .env file:
DATABASE_URL=postgresql://your_user:your_password@localhost/your_db_name| Component | Role | Description |
|---|---|---|
| The Library (Web App) | Input Source | Built-in topic management system. Add topics directly in the dashboard. |
| The Brain (FastAPI) | Orchestrator | Python backend that manages the schedule, connects APIs, and processes data logic. |
| The Writer (Gemini) | Content Engine | Google's AI that reads your topic and crafts a LinkedIn post. |
| The Artist (Flux.1) | Visual Engine | High-speed image generator that takes a visual prompt from Gemini. |
| The PR Officer (LinkedIn) | Publisher | Final stage where text and image are combined and posted to your live feed. |
| The Archive (PostgreSQL) | Persistent Memory | Local database storing topics, API keys, OAuth tokens, and history. |
- Topics Tab: Add ideas for posts. The bot picks "Not Done" topics automatically.
- Settings Tab: Configure your API keys and connect your LinkedIn account.
- Schedule Tab: Set how often the bot should post (e.g., every 4 hours).
- Live Feed: View the history of generated and published posts.
Every time the scheduler runs:
- Query Database: Finds next topic. If empty, generates a random tech topic.
- Generate Content: Gemini creates post text & image prompt.
- Generate Image: Flux.1 creates the visual.
- Post: Uploads to LinkedIn via API.
- Save: Records result in database.
- API keys are encrypted before storage.
.encryption_keyprotects your secrets (do not commit this file!).- OAuth tokens are managed securely.
- PostgreSQL Error: Ensure the service is running (
sudo service postgresql startor checking Services in Windows). - LinkedIn Auth Error: Verify you added
http://localhost:8000/api/linkedin/callbackto your LinkedIn App Redirect URIs. - Dependencies: If
start.shfails, try running the manual installation steps.
Linkedin-automation/
├── backend/ # FastAPI app
├── frontend/ # React + Vite app
├── start.sh # Linux/Mac startup script
├── start.bat # Windows startup script
└── pyproject.toml # Python dependencies
This project is for personal use. Ensure compliance with LinkedIn's Terms of Service.