CRM Lead Management (Kanban Board)
Drag-and-drop kanban board for managing leads through pipeline stages: New, Contacted, Qualified, Proposal, Won. Lead cards show name, email, interest tag, and creation date. Clicking a card opens details with comments and follow-up system.
API: /api/leads, /api/leads/[id]/comments, /api/leads/[id]/followups
Staff Accounts System
Create staff CRM accounts with optional @pulseofmarkets.com email. When email is created, it auto-provisions Dovecot mailbox (SHA512-CRYPT password hashing), adds Postfix virtual mailbox entry, creates Maildir directories, and adds EmailAccount to CRM. Staff can be assigned roles (admin/staff), enabled/disabled, and password-reset. Login credentials can be sent to personal email via /api/admin/send-logins.
API: /api/admin/accounts, /api/admin/send-logins. System: /usr/local/bin/mail-mgmt wrapper script, sudoers entry for www-data.
Email Server (Postfix + Dovecot)
Full mail server on VPS. Postfix handles SMTP with virtual mailbox domains, Dovecot provides IMAP with passwd-file auth. TLS via Let's Encrypt. SASL auth via Dovecot for authenticated SMTP on port 587. Mail stored in Maildir format at /var/mail/vmail/%d/%n (uid/gid 5000). Configuration: /etc/postfix/main.cf, /etc/dovecot/conf.d/*. Mail management: sudo wrapper script at /usr/local/bin/mail-mgmt.
Ports: 25 (SMTP), 587 (submission), 993 (IMAPS), 143 (IMAP). UFW configured for all.
Email Client in CRM
Connect multiple email accounts (Gmail, Outlook, local) to CRM. IMAP sync for receiving, SMTP for sending. Supports local @pulseofmarkets.com accounts (connects to localhost IMAP/SMTP). Compose and send emails directly from CRM. Email caching in SQLite.
API: /api/email-accounts, /api/email-client. Models: EmailAccount, CachedEmail.
Mailing List & Campaigns
Subscriber management with status tracking (active, unsubscribed, bounced). Email campaign builder with HTML content, scheduling, and send test. Campaign stats tracking. Email delivery logs for each recipient.
API: /api/mailing-list, /api/campaigns. Models: Subscriber, EmailCampaign, EmailLog.
AI Posts & Telegram Integration
AI content generation system with customizable templates. Supports multiple post types: signals, analysis, market updates, educational, promotional. Multi-provider AI support (OpenAI, Groq, DeepSeek, Together, Google, custom). Auto-posting to Telegram channels with HTML formatting. Scheduler generates daily posts from active templates and publishes at scheduled times. Safety guard prevents placeholder content from being posted publicly.
API: /api/ai-posts, /api/ai-posts/ai-write, /api/telegram. Models: AIPostTemplate, AIPost, TelegramConfig, ApiKey. Scheduler: /src/lib/scheduler.ts.
Blog System
Blog post editor with rich markdown rendering. Channel selector: Blog Only, Telegram Only, Blog + Telegram. Premium formatting: proper paragraphs, bullet lists, numbered lists, headings, blockquotes, code blocks, highlight boxes, dividers. Blog served at /blog as static page. AI-generated content with detailed formatting rules.
Blog page: /public/blog/index.html. API: /api/blog. AI write: /api/ai-posts/ai-write with formatting-focused system prompt.
EA Robots Affiliate Section
Manage Expert Advisor robots for forex affiliate program. Track performance (monthly return, drawdown), pricing, and display order. Active/inactive toggle.
API: /api/robots. Model: EARobot.
CMS Website Editor
Edit website content sections directly from admin panel. Manage hero section, copy trading, signals, EA robots, market analysis, lead form, header, footer content. Field-level editing with type support (text, richtext, html, json).
API: /api/website-content. Model: WebsiteContent.
Notes (Google Keep Style)
Sticky notes with 6 colors (yellow, blue, green, pink, purple, gray). Categories: general, ideas, tasks, reference. Masonry grid layout. Inline editing, search, and category filtering. Each note has title, content, color picker, and category selector.
API: /api/notes. Model: Note.
To-Do Tasks
Task management with priorities (low, medium, high, urgent) and status tracking (pending, in_progress, completed). Assign tasks to CRM staff accounts. Due date tracking with overdue highlighting. Filter by status and assignee.
API: /api/todos. Model: Todo.
Kanban Task Board
Trello-like drag-and-drop board for staff tasking. Default columns: To Do, In Progress, Review, Done. Add custom columns. Cards with title, description, priority indicator, assignee, due date. Drag cards between columns to update status. Reuses drag-and-drop pattern from leads kanban.
API: /api/kanban, /api/kanban/cards. Models: TaskColumn, TaskCard.
In-App Notifications
Bell icon in CRM header polls every 30 seconds. Notification types: info, success, warning, error. Unread badge counter. Mark all as read, dismiss individual notifications. Generated by scheduler on post creation/publishing.
API: /api/notifications. Model: Notification.
Custom Lead Creation
Manually add leads/prospects directly in CRM with name, email, phone, telegram, broker, interest, investment range, source, and notes. Bypasses the landing page form.
API: POST /api/leads. UI: "+ Add Lead" button in leads section.