An intelligent LinkedIn post generation platform that leverages AI to create viral content with advanced virality scoring and comprehensive post management.
- AI-Powered Post Generation: Generate LinkedIn posts using Google's Gemini AI
- Virality Score Calculator: Advanced algorithm to predict post performance
- Post Library: Save and manage your generated posts
- Customizable Post Configuration: Fine-tune every aspect of your content
- Real-time Analytics: Track post performance and engagement metrics
- Post Types: Insight, Story, Question, Announcement, Tutorial
- Tone Variations: Professional, Casual, Inspirational, Humorous, Technical
- Length Options: Short, Medium, Long posts
- Format Styles: Standard, Numbered List, Bullet Points, Q&A
- Hook Styles: Question, Statistic, Story, Bold Statement
- CTA Types: Engagement, Visit Link, Follow, Comment, Share
- Hashtag Strategies: Minimal, Moderate, Extensive
- Authentication: Secure user login/registration with Better Auth
- Usage Tracking: Monitor post generation limits and usage patterns
- Feedback System: Collect user feedback and bug reports
- Responsive Design: Mobile-first design with Tailwind CSS
- Next.js 16: React framework with App Router
- React 19: Latest React version with hooks and context
- TypeScript: Type-safe development
- Tailwind CSS 4: Utility-first CSS framework
- Radix UI: Accessible component library
- React Hook Form: Form management with Zod validation
- Framer Motion: Animations and transitions
- Next.js API Routes: Serverless API endpoints
- Drizzle ORM: Type-safe SQL toolkit
- LibSQL: Lightweight SQLite database
- Better Auth: Authentication solution
- Google Gemini AI: Content generation
- Zod: Schema validation
- Node.js 18+
- pnpm (recommended) or npm/yarn
- Clone the repository
git clone <https://github.com/khalidh1b/postflow-ai.git>
cd postflow-ai- Install dependencies
pnpm install- Environment Variables
Create a
.env.localfile in the root directory:
# Database
DATABASE_URL="file:./dev.db"
# AI Service
GEMINI_API_KEY="your-google-gemini-api-key"
# Authentication (Better Auth)
BETTER_AUTH_SECRET="your-auth-secret"
BETTER_AUTH_URL="http://localhost:3000"
# Optional: OAuth Providers
AUTH_GOOGLE_ID="your-google-oauth-id"
AUTH_GOOGLE_SECRET="your-google-oauth-secret"- Database Setup
# Run database migrations
pnpm drizzle-kit push
# (Optional) Generate migrations
pnpm drizzle-kit generate- Start Development Server
pnpm devOpen http://localhost:3000 to view the application.
src/
โโโ app/ # Next.js App Router
โ โโโ api/ # API routes
โ โ โโโ auth/ # Authentication endpoints
โ โ โโโ generate-post/ # Post generation API
โ โ โโโ feedback/ # Feedback system
โ โ โโโ posts/ # Post management
โ โโโ login/ # Login page
โ โโโ register/ # Registration page
โ โโโ pricing/ # Pricing page
โ โโโ ...
โโโ components/ # React components
โ โโโ ui/ # Reusable UI components
โ โโโ auth/ # Authentication components
โ โโโ post-generator/ # Post generation components
โ โโโ layout/ # Layout components
โ โโโ ...
โโโ db/ # Database schema and configuration
โโโ lib/ # Utility functions and configurations
โโโ hooks/ # Custom React hooks
โโโ contexts/ # React contexts
โโโ types/ # TypeScript type definitions
# Development
pnpm dev # Start development server with Turbopack
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLint
# Database
pnpm drizzle-kit push # Push schema changes to database
pnpm drizzle-kit generate # Generate migration files
pnpm drizzle-kit studio # Open Drizzle Studio- Configuration Form: Users customize post parameters
- AI Processing: Gemini AI generates content based on configuration
- Virality Scoring: Algorithm calculates potential performance
- Preview & Edit: Users can review and modify generated content
- Save to Library: Posts are stored for future reference
Generates a LinkedIn post with virality scoring.
POST /api/auth/sign-in- User loginPOST /api/auth/sign-up- User registrationPOST /api/auth/sign-out- User logout
The application uses a comprehensive component library built with:
- Radix UI: For accessible primitives
- Tailwind CSS: For styling
- Lucide React: For icons
- Framer Motion: For animations
Key UI components include:
- Form controls with validation
- Post configuration sections
- Virality score displays
- Post library management
- Responsive navigation
Implemented using Better Auth with:
- Email/password authentication
- Session management
- Protected routes
- User profile management
- users: User accounts and profiles
- sessions: Authentication sessions
- posts: Generated LinkedIn posts with metadata
- user_feedback: User feedback and bug reports
- usage_tracking: Post generation usage limits
- Connect your repository to Vercel
- Configure environment variables
- Deploy automatically on push to main branch
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and commit:
git commit -m "Add feature" - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and feedback:
- Use the in-app feedback system
- Report issues on GitHub
- Advanced analytics dashboard
- Post scheduling feature
- Multi-platform support (Twitter, Facebook)
- Team collaboration features
- Advanced AI model options
- A/B testing for posts
- Template library
- Export functionality
Built with โค๏ธ using Next.js, TypeScript, and Gemini AI.