An AI-powered application for generating and posting tweets using OpenAI and Twitter API.
- 🤖 AI-powered tweet generation using OpenAI
- 🐦 Direct Twitter posting integration
- 🔐 Secure Twitter OAuth authentication
- 📱 Responsive modern UI with Tailwind CSS
- ⚡ Fast development with Vite and React
- Node.js with Express
- Twitter API v2
- OpenAI API
- Passport.js for OAuth
- Express Sessions
- React 19
- Vite
- Tailwind CSS
- React Router DOM
- Axios for API calls
- Twitter Developer Account with API keys
- OpenAI API key
- GitHub repository
Set these environment variables in your Render dashboard:
TWITTER_CONSUMER_KEY=your_twitter_consumer_key
TWITTER_CONSUMER_SECRET=your_twitter_consumer_secret
TWITTER_CALLBACK_URL=https://your-app-name.onrender.com/auth/twitter/callback
OPENAI_API_KEY=your_openai_api_key
SESSION_SECRET=your_secure_random_string
NODE_ENV=production
FRONTEND_URL=https://your-app-name.onrender.com
-
Push to GitHub: Push your code to a GitHub repository
-
Create Render Service:
- Go to Render Dashboard
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Choose your repository and branch
-
Configure Build Settings:
- Build Command:
cd Frontend && npm install && npm run build && cd ../Backend && npm install - Start Command:
cd Backend && npm start - Environment: Node
- Build Command:
-
Add Environment Variables:
- Go to your service's Environment tab
- Add all the environment variables listed above
- Make sure to replace placeholder values with your actual API keys
-
Update Twitter App Settings:
- Go to your Twitter Developer Portal
- Update your app's callback URL to:
https://your-app-name.onrender.com/auth/twitter/callback - Update your website URL to:
https://your-app-name.onrender.com
-
Deploy: Click "Create Web Service" and wait for deployment
-
Install Dependencies:
npm run install:all
-
Set up Environment Variables:
- Copy
Backend/.env.exampletoBackend/.env - Fill in your API keys and secrets
- Copy
-
Run Development Servers:
# Backend (runs on http://localhost:5000) npm run dev:backend # Frontend (runs on http://localhost:5173) npm run dev:frontend
- Make sure your Twitter app has Read and Write permissions
- Keep your API keys secure and never commit them to version control
- The app serves the React build files in production
- CORS is configured for both development and production environments
- Build Failures: Check that all dependencies are properly listed in package.json
- Authentication Issues: Verify your Twitter callback URL matches exactly
- CORS Errors: Ensure FRONTEND_URL environment variable is set correctly
- API Errors: Check that all API keys are valid and properly set
For issues and questions, please check the documentation or create an issue in the repository.