Skip to content

Josiasange37/XMAILS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

95 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

XMAILS β€” Email Marketing Platform

A modern, full-stack email marketing application built with Next.js 14, featuring contact management, campaign creation, AI-powered email generation, and advanced analytics.

πŸš€ Features

Contact Management

  • 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

Campaigns & Emails

  • 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

Analytics & Insights

  • Dashboard β€” Real-time metrics with dark/light theme support
  • Delivery Tracking β€” Open rates, click rates, bounce handling
  • Timeline Views β€” Historical performance visualization

Technical Features

  • 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

πŸ›  Tech Stack

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

πŸ“¦ Getting Started

Prerequisites

  • Node.js 18+
  • npm/pnpm/yarn
  • Supabase account (or PostgreSQL)

Installation

# 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

Environment Variables

# 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:3000

Database Setup

Run the schema migration:

# Using Supabase CLI
supabase db reset

# Or manually run scripts/schema.sql in your PostgreSQL instance

Development

npm run dev

Open http://localhost:3000

Build & Deploy

# Production build
npm run build

# Preview production build
npm run start

# Deploy to Vercel
vercel --prod

πŸ“ Project Structure

src/
β”œβ”€β”€ 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

🎨 Design System

Color Palette (CSS Variables)

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

Theme Switching

/* Automatic via prefers-color-scheme */
/* Or manual: document.documentElement.classList.add('dark') */

πŸ”§ API Reference

Contacts

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

AI

Method Endpoint Description
POST /api/ai/email Generate email from prompt

πŸ§ͺ Scripts

npm run dev          # Development server
npm run build        # Production build
npm run start        # Production server
npm run lint         # ESLint
npm run typecheck    # TypeScript check

πŸ“„ License

MIT License β€” feel free to use for personal or commercial projects.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

πŸ“ž Support

For issues, open a GitHub issue or check the documentation.


Built with ❀️ using Next.js, Supabase, and Tailwind CSS.

About

An Email Automation Saas

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors