A powerful Next.js application that uses OpenAI's ChatGPT and DALL-E to generate engaging text content and stunning images for social media posts. This tool helps content creators, marketers, and social media managers create compelling posts with AI assistance.
- ChatGPT Integration: Generate high-quality, engaging text using OpenAI's ChatGPT
- Multiple Post Types: Motivational, educational, promotional, engagement, storytelling, and news posts
- Platform Optimization: Tailored content for Twitter, LinkedIn, Facebook, and Instagram
- Tone Customization: Choose from 8 different tones (professional, casual, enthusiastic, etc.)
- Smart Character Limits: Real-time validation for different platform requirements
- DALL-E Integration: Create unique images using OpenAI's DALL-E 3
- Style Options: Multiple artistic styles (digital art, photorealistic, minimalist, etc.)
- High Quality: 1024x1024 resolution images perfect for social media
- Download Support: Save generated images directly to your device
- Responsive Design: Works seamlessly on desktop and mobile devices
- Copy to Clipboard: Instantly copy generated text
- Real-time Feedback: Loading states and error handling
- TypeScript Support: Fully typed for better development experience
- Motivational Quote: Inspirational content for motivating your audience
- Quick Tip: Share helpful tips and advice
- Engagement Question: Ask questions to boost engagement
- Announcement: Share important updates and news
- Educational Post: Share educational content and facts
- Node.js 18.0 or later
- npm, yarn, pnpm, or bun
- OpenAI API key (get one at platform.openai.com)
- Clone the repository:
git clone <your-repository-url>
cd social_media- Install dependencies:
npm install
# or
yarn install
# or
pnpm install
# or
bun install- Set up environment variables:
# Copy the example file
copy .env.local.example .env.local
# Edit .env.local and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
DEMO_MODE=false.env.local file to GitHub. It's already included in .gitignore to protect your API keys.
- Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev- Open http://localhost:3000 in your browser to see the application.
- Select Post Type: Choose from motivational, educational, promotional, engagement, storytelling, or news
- Choose Platform: Select Twitter, LinkedIn, Facebook, or Instagram
- Set Tone: Pick from 8 different tone options
- Enter Prompt: Describe what you want to post about
- Generate: Click "Generate AI Text" to create your content
- Copy: Use the "Copy Text" button to copy to clipboard
- Describe Image: Enter a detailed description of the image you want
- Choose Style: Select from various artistic styles
- Generate: Click "Generate AI Image" to create your image
- Download: Save the image to your device
You can create custom templates using placeholder variables:
{topic}- Will be replaced with your topic{message}- Will be replaced with your main message
Example custom template:
🚀 New blog post about {topic}! {message} Check it out: [link] #blog #content
- Twitter/X: 280 characters
- LinkedIn: 2,200 characters
- Facebook: 2,200 characters
The application automatically validates your generated text against these limits.
src/
├── app/
│ ├── globals.css
│ ├── layout.tsx
│ └── page.tsx
└── components/
└── SocialMediaGenerator.tsx
- Next.js 14: React framework with App Router
- TypeScript: Type-safe JavaScript
- Tailwind CSS: Utility-first CSS framework
- OpenAI API: ChatGPT for text generation and DALL-E for image generation
- React: UI library
This application uses OpenAI's paid APIs:
- ChatGPT (gpt-3.5-turbo): ~$0.002 per 1K tokens (very affordable for text generation)
- DALL-E 3: ~$0.04 per image (1024x1024 resolution)
Monitor your usage at platform.openai.com/usage
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
- AI text generation with ChatGPT
- AI image generation with DALL-E
- Multiple post types and tones
- Platform-specific optimization
- Batch content generation
- Content scheduling integration
- Social media analytics
- Custom brand voice training
- Multi-language support
- Integration with social media APIs for direct posting
- Content performance tracking
- Team collaboration features
If you encounter any issues or have questions, please open an issue on GitHub.