Resonex is an AI-powered newsletter automation platform built for the Convex + Resend Hackathon. It enables users to generate newsletter content from prompts using LLMs, automatically create and schedule A/B tested campaigns, send newsletters via Resend, and track campaign performance with real-time analytics.
- AI-Powered Content Generation: Generate newsletter content from natural language prompts using OpenAI
- A/B Testing: Automatically create and test two subject line variants for optimal performance
- Smart Scheduling: Get recommendations for optimal send times based on historical engagement data
- Real-Time Analytics: Track opens, clicks, bounces, and other engagement metrics via webhooks
- Campaign Management: Create, edit, schedule, and monitor newsletter campaigns
- Recipient Management: Import recipient lists via CSV upload
- Performance Insights: View detailed analytics and A/B test results
- Next.js 15 - React framework with app router
- TypeScript - Type safety and better developer experience
- TailwindCSS - Utility-first CSS framework
- React Calendar - Calendar component for scheduling
- Convex - Real-time backend with database, server functions, and scheduling
- OpenAI API - AI content generation
- Resend - Email delivery service
- Webhooks - Real-time event tracking
- Node.js 18+
- npm or yarn
- OpenAI API key
- Resend API key
- Clone the repository:
git clone <your-repo-url>
cd resonex- Install dependencies:
npm install- Set up environment variables:
Create a
.env.localfile in the root directory:
CONVEX_DEPLOYMENT=<your-convex-deployment>
NEXT_PUBLIC_CONVEX_URL=<your-convex-url>
OPENAI_API_KEY=<your-openai-api-key>
RESEND_API_KEY=<your-resend-api-key>- Set up Convex:
npx convex dev- Start the development server:
npm run dev- Open http://localhost:3000 in your browser.
- Click "Create Campaign" from the dashboard
- Enter a prompt describing your newsletter content (e.g., "Weekly fintech digest covering latest trends")
- Select a category for better recommendations
- Review and edit the AI-generated content and subject lines
- Upload recipient list via CSV
- Schedule the A/B test send times
- Launch your campaign!
- View real-time analytics on the dashboard
- Track A/B test performance and winner selection
- Monitor engagement metrics (opens, clicks, bounces)
- Get recommendations for optimal send times
Configure your Resend webhook endpoint to point to:
https://your-convex-deployment.convex.cloud/webhooks/resend
This enables real-time tracking of email events.
- Campaign metadata, content, subject lines, recipients
- Send scheduling and status tracking
- A/B test configuration
- Email delivery, open, click, and bounce tracking
- Campaign and variant association
- Real-time webhook processing
- Time-based engagement scoring
- User and category-specific optimization
- Historical performance analysis
api.campaigns.getCampaigns- Get user's campaignsapi.campaigns.getCampaignAnalytics- Get campaign performance dataapi.events.getUserAnalytics- Get overall user analyticsapi.recommendations.getRecommendations- Get optimal send time recommendations
api.campaigns.createCampaign- Create new campaignapi.campaigns.updateCampaign- Update campaign detailsapi.campaigns.scheduleCampaign- Schedule campaign for sending
api.campaigns.generateNewsletterContent- Generate AI contentapi.emails.sendTestEmail- Send test emailapi.emails.importRecipients- Import recipient CSV
POST /webhooks/resend- Resend webhook handler
resonex/
├── app/ # Next.js app directory
│ ├── create-campaign/ # Campaign creation page
│ ├── page.tsx # Dashboard
│ └── layout.tsx # Root layout
├── components/ # React components
│ ├── icons/ # Icon components
│ ├── CampaignCard.tsx # Campaign display
│ ├── MetricDashboard.tsx # Analytics dashboard
│ └── ...
├── convex/ # Convex backend functions
│ ├── campaigns.ts # Campaign management
│ ├── emails.ts # Email sending
│ ├── events.ts # Event tracking
│ ├── recommendations.ts # Send time optimization
│ ├── webhooks.ts # Webhook handlers
│ ├── schema.ts # Database schema
│ ├── crons.ts # Scheduled jobs
│ └── http.ts # HTTP router
└── public/ # Static assets
- Backend Functions: Add new functions in the
convex/directory - Frontend Components: Create components in the
components/directory - Database Schema: Update schema in
convex/schema.ts - Scheduling: Add cron jobs in
convex/crons.ts
Deploy your Convex backend:
npx convex deployDeploy to Vercel or your preferred platform:
npm run build- 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.
- Built for the Convex + Resend Hackathon
- Powered by OpenAI for content generation
- Uses Convex for real-time backend functionality
- Email delivery by Resend
For support, email support@resonex.com or open an issue on GitHub.