A modern, full-featured email broadcast management system built with Next.js, tRPC, and Resend. Manage subscribers, create broadcasts, and send beautiful emails with ease.
- 📧 Email Broadcasting: Create and send beautiful email broadcasts to your subscribers
- 👥 Subscriber Management: Add, import, and manage your subscriber list with ease
- 🎨 Rich Text Editor: Compose emails with a powerful WYSIWYG editor
- 📱 Responsive Design: Fully responsive interface that works on all devices
- 🔒 Type-Safe: End-to-end type safety with TypeScript and tRPC
- 📤 Bulk Import: Import subscribers via CSV or manual entry
- 📧 Email Preview: Preview your broadcasts before sending
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe JavaScript
- tRPC - End-to-end typesafe APIs
- Drizzle ORM - TypeScript ORM for SQL databases
- PostgreSQL - Relational database
- Resend - Modern email API for developers
- React Email - Build and send emails using React components
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Re-usable component library
- React Hook Form - Performant form validation
Before you begin, ensure you have the following installed:
- Node.js 18.x or higher
- pnpm (recommended) or npm/yarn
- PostgreSQL database
- Resend Account (free tier available)
git clone https://github.com/azacdev/luminix-broadcast.git
cd luminix-broadcastpnpm install
# or
npm install
# or
yarn installThis project uses Neon - a serverless PostgreSQL database.
- Go to Neon.tech and sign up for a free account
- Click Create a project
- Give your project a name (e.g., "Luminix Broadcast")
- Select a region closest to your users
- Click Create project
- Copy the connection string from the Connection Details section
- Add it to your
.envfile asDATABASE_URL
Create a .env file in the root directory by copying the example:
cp .env.example .envUpdate the .env file with your configuration:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/luminix_broadcast"
# App Configuration
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Resend Email Service
RESEND_API_KEY=re_123456789abcdefghijklmnop
RESEND_AUDIENCE_ID=abc12345-6789-defg-hijk-lmnopqrstuv
NEXT_PUBLIC_RESEND_DOMAIN_EMAIL=[email protected]- Go to Resend.com and sign up for a free account
- Verify your email address
- Navigate to Domains in your Resend dashboard
- Click Add Domain
- Enter your domain name (e.g.,
yourdomain.com) - Add the provided DNS records to your domain registrar:
- MX Record (for receiving bounces)
- TXT Record (for SPF verification)
- CNAME Records (for DKIM authentication)
- Wait for DNS propagation (usually 5-15 minutes, can take up to 48 hours)
- Click Verify in Resend dashboard
Note: If you don't have a custom domain, you can use Resend's test domain for development, but emails will only be sent to your verified email address.
- Go to API Keys in your Resend dashboard
- Click Create API Key
- Give it a name (e.g., "Luminix broadcast")
- Select the appropriate permissions (Full Access for development)
- Copy the API key and add it to your
.envfile asRESEND_API_KEY
- Go to Audiences in your Resend dashboard
- Click on API Reference to view your existing audience ID
- Or click Create Audience to create a new one:
- Give it a name (e.g., "broadcast Subscribers")
- Configure your audience settings
- Copy the Audience ID and add it to your
.envfile asRESEND_AUDIENCE_ID
Note: Using Audiences helps you manage bounces, complaints, and unsubscribes automatically.
In your .env file, set NEXT_PUBLIC_RESEND_DOMAIN_EMAIL to an email address using your verified domain:
NEXT_PUBLIC_RESEND_DOMAIN_EMAIL=[email protected]pnpm db:push
# or
npm run db:pushpnpm dev
# or
npm run devOpen http://localhost:3000 in your browser to see the application.
luminix-broadcast/
├── app/
│ ├── (dashboard)/ # Dashboard routes with shared layout
│ │ ├── broadcasts/ # Broadcast management pages
│ │ ├── subscribers/ # Subscriber management pages
│ │ └── layout.tsx # Dashboard layout with sidebar
│ ├── api/ # API routes
│ │ └── trpc/ # tRPC endpoint
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Landing page
├── components/
│ ├── sidebar/ # Sidebar navigation components
│ └── ui/ # shadcn/ui components
├── db/
│ ├── drizzle.ts # Database connection
│ └── schema.ts # Database schema
├── emails/
│ └── broadcast-email.tsx # Email templates
├── modules/
│ ├── broadcast/ # Broadcast feature module
│ │ ├── server/ # Server-side procedures
│ │ └── ui/ # Client components
│ └── subscribers/ # Subscribers feature module
│ ├── server/ # Server-side procedures
│ └── ui/ # Client components
├── trpc/
│ ├── routers/ # tRPC router definitions
│ ├── client.tsx # tRPC client setup
│ └── init.ts # tRPC initialization
├── .env # Environment variables (not in git)
├── .env.example # Environment variables template
└── package.json # Project dependencies
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm db:push- Push database schema changespnpm db:studio- Open Drizzle Studio (database GUI)
- Create and schedule email broadcasts
- Rich text editor with formatting options
- Preview emails before sending
- Send to all subscribers or specific segments
- Add subscribers manually
- Bulk import via CSV
- View subscriber details and activity
- Remove subscribers
- Professional, responsive email templates
- Customizable branding
The easiest way to deploy this application:
- Push your code to GitHub
- Import your repository in Vercel
- Add your environment variables in Vercel's project settings
- Deploy!
Make sure to set these in your Vercel project settings:
DATABASE_URL- Your production PostgreSQL database URLNEXT_PUBLIC_APP_URL- Your production domain (e.g., https://yourdomain.com)RESEND_API_KEY- Your Resend API keyRESEND_AUDIENCE_ID- Your Resend Audience IDNEXT_PUBLIC_RESEND_DOMAIN_EMAIL- Your verified sender email
- Verify your domain is properly configured in Resend
- Check that your API key has the correct permissions
- Ensure
NEXT_PUBLIC_RESEND_DOMAIN_EMAILuses your verified domain - Check Resend dashboard for any error logs
- Verify your
DATABASE_URLis correct - Ensure PostgreSQL is running
- Check that database migrations have been applied
- Run
pnpm installto ensure all dependencies are installed - Restart your TypeScript server in your IDE
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
If you have any questions or run into issues, please:
- Check the Issues page
- Create a new issue if your problem isn't already listed
- Contact support at [email protected]
- Next.js for the amazing framework
- Resend for the reliable email API
- shadcn/ui for the beautiful components
- tRPC for type-safe APIs