A modern, full-stack email marketing application built with Next.js 14, featuring contact management, campaign creation, AI-powered email generation, and advanced analytics.
- Smart Import β CSV/Excel import with French/English header detection (
Adresse e-mail,Nom complet, etc.) - Category System β Built-in categories: Follower, Sponsor, Partner, Friend, Enterprise
- Bulk Operations β Bulk add, deduplicate, fix uncategorized contacts
- Real-time Validation β Email existence checking with instant feedback
- Duplicate Prevention β Automatic deduplication keeping oldest records
- Compose Editor β Rich text editor with AI-assisted writing
- AI Email Generation β Generate personalized emails with context (recipient details, attachments, brand voice)
- Broadcasts β Send to segments with scheduling support
- Promotions β Dedicated promotional campaign workflow
- Templates β Reusable email templates
- Inbox/Sent/Scheduled β Full email lifecycle management
- Dashboard β Real-time metrics with dark/light theme support
- Delivery Tracking β Open rates, click rates, bounce handling
- Timeline Views β Historical performance visualization
- Dark/Light Theme β Warm charcoal dark mode (no blue), violet primary, 3-tier elevation system
- Responsive Design β Mobile-first with Tailwind CSS
- TypeScript β Full type safety
- Supabase/PostgreSQL β Scalable database backend
- Vercel Ready β Optimized for edge deployment
| Layer | Technology |
|---|---|
| Framework | Next.js 14 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS + CSS Variables |
| Database | Supabase (PostgreSQL) |
| AI | OpenAI-compatible API |
| Charts | Recharts |
| Forms | React Hook Form + Zod |
| UI Components | Radix UI primitives |
| Deployment | Vercel |
- Node.js 18+
- npm/pnpm/yarn
- Supabase account (or PostgreSQL)
# Clone the repository
git clone https://github.com/Josiasange37/XMAILS.git
cd XMAILS
# Install dependencies
npm install
# Copy environment template
cp .env.example .env.local# Database (Supabase)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# AI (OpenAI-compatible)
AI_API_KEY=your_api_key
AI_BASE_URL=https://api.openai.com/v1 # or custom endpoint
AI_MODEL=gpt-4o-mini
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000Run the schema migration:
# Using Supabase CLI
supabase db reset
# Or manually run scripts/schema.sql in your PostgreSQL instancenpm run dev# Production build
npm run build
# Preview production build
npm run start
# Deploy to Vercel
vercel --prodsrc/
βββ app/
β βββ api/ # API routes
β β βββ ai/ # AI email generation
β β βββ contacts/ # Contact CRUD + utilities
β β β βββ deduplicate/ # Remove duplicates
β β β βββ fix-uncategorized/ # Auto-tag uncategorized
β β β βββ set-category/ # Bulk category assignment
β β β βββ exists/ # Email existence check
β β βββ emails/ # Email operations
β β βββ analytics/ # Metrics endpoints
β βββ dashboard/ # Dashboard pages
β β βββ contacts/ # Contact management UI
β β βββ emails/ # Compose, inbox, sent, scheduled
β β βββ broadcasts/ # Campaign builder
β β βββ analytics/ # Reports
β βββ globals.css # Design system (CSS variables)
β βββ layout.tsx
βββ components/
β βββ ui/ # Reusable UI primitives
β βββ contact-select.tsx # Contact picker with search
β βββ page-transition.tsx # Route transitions
β βββ sidebar.tsx # Navigation
βββ lib/
β βββ ai.ts # AI client wrapper
β βββ email-brand.ts # Brand settings
β βββ utils.ts # Helpers
βββ db.ts # Supabase client
βββ types/
βββ contact.ts # TypeScript types
Light Theme (default):
- Background:
#ffffff - Primary:
#7c3aed(violet) - Muted:
#f4f4f5
Dark Theme (warm charcoal, no blue):
--background: #0a0a10(base)--elevated: #12121b(cards)--overlay: #1a1a25(modals)--primary: #7c3aed(violet)--border: #2a2a3a
/* Automatic via prefers-color-scheme */
/* Or manual: document.documentElement.classList.add('dark') */| Method | Endpoint | Description |
|---|---|---|
| GET | /api/contacts |
List contacts (paginated, filterable) |
| POST | /api/contacts |
Create contact |
| PATCH | /api/contacts/[id] |
Update contact |
| DELETE | /api/contacts/[id] |
Delete contact |
| POST | /api/contacts/exists |
Check email existence |
| DELETE | /api/contacts/deduplicate |
Remove duplicates |
| POST | /api/contacts/fix-uncategorized |
Tag uncategorized as follower |
| POST | /api/contacts/set-category |
Bulk category assignment |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/ai/email |
Generate email from prompt |
npm run dev # Development server
npm run build # Production build
npm run start # Production server
npm run lint # ESLint
npm run typecheck # TypeScript checkMIT License β feel free to use for personal or commercial projects.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
For issues, open a GitHub issue or check the documentation.
Built with β€οΈ using Next.js, Supabase, and Tailwind CSS.