A powerful, self-hosted email automation platform that makes sending transactional emails, marketing campaigns, and automated workflows simple and reliable.
- π Transactional Emails: Send emails programmatically via REST API
- π Email Campaigns: Create and send marketing campaigns to your contacts
- β‘ Automation: Set up triggered email workflows based on user events
- π Analytics: Track email opens, clicks, bounces, and delivery rates
- π§ Templates: Create reusable email templates with dynamic content
- π₯ Contact Management: Manage subscriber lists and contact metadata
- π·οΈ Event Tracking: Track user events and trigger automated responses
- π Domain Verification: Verify your domains for better deliverability
- π Team Management: Collaborate with team members on projects
- π± Dashboard: Intuitive web interface for managing everything
- Node.js with TypeScript
- Express.js with @overnightjs/core for API routing
- Prisma ORM with PostgreSQL database
- Redis for caching and session management
- AWS SES for email delivery
- Zod for schema validation
- MJML for responsive email templates
- React with TypeScript
- Next.js framework
- Tailwind CSS for styling
- Modern component architecture
- Docker support for easy deployment
- Yarn Workspaces for monorepo management
- Prisma Migrations for database schema management
- Node.js 18+
- Yarn 4.3.x
- PostgreSQL database
- Redis server
- AWS SES credentials
-
Clone the repository
git clone https://github.com/PHPxCODER/sendincraft.git cd sendincraft
-
Install dependencies
yarn install
-
Set up environment variables
API Environment (.env)
# Database DATABASE_URL=postgresql://username:password@localhost:5432/sendincraft # Redis REDIS_URL=redis://localhost:6379 # JWT Secret JWT_SECRET=your-super-secret-jwt-key # AWS SES Configuration AWS_REGION=us-east-1 AWS_ACCESS_KEY_ID=your-aws-access-key AWS_SECRET_ACCESS_KEY=your-aws-secret-key AWS_SES_CONFIGURATION_SET=your-ses-configuration-set # App URLs API_URI=http://localhost:4000 APP_URI=http://localhost:3000 # Optional: Disable signups DISABLE_SIGNUPS=false
-
Set up the database
yarn generate yarn migrate
-
Start development servers
# Start all services (PostgreSQL, Redis) yarn services:up # Start API server yarn dev:api # Start dashboard (in another terminal) yarn dev:dashboard
-
Access the application
- Dashboard: http://localhost:3000
- API: http://localhost:4000
sendincraft/
βββ packages/
β βββ api/ # Backend API server
β β βββ src/
β β β βββ controllers/ # API route controllers
β β β βββ services/ # Business logic
β β β βββ middleware/ # Express middleware
β β β βββ util/ # Utility functions
β β β βββ database/ # Database configuration
β β βββ package.json
β βββ dashboard/ # Frontend React app
β β βββ src/
β β β βββ components/ # React components
β β β βββ pages/ # Next.js pages
β β β βββ hooks/ # Custom React hooks
β β β βββ utils/ # Frontend utilities
β β βββ package.json
β βββ shared/ # Shared schemas and types
β βββ src/
β β βββ index.ts # Zod schemas
β βββ package.json
βββ prisma/
β βββ schema.prisma # Database schema
β βββ migrations/ # Database migrations
βββ docker-compose.dev.yml # Development services
βββ package.json # Root package.json
SendinCraft uses custom MAIL FROM domains for better email deliverability:
- Default Configuration: Emails are sent from
sendincraft.yourdomain.com
- Custom Subdomain: You can specify custom subdomains like
bounces.yourdomain.com
- DNS Records: The platform provides the required DNS records for setup
- Create an AWS SES configuration set
- Set up SNS notifications for bounces, complaints, and delivery tracking
- Configure the webhook endpoint:
https://yourapi.com/webhooks/incoming/sns
All API endpoints require authentication via API keys:
- Secret Key:
sk_...
for server-side operations - Public Key:
pk_...
for client-side tracking
POST /v1/send
Authorization: Bearer sk_your_secret_key
{
"to": ["[email protected]"],
"subject": "Welcome!",
"body": "<h1>Welcome to our platform!</h1>",
"from": "[email protected]"
}
POST /v1/track
Authorization: Bearer pk_your_public_key
{
"email": "[email protected]",
"event": "user-signup",
"data": {
"plan": "premium"
}
}
POST /v1/contacts
Authorization: Bearer sk_your_secret_key
{
"email": "[email protected]",
"subscribed": true,
"data": {
"firstName": "John",
"lastName": "Doe"
}
}
-
Build the containers
docker-compose up -d
-
Run migrations
docker-compose exec api yarn migrate:deploy
Ensure all environment variables are properly configured for production:
- Use strong JWT secrets
- Configure proper database connections
- Set up AWS SES with appropriate permissions
- Configure Redis for production use
- 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
yarn dev:api
- Start API development serveryarn dev:dashboard
- Start dashboard development serveryarn dev:shared
- Watch shared package for changes
yarn build:api
- Build API for productionyarn build:dashboard
- Build dashboard for productionyarn build:shared
- Build shared package
yarn migrate
- Run database migrationsyarn migrate:deploy
- Deploy migrations to productionyarn generate
- Generate Prisma client
yarn services:up
- Start development services (PostgreSQL, Redis)yarn services:down
- Stop development services
yarn clean
- Clean all dependencies and reinstall
- All API endpoints are protected with proper authentication
- JWT tokens for session management
- Input validation using Zod schemas
- SQL injection protection via Prisma ORM
- Rate limiting and request validation
The platform includes built-in analytics for:
- Email delivery rates
- Open and click tracking
- Bounce and complaint monitoring
- Contact growth metrics
- Campaign performance
-
Database Connection Issues
- Verify PostgreSQL is running
- Check DATABASE_URL format
- Ensure database exists
-
Redis Connection Issues
- Verify Redis server is running
- Check REDIS_URL configuration
-
AWS SES Issues
- Verify AWS credentials
- Check SES service limits
- Ensure domain verification is complete
-
Email Delivery Issues
- Check DNS records are properly configured
- Verify domain verification status
- Review AWS SES reputation
This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.
- Built with modern web technologies
- Inspired by the need for self-hosted email automation
- Community-driven development
Ready to send amazing emails? π
Start by setting up your first project and verifying your domain!