An AI-powered social media content generator that creates engaging posts using agentic AI workflows. Generate and publish content across multiple platforms with intelligent automation.
- 🤖 Agentic AI: LangGraph-based agent with multi-step workflow
- ✍️ Content Generation: Gemini Pro for creative social media content
- 🏷️ Smart Hashtags: Automatic hashtag generation
- 🔐 OAuth 2.0: Secure Twitter authentication with PKCE
- 🐦 Multi-Platform: Twitter, LinkedIn, Reddit support (expanding)
- 📊 Post History: Track all your published content
- 👤 User Authentication: Supabase-powered auth system
- 🎨 Modern UI: Next.js with Tailwind CSS and shadcn/ui
- Python 3.9+
- FastAPI
- LangGraph (Agentic AI)
- Google Gemini Pro
- Tweepy (Twitter API)
- Next.js 14
- TypeScript
- Tailwind CSS
- shadcn/ui components
ai-agents-tweet/
├── backend/ # Python backend
│ ├── agent/ # LangGraph agent
│ ├── services/ # Gemini & Twitter services
│ ├── storage/ # JSON storage
│ └── main.py # FastAPI app
├── frontend/ # Next.js frontend
│ ├── app/ # Pages
│ ├── components/ # React components
│ └── lib/ # API client
└── docs/ # Documentation
├── BACKEND_DOCUMENTATION.md
├── PLAN.md
├── PYTHON_LEARNING_GUIDE.md
├── SETUP.md
├── TWITTER_OAUTH_SETUP.md
└── TWITTER_POST.md
-
Create virtual environment:
cd backend python3 -m venv venv source venv/bin/activate # On Mac/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
cp .env.example .env # Edit .env with your API keys -
Get API Keys:
- Gemini API: https://makersuite.google.com/app/apikey
- Twitter API: https://developer.twitter.com/
-
Run the backend:
python main.py # Server runs on http://localhost:8000
-
Install dependencies:
cd frontend npm install -
Configure environment:
cp .env.example .env.local # Update NEXT_PUBLIC_API_URL if needed -
Install Tailwind dependencies:
npm install tailwindcss-animate
-
Run the frontend:
npm run dev # App runs on http://localhost:3000
- Open http://localhost:3000 in your browser
- Enter a prompt (e.g., "Write about AI and creativity")
- Click "Generate Tweet"
- Review the generated content with hashtags
- Click "Post to Twitter" to publish
- View your posted tweet and history
GET /- API infoGET /health- Health checkPOST /api/generate- Generate tweet from promptPOST /api/post- Post tweet to TwitterGET /api/history- Get tweet history
GEMINI_API_KEY=your_gemini_api_key
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
TWITTER_ACCESS_TOKEN=your_twitter_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_twitter_access_token_secret
CORS_ORIGINS=http://localhost:3000
PORT=8000NEXT_PUBLIC_API_URL=http://localhost:8000- Push code to GitHub
- Create Web Service on Render
- Set build command:
pip install -r backend/requirements.txt - Set start command:
cd backend && uvicorn main:app --host 0.0.0.0 --port $PORT - Add environment variables
- Push code to GitHub
- Import project in Vercel
- Set root directory:
frontend - Add
NEXT_PUBLIC_API_URLenvironment variable - Deploy
For detailed documentation, see the docs/ folder:
- SETUP.md - Detailed setup instructions
- BACKEND_DOCUMENTATION.md - Backend architecture and API reference
- PLAN.md - Project implementation plan
- PYTHON_LEARNING_GUIDE.md - Python learning resources
- TWITTER_OAUTH_SETUP.md - Twitter OAuth configuration
- TWITTER_POST.md - Twitter posting guide
MIT
Built with ❤️ using AI Agents
source venv/bin/activate && python3 main.py source venv/bin/activate && pip install -r requirements.txt