AI-Powered Content Optimization for Social Media & Professional Communication
Grammy-AI is an intelligent writing assistant that transforms your rough thoughts into polished, platform-optimized content. Whether you're crafting tweets, LinkedIn posts, emails, or just need grammar corrections, Grammy-AI adapts your message to the perfect tone and style for each platform.
- Twitter/X: Punchy, engaging tweets with character optimization
- LinkedIn: Professional posts with strategic formatting and CTAs
- Instagram: Compelling captions with mobile-friendly structure
- Email: Clear, professional communication with proper structure
- Grammar Check: Clean up errors while preserving your voice
- Casual, Professional, Friendly, and more
- Context-aware refinement based on your additional notes
- Maintains your authentic voice while improving clarity
- Instant AI-powered refinement using Perplexity's Sonar Pro model
- Smart debouncing and caching to optimize performance
- Seamless copy-to-clipboard and direct social media sharing
- NextAuth integration with Google/GitHub login
- Anonymous usage with limited credits
- Chat history tracking for registered users
- PostgreSQL database with Prisma ORM
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, Radix UI, Framer Motion
- AI Integration: Vercel AI SDK, Perplexity API
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js
- Deployment: Vercel-ready with optimized builds
- Node.js 18+ or Bun
- PostgreSQL database
- Perplexity API key
- NextAuth providers (Google/GitHub) [optional]
-
Clone the repository
git clone https://github.com/yourusername/grammy-ai.git cd grammy-ai -
Install dependencies
bun install # or npm install -
Set up environment variables Create a
.env.localfile:DATABASE_URL="postgresql://username:password@localhost:5432/grammyai" PERPLEXITY_API_KEY="your_perplexity_api_key" NEXTAUTH_SECRET="your-secret-key" NEXTAUTH_URL="http://localhost:3000" # Optional: OAuth providers GOOGLE_CLIENT_ID="your_google_client_id" GOOGLE_CLIENT_SECRET="your_google_client_secret" GITHUB_ID="your_github_id" GITHUB_SECRET="your_github_secret"
-
Set up the database
bun run prisma:generate npx prisma migrate deploy
-
Start the development server
bun dev # or npm run dev -
Open your browser Navigate to http://localhost:3000
- Enter your message in the text area
- Select platform (Twitter/X, LinkedIn, Instagram, Email, or Grammar Check)
- Choose tone (Casual, Professional, Friendly, etc.)
- Add context (optional) to provide additional information
- Click submit to get AI-optimized content
- Copy result or share directly to social platforms
Input: "learned nextjs building this project was fun but api rate limits sucked"
Twitter Output: "Just wrapped up building my first Next.js project! The learning curve was totally worth it, but man, those API rate limits really tested my patience. Anyone else been through the same struggle?"
As someone who spends countless hours on social media, I was constantly battling grammar mistakes and tone inconsistencies. The final straw came during a late-night coding session when I posted a tweet with an embarrassing typo that my entire tech community noticed.
- Time-consuming: Manually proofreading hundreds of posts
- Inconsistent quality: Grammar errors slipping through
- Platform confusion: Different tones needed for Twitter vs LinkedIn
- Workflow friction: Switching between tools constantly
Grammy-AI was born during winter break, with 3-4 hours daily dedicated to development. What started as basic regex patterns evolved into a sophisticated AI-powered platform that understands context, tone, and platform-specific requirements.
- Started learning Next.js and used it as the foundation for this project
- Initial prototype used basic regex patterns, quickly realized need for AI integration
- Breakthrough came with platform-specific optimization features for Twitter and LinkedIn
- Dedicated 3-4 hours daily during winter break to development
- API Rate Limiting: Struggled with OpenAI's rate limits during peak usage, solved with request queuing and caching
- Real-time Processing: Optimized debouncing and smart caching to reduce API calls without sacrificing UX
- Context Understanding: Required extensive prompt engineering to distinguish Twitter vs LinkedIn tone
- Cost Management: Balanced feature richness with API costs while maintaining fast response times
- User-Centered Design: Initially focused too much on technical features, learned to prioritize actual user workflow
- API Management: Mastered cost optimization and performance balance
- Feedback Integration: Getting feedback from fellow developers and creators was crucial for interface redesign
- Authentic Problem Solving: Best tools solve problems you personally face daily - authenticity drives better solutions
POST /api/chat- Process and refine messages with AIGET /api/chat- Retrieve user chat history/api/auth/*- NextAuth authentication endpointsGET /api/credits- Check remaining credits for anonymous users
Contributions are welcome! Feel free to:
- Report bugs or request features
- Submit pull requests
- Improve documentation
- Share feedback from your usage
- Share feedback from your usage
This project is open source and available under the MIT License.