A production-ready Markdown to PDF converter web application built with Next.js 14, TypeScript, and Tailwind CSS. Features a freemium model with user authentication, team management, and enterprise SSO support.
- Live Preview - See changes in real-time as you type
- 8 Document Themes - GitHub, Academic, Minimal, Dark, Professional, Elegant, Modern, Newsletter
- Syntax Highlighting - Support for 20+ programming languages
- Math Equations - LaTeX/KaTeX support
- Mermaid Diagrams - Flowcharts, sequence diagrams, and more
- Batch Conversion - Convert multiple files at once
- 15+ Document Templates - Resume, Thesis, README, Meeting Notes, and more
- Bilingual Support - English and Arabic with full RTL support
- Responsive Design - Works on mobile, tablet, and desktop
- Accessible - WCAG 2.1 AA compliant with keyboard navigation
- Docker Support - Easy deployment with Docker
- REST API - Programmatic access to conversion features
- User Authentication - GitHub, Google, and email login
- API Key Authentication - Programmatic access with rate limiting
- Cloud Storage - Save and manage documents in the cloud
- Custom CSS - Style your documents with custom CSS
- Team Management - Collaborate with team members
- Usage Analytics - Track conversion metrics with charts
- Priority Rendering - Faster PDF generation with browser pooling
- No Watermark - Remove watermark from PDFs
- SSO Integration - SAML, OIDC, Azure AD, Okta, Google Workspace
- Custom Domains - Use your own domain
- SLA Guarantee - 99.9% uptime
- Priority Support - Dedicated support channel
- Self-Hosting - Deploy on your own infrastructure
docker pull mwmsoftware/markdown-to-pdf:latest
docker run -p 3000:3000 mwmsoftware/markdown-to-pdfgit clone https://github.com/mahmoodhamdi/Markdown-to-PDF.git
cd Markdown-to-PDF
npm install
npm run devOpen http://localhost:3000 in your browser.
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Editor: Monaco Editor
- Markdown: marked + highlight.js
- PDF Generation: Puppeteer
- Math: KaTeX
- Diagrams: Mermaid
- State Management: Zustand
- Internationalization: next-intl
- Testing: Vitest + Playwright (1500+ tests)
- UI Components: Radix UI
- Authentication: NextAuth.js
- Database: MongoDB (Mongoose)
- Storage: Firebase Storage
- Payments: Multi-gateway (Stripe, Paymob, PayTabs, Paddle)
API endpoints support two authentication methods:
Session-based (Web App)
- Automatic via cookies for logged-in users
API Key (Programmatic)
curl -X POST https://your-domain.com/api/convert \
-H "Authorization: Bearer mk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"markdown": "# Hello"}'POST /api/convert
Content-Type: application/json
{
"markdown": "# Hello World",
"theme": "github",
"pageSize": "A4",
"orientation": "portrait"
}POST /api/preview
Content-Type: application/json
{
"markdown": "# Hello World"
}POST /api/convert/batch
Content-Type: application/json
{
"files": [
{ "name": "doc1.md", "content": "# Document 1" },
{ "name": "doc2.md", "content": "# Document 2" }
],
"theme": "github"
}GET /api/themesGET /api/templatesGET /api/healthPOST /api/checkout
Content-Type: application/json
{
"plan": "pro",
"billing": "monthly",
"gateway": "stripe", // Optional: stripe, paymob, paytabs, paddle
"countryCode": "US" // Optional: auto-selects gateway
}# Upload file
POST /api/storage/upload
# List files
GET /api/storage/files
# Get storage quota
GET /api/storage/quota# Create team
POST /api/teams
# Get team
GET /api/teams/[teamId]
# Manage members
POST /api/teams/[teamId]/members# Track event
POST /api/analytics/track
# Get summary
GET /api/analytics/summary
# Get history
GET /api/analytics/history# List API keys
GET /api/api-keys
# Create API key
POST /api/api-keys
{
"name": "Production Key",
"permissions": ["convert", "preview", "batch"]
}
# Revoke API key
DELETE /api/api-keys/[keyId]# Run unit tests
npm run test
# Run unit tests in watch mode
npm run test:watch
# Run integration tests
npm run test:integration
# Run E2E tests
npm run test:e2e# Build the Docker image
docker build -f docker/Dockerfile -t markdown-to-pdf .
# Run the container
docker run -p 3000:3000 markdown-to-pdf# Development
docker-compose -f docker/docker-compose.yml up
# Production
docker-compose -f docker/docker-compose.prod.yml upsrc/
├── app/ # Next.js App Router
│ ├── [locale]/ # Internationalized routes
│ │ ├── page.tsx # Main editor page
│ │ ├── themes/ # Theme selection
│ │ ├── templates/ # Document templates
│ │ ├── batch/ # Batch conversion
│ │ └── api-docs/ # API documentation
│ └── api/ # API routes
│ ├── convert/ # PDF conversion
│ ├── checkout/ # Payment checkout
│ ├── webhooks/ # Payment webhooks (Stripe, Paymob, PayTabs, Paddle)
│ ├── storage/ # Cloud storage
│ ├── teams/ # Team management
│ ├── analytics/ # Usage analytics
│ └── sso/ # Enterprise SSO
├── components/ # React components
│ ├── editor/ # Editor components
│ ├── preview/ # Preview components
│ ├── converter/ # Conversion components
│ ├── layout/ # Layout components
│ └── ui/ # UI primitives
├── lib/ # Core libraries
│ ├── markdown/ # Markdown parser
│ ├── pdf/ # PDF generator
│ ├── themes/ # Theme manager
│ ├── payments/ # Multi-gateway payments
│ ├── storage/ # Cloud storage service
│ ├── teams/ # Team management service
│ ├── analytics/ # Analytics service
│ ├── sso/ # SSO service
│ ├── db/ # MongoDB models & connection
│ └── plans/ # Pricing & rate limiting
├── stores/ # Zustand stores
├── messages/ # i18n translations
└── types/ # TypeScript types
See CREDENTIALS.md for detailed setup instructions.
| Variable | Description | Required |
|---|---|---|
NEXTAUTH_URL |
Application URL | Yes |
NEXTAUTH_SECRET |
Session encryption key (32+ chars) | Yes |
MONGODB_URI |
MongoDB connection string | Yes |
FIREBASE_* |
Firebase Storage configuration | Yes |
GITHUB_ID/SECRET |
GitHub OAuth | Optional |
GOOGLE_CLIENT_ID/SECRET |
Google OAuth | Optional |
STRIPE_SECRET_KEY |
Stripe payments (Global) | Optional |
PAYMOB_SECRET_KEY |
Paymob payments (Egypt) | Optional |
PAYTABS_SERVER_KEY |
PayTabs payments (MENA) | Optional |
PADDLE_API_KEY |
Paddle payments (MoR) | Optional |
EMAIL_SERVER_* |
SMTP configuration | Optional |
| Feature | Free | Pro ($5/mo) | Team ($15/mo) | Enterprise |
|---|---|---|---|---|
| Conversions/day | 20 | 500 | Unlimited | Unlimited |
| File size | 500KB | 5MB | 20MB | 100MB |
| Themes | 3 | All | All + Brand | Custom |
| Cloud Storage | - | 1GB | 10GB | Unlimited |
| Team Members | - | - | 5 | Unlimited |
| SSO | - | - | - | Yes |
- Deployment Guide - Production deployment options
- Troubleshooting - Common issues and solutions
- Self-Hosting - Deploy on your own infrastructure
- Contributing - How to contribute
- Changelog - Version history
- Fork the repository
- Create your 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
MIT License - see LICENSE for details.
Made with love by mahmoodhamdi






