An AI-powered tech blog that automatically generates content from trending Reddit topics. Built with Next.js, TypeScript, and Google's Generative AI.
- AI-Generated Content: Automatically creates blog posts from trending Reddit topics
- Multi-Source Aggregation: Fetches content from r/technology, r/artificial, r/cybersecurity, and r/saas
- AI-Generated Images: Creates relevant visuals using Google's Gemini AI
- Responsive Design: Modern, mobile-friendly interface built with Tailwind CSS
- Database Storage: PostgreSQL database with Prisma ORM
- Admin Panel: Manage blog posts (archive, make private)
- SEO Optimized: Meta descriptions and proper page structure
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS 4
- Database: PostgreSQL with Prisma ORM
- AI: Google Generative AI (Gemini)
- Deployment: Vercel-ready
- Content Sources: Reddit API integration
- Node.js 18+
- PostgreSQL database
- Google AI API key (Gemini)
-
Clone the repository
git clone <your-repo-url> cd blog-ai
-
Install dependencies
npm install
-
Set up environment variables Create a
.env.localfile:DATABASE_URL="postgresql://username:password@localhost:5432/blog_ai" GEMINI_API_KEY="your-google-ai-api-key"
-
Set up the database
npx prisma generate npx prisma db push
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
GET /api/blogs- Fetch blog posts with paginationPOST /api/blogs- Create new blog postPUT /api/blogs/[id]- Update blog postDELETE /api/blogs/[id]- Delete blog post
POST /api/generate-blogs- Generate new blog posts from RedditPOST /api/generate-from-topic- Generate blog from specific topicPOST /api/generate-from-url- Generate blog from URL content
POST /api/auth- Admin authentication
blog-ai/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── api/ # API routes
│ │ ├── admin/ # Admin panel
│ │ ├── blog/ # Blog post pages
│ │ └── page.tsx # Homepage
│ ├── components/ # React components
│ ├── lib/ # Utilities
│ └── types/ # TypeScript types
├── prisma/ # Database schema & migrations
├── public/ # Static assets
└── package.json
The system automatically:
- Fetches trending posts from specified subreddits
- Extracts comments and context
- Generates comprehensive blog posts using Google's Gemini AI
- Creates relevant images for each post
- Stores everything in the database
- Technology: Latest tech trends and innovations
- Artificial Intelligence: AI/ML developments and discussions
- Cybersecurity: Security news and best practices
- SaaS: Software-as-a-Service industry insights
- Archive/unarchive posts
- Make posts private/public
- View all posts with filtering
- Manual content generation
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Yes |
GEMINI_API_KEY |
Google AI API key | Yes |
- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push to main branch
npm run build
npm start- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Reddit communities for inspiring content
- Google Generative AI for content creation
- Next.js team for the amazing framework
- Vercel for seamless deployment
If you have any questions or need help, please open an issue in the repository.
Note: This project uses AI to generate content from Reddit discussions. We always credit original sources and maintain transparency about AI-generated content.