{"slug": "how-i-built-nexbrief-an-automated-daily-it-newsletter-platform-for-engineering", "title": "How I Built NexBrief: An Automated Daily IT Newsletter Platform for Engineering Students", "summary": "A B.Tech student has built NexBrief, India's first dedicated daily newsletter platform for engineering students and IT professionals, which delivers curated IT and AI news to subscribers' inboxes every morning at 7:00 AM IST. The platform uses a custom pooling algorithm that pulls from multiple NewsAPI streams to maintain a 60-40 split between India-centric and global content, with automatic fallback to cached articles when live feeds are short. NexBrief also bypasses common SMTP port restrictions by communicating with Brevo's transactional HTTPS REST API over Port 443 to ensure reliable email delivery.", "body_md": "As a B.Tech student, keeping up with the rapid developments in the IT and AI sectors is critical for career development, placements, and interviews. However, searching through countless tech blogs, college portals, and world news sites every single day is time-consuming and exhausting.\n\nTo solve this problem, I built **NexBrief**—India's first dedicated daily newsletter and intelligence platform tailored specifically for engineering students and IT professionals.\n\nEvery morning at **7:00 AM IST**, registered subscribers receive a curated, highly structured newsletter direct to their inbox. Readers can get fully caught up in just **2 to 5 minutes**.\n\nIn this article, I’ll share the architecture under the hood, key engineering challenges I solved, and code snippets from the system.\n\nNexBrief operates on a strict, target-driven content ratio to deliver maximum value in minimum time:\n\nA major product requirement was to balance news localization: exactly **60% of the content must be India-centric**, while **40% focuses on Global updates**.\n\nTo implement this, I built a custom pooling algorithm that pulls from multiple NewsAPI streams, categorizes them, separates them into India vs. World pools, and applies dynamic sizing. If the live feed has a shortage of articles, it gracefully backfills the remainder from cached fallbacks, ensuring the newsletter layout is always balanced.\n\nHere is the core news mixing algorithm (`newsService.js`\n\n):\n\n``` js\nconst mixIndiaAndWorld = (liveArticles, min, max, categorizeFn, fallbackFn) => {\n  const cleanArticles = (liveArticles || []).filter(a => \n    a.title && a.title !== '[Removed]' && a.description && a.url\n  );\n\n  const seenTitles = new Set();\n  const uniqueLive = [];\n\n  for (const a of cleanArticles) {\n    const titleNorm = a.title.toLowerCase().trim();\n    if (seenTitles.has(titleNorm)) continue;\n    seenTitles.add(titleNorm);\n\n    const cat = categorizeFn(a.title + ' ' + (a.description || ''));\n    uniqueLive.push({\n      title: a.title,\n      description: a.description || 'Click to read full article.',\n      url: a.url,\n      urlToImage: a.urlToImage || getCategoryStockImage(cat),\n      source: a.source?.name || 'News Source',\n      publishedAt: a.publishedAt || new Date().toISOString(),\n      category: cat,\n      isIndia: isIndiaRelated(a.title, a.description, a.source?.name)\n    });\n  }\n\n  const liveIndia = uniqueLive.filter(a => a.isIndia);\n  const liveWorld = uniqueLive.filter(a => !a.isIndia);\n\n  // Determine dynamic count C based on news availability\n  let C = Math.min(Math.max(uniqueLive.length, min), max);\n\n  const targetIndiaCount = Math.round(C * 0.6);\n  const targetWorldCount = C - targetIndiaCount;\n\n  // Fetch fallbacks if live news is short\n  const allFallbacks = fallbackFn(50);\n  const fallbackIndia = allFallbacks.filter(f => f.isIndia);\n  const fallbackWorld = allFallbacks.filter(f => !f.isIndia);\n\n  const finalIndia = fillPool(liveIndia, fallbackIndia, targetIndiaCount, seenTitles);\n  const finalWorld = fillPool(liveWorld, fallbackWorld, targetWorldCount, seenTitles);\n\n  const combined = [...finalIndia, ...finalWorld];\n\n  // Sort India-related to the top\n  return combined.sort((a, b) => (a.isIndia && !b.isIndia ? -1 : 1));\n};\n```\n\nA common problem in aggregators is missing images from news feeds, leaving ugly gray boxes on dashboards or emails.\n\nNexBrief solves this by binding high-resolution, topic-relevant Unsplash images dynamically based on article subtopics (e.g. AI, Science, Cybersecurity, Software, Cloud). If the publisher provides no image, the system automatically injects a beautiful themed placeholder.\n\nMany popular cloud hosting providers (like Render) block standard SMTP outbound ports (25, 465, 587) by default. This prevents node-mailer from connecting to SMTP servers.\n\nTo bypass this restriction, I designed the system to communicate directly with Brevo using its **Transactional HTTPS REST API** over Port 443 instead of traditional SMTP. This guarantees 100% email delivery.\n\nHere is the sender service integration (`emailService.js`\n\n):\n\n``` js\nconst fetch = require('node-fetch');\n\nconst sendEmailViaAPI = async ({ toEmail, toName, subject, htmlContent }) => {\n  const BREVO_API_URL = 'https://api.brevo.com/v3/smtp/email';\n\n  try {\n    const response = await fetch(BREVO_API_URL, {\n      method: 'POST',\n      headers: {\n        'accept': 'application/json',\n        'api-key': process.env.BREVO_API_KEY,\n        'content-type': 'application/json',\n      },\n      body: JSON.stringify({\n        sender: {\n          name: process.env.FROM_NAME || 'NexBrief Daily',\n          email: process.env.FROM_EMAIL,\n        },\n        to: [{ email: toEmail, name: toName }],\n        subject: subject,\n        htmlContent: htmlContent,\n      }),\n    });\n\n    const data = await response.json();\n    if (!response.ok) {\n      throw new Error(data.message || 'Brevo API Send Failure');\n    }\n    return data;\n  } catch (error) {\n    console.error(`❌ Send Failure to ${toEmail}:`, error.message);\n    throw error;\n  }\n};\n```\n\nAdmins have access to a secure, password-guarded control panel built with glassmorphism aesthetics. The panel allows:\n\nTo ensure rapid search engine discoverability on subdomains, NexBrief is shipped with verified sitemaps and crawling permissions (`robots.txt`\n\nand `sitemap.xml`\n\n) which are submitted and successfully tracked by **Google Search Console**.\n\nIf you'd like to support the project, please leave a ⭐ on the GitHub repository and sign up to receive your first brief tomorrow morning! I'd love to hear your feedback in the comments.", "url": "https://wpnews.pro/news/how-i-built-nexbrief-an-automated-daily-it-newsletter-platform-for-engineering", "canonical_source": "https://dev.to/mdrounaqali/how-i-built-nexbrief-an-automated-daily-it-newsletter-platform-for-engineering-students-3b57", "published_at": "2026-06-11 16:54:47+00:00", "updated_at": "2026-06-11 17:13:55.990695+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "ai-infrastructure"], "entities": ["NexBrief"], "alternates": {"html": "https://wpnews.pro/news/how-i-built-nexbrief-an-automated-daily-it-newsletter-platform-for-engineering", "markdown": "https://wpnews.pro/news/how-i-built-nexbrief-an-automated-daily-it-newsletter-platform-for-engineering.md", "text": "https://wpnews.pro/news/how-i-built-nexbrief-an-automated-daily-it-newsletter-platform-for-engineering.txt", "jsonld": "https://wpnews.pro/news/how-i-built-nexbrief-an-automated-daily-it-newsletter-platform-for-engineering.jsonld"}}