<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ProjectStack Blog]]></title><description><![CDATA[A Blog By ProjectStack India Featuring Production-Ready MERN React Next.Js And Generative AI Projects With Complete Source Code And Documentation.]]></description><link>https://projectstack.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6acce9387d53f196bbde3dd6/653345d8-6861-45ea-8679-d6d55e272482.png</url><title>ProjectStack Blog</title><link>https://projectstack.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 18 Oct 2026 15:34:43 GMT</lastBuildDate><atom:link href="https://projectstack.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I Built AdCampaignManager A Production-Ready MERN Stack Generative AI Advertising SaaS Platform

]]></title><description><![CDATA[Existing advertising campaign tools are either too expensive or too complex. Most small agencies and freelancers still manage campaigns in spreadsheets. There is no middle ground.
So I Built AdCampaig]]></description><link>https://projectstack.hashnode.dev/how-i-built-adcampaignmanager-a-production-ready-mern-stack-generative-ai-advertising-saas-platform</link><guid isPermaLink="true">https://projectstack.hashnode.dev/how-i-built-adcampaignmanager-a-production-ready-mern-stack-generative-ai-advertising-saas-platform</guid><category><![CDATA[webdev]]></category><category><![CDATA[React]]></category><category><![CDATA[Node.js]]></category><category><![CDATA[MERN Stack]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Rishabhh Pandey]]></dc:creator><pubDate>Wed, 14 Oct 2026 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acce9387d53f196bbde3dd6/26dc228e-c9ba-4fdb-b401-762a3308e425.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Existing advertising campaign tools are either too expensive or too complex. Most small agencies and freelancers still manage campaigns in spreadsheets. There is no middle ground.</p>
<p>So I Built AdCampaignManager — A Full-Stack Advertising Campaign Management Platform That Combines Real-Time Data With Generative AI.</p>
<p>Here Is The Complete Breakdown Of How It Works.</p>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>🛠️ The Tech Stack</p>
<ul>
<li><p>Frontend - React.Js Plus Vite Plus Tailwind CSS v4</p>
</li>
<li><p>Backend - Node.Js Plus Express.Js</p>
</li>
<li><p>Database - MongoDB Plus Mongoose</p>
</li>
<li><p>Real-Time - Socket.IO</p>
</li>
<li><p>AI Layer - Groq LLM openai/gpt-oss-120b</p>
</li>
<li><p>Image Upload - Cloudinary Plus Multer</p>
</li>
<li><p>Email - Nodemailer</p>
</li>
<li><p>Scheduled Tasks - Node-Cron</p>
</li>
<li><p>Authentication - JWT Plus Bcrypt Plus OTP</p>
</li>
</ul>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>🎯 The 10 Core Modules</p>
<ol>
<li>Dashboard</li>
</ol>
<p>Real-Time KPI Cards Showing Impressions Clicks Conversions Revenue CTR CPC ROI And CVR. All Data Fetched Live From MongoDB Aggregation Pipelines.</p>
<ol>
<li>Authentication</li>
</ol>
<p>Register Login Email OTP Verification 2FA Password Reset Session Management. JWT With Access Plus Refresh Tokens Stored In localStorage.</p>
<ol>
<li>Campaign Management</li>
</ol>
<p>Full CRUD With Status Lifecycle Draft To Scheduled To Running To Paused To Completed To Cancelled. Duplicate Compare Side-By-Side Creative Upload Via Cloudinary.</p>
<ol>
<li>Audience Management</li>
</ol>
<p>Age Range Gender 50 Countries 50 Cities 50 Interests 50 Languages And Device Targeting. Overlap Detection Between Segments.</p>
<ol>
<li>Analytics And Insights</li>
</ol>
<p>Real-Time KPIs Engagement Heatmap Hour By Day Traffic Sources Funnel Analysis Campaign Leaderboard.</p>
<ol>
<li>Subscription Plans</li>
</ol>
<p>12 Plus Premium Tiers Subscribe Auto-Renew Corporate Plans Usage Analytics.</p>
<ol>
<li>Reviews And Moderation</li>
</ol>
<p>5-Star Ratings Sentiment Badges Photo Uploads Admin Approval Workflow.</p>
<ol>
<li>Team Collaboration</li>
</ol>
<p>Real-Time Chat Via Socket.IO Kanban Boards Member Roles Activity Feed.</p>
<ol>
<li>Support Tickets</li>
</ol>
<p>Categories Priorities Reply Threads Internal Notes Knowledge Base.</p>
<ol>
<li>AI Insights Dashboard</li>
</ol>
<p>Platform-Wide KPIs Anomaly Alerts AI Narratives.</p>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>🤖 The Generative AI Layer</p>
<p>Every Module Has Its Own Dedicated AI Service Powered By Groq LLM openai/gpt-oss-120b.</p>
<p>Here Are The 10 AI Services</p>
<p>Analytics AI</p>
<p>Narrate Insights Detect Anomalies Forecast Revenue For 30 60 90 Days Generate Report Advise KPI Explain Trend Reallocate Budget Analyze Creative.</p>
<p>Campaign AI</p>
<p>Write Copy Suggest Goal Optimize Budget Generate Name Quality Check Suggest Schedule.</p>
<p>Audience AI</p>
<p>Recommend Audience Suggest Interests Estimate Reach Optimize Demographics Build Lookalike Resolve Overlap.</p>
<p>Plan AI</p>
<p>Recommend Plan Write Benefits Advise Upgrade Detect Renewal Risk Suggest Pricing Build Corporate Plan.</p>
<p>Review AI</p>
<p>Sentiment Analysis Fake Review Detection Summarize Reviews Draft Admin Reply Moderate Photo Extract Highlights.</p>
<p>Insights AI</p>
<p>Narrate Platform Detect Anomalies Forecast Revenue Generate Report Advise KPI Explain Trend.</p>
<p>Support AI</p>
<p>Classify Ticket Draft Reply Detect Duplicate Suggest FAQ Predict Resolution Time Auto-Write FAQ.</p>
<p>Team AI</p>
<p>Summarize Chat Auto-Assign Tasks Find Meeting Time Productivity Insights Suggest File Tags Recommend Lead.</p>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>💡 Key Engineering Decisions</p>
<ol>
<li>JSON Mode</li>
</ol>
<p>Every AI Prompt Forces The LLM To Return Valid JSON. This Prevents Parsing Errors And Broken UI. Without JSON Mode The AI Sometimes Returns Markdown Which Crashes The Frontend Parser.</p>
<ol>
<li>cleanValue Helper</li>
</ol>
<p>The AI Sometimes Returns Placeholder Values Like N/A Or A Hyphen Or Empty Strings. This Helper Sanitizes Them Before They Reach The Frontend.</p>
<ol>
<li>Post-Processing</li>
</ol>
<p>After Every AI Response Arrays Are Filtered To Remove Invalid Values. Generation Plus Cleanup Is The Reliable Pattern.</p>
<ol>
<li>Real-Time Sync</li>
</ol>
<p>Socket.IO Room-Based Subscriptions For Team Chat. Each Client Joins Only The Rooms It Needs Using team Colon teamId Format. This Keeps Bandwidth Low And Updates Instant.</p>
<ol>
<li>Scheduled Automation</li>
</ol>
<p>Node-Cron Runs Two Jobs. Every Minute It Simulates Running Campaigns To Generate Realistic Impressions Clicks Conversions Spend And Revenue. Daily At Midnight It Aggregates Previous Day Analytics Into A Single Snapshot Document For Fast 30 60 90 Day Queries.</p>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>🔐 Security Architecture</p>
<ul>
<li><p>JWT Authentication With Access And Refresh Tokens</p>
</li>
<li><p>Email OTP Verification 6 Digits 1 Min Expiry</p>
</li>
<li><p>Optional 2FA Via Email</p>
</li>
<li><p>Password Reset Via OTP And Short-Lived JWT</p>
</li>
<li><p>Rate Limiting 500 Requests Per 15 Min Global 50 Requests Per 15 Min Auth</p>
</li>
<li><p>Helmet.Js Security Headers</p>
</li>
<li><p>CORS With Credentials</p>
</li>
<li><p>Cloudinary File Type Validation</p>
</li>
<li><p>Bcrypt Password Hashing 10 Salt Rounds</p>
</li>
<li><p>Environment Variables For All Secrets</p>
</li>
</ul>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>🎨 UI Design Philosophy</p>
<ul>
<li><p>Glassmorphism On Every Card Using backdrop-blur-xl border-2 border-white/10 rounded-3xl</p>
</li>
<li><p>Green Gradient Theme from-black via-[#021d0f] to-black Across All Pages</p>
</li>
<li><p>Uppercase Bold Typography With tracking-[0.2em]</p>
</li>
<li><p>Custom Dropdowns With Animated Chevrons</p>
</li>
<li><p>Modal Portals With Backdrop Blur</p>
</li>
<li><p>Toast Notifications With Color-Coded Types</p>
</li>
<li><p>Corner Brackets On Every Card</p>
</li>
<li><p>Floating Icon Animations</p>
</li>
<li><p>Staggered Fade-In For Table Rows</p>
</li>
<li><p>Fully Responsive Design</p>
</li>
</ul>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>💡 Key Challenges And Learnings</p>
<p>Challenge 1 — AI Output Reliability</p>
<p>The LLM Sometimes Returns Invalid JSON Or Placeholder Values. This Was Fixed With A Three-Layer Approach. First Force JSON Mode At The API Level. Second Sanitize Every Value With The cleanValue Helper. Third Filter Arrays During Post-Processing.</p>
<p>Challenge 2 — Real-Time Team Chat</p>
<p>The Team Members Needed Live Chat Without Refresh. This Was Solved With Socket.IO Room-Based Subscriptions. Each Client Joins Only The Rooms It Needs.</p>
<p>Challenge 3 — Fast Analytics Queries</p>
<p>The Analytics Collection Grew Huge. This Was Solved With Daily Snapshot Cron Job That Aggregates Data Into A Lightweight Collection For Fast Queries.</p>
<p>Challenge 4 — Multi-Role Permission</p>
<p>Admin And User Roles Need Different Access Levels. This Was Solved With owner Field Check Plus isAdmin Boolean Plus Backend authorize Middleware.</p>
<p>Challenge 5 — Campaign Lifecycle</p>
<p>Campaigns Need To Move Through Multiple States. This Was Solved With Auto Transitions From Draft To Scheduled To Running To Paused To Completed To Cancelled.</p>
<p>Challenge 6 — Image Uploads In Serverless</p>
<p>Local Disk Storage Breaks In Serverless Deployments. This Was Solved With Cloudinary Streaming API. The File Buffer Goes Directly To CDN.</p>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>🎯 What Comes Next</p>
<p>I Am Currently Working On Adding Voice-Based AI Assistant To AdCampaignManager. The Plan Is To Let Users Speak Commands Like Create A New Campaign For Sneakers With 5000 Rupees Daily Budget And The AI Will Auto-Fill Everything.</p>
<p>Other Planned Features Include</p>
<ul>
<li><p>Real-Time Collaboration With Cursor Tracking</p>
</li>
<li><p>Mobile App Using React Native</p>
</li>
<li><p>Public API For Third-Party Developers</p>
</li>
<li><p>Advanced Predictive Analytics Dashboard</p>
</li>
</ul>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>📌 Final Thoughts</p>
<p>Building AdCampaignManager Taught Me That Production AI Is Not Just About Calling An LLM. It Is About Prompt Engineering Error Handling Post-Processing And Delivering Clean Data To Users.</p>
<p>The Biggest Lesson Was That Reliability Matters More Than Cleverness. A Simple JSON Mode Plus Cleanup Logic Beats An Elaborate Prompt That Sometimes Fails.</p>
<p>The Second Lesson Was That Real-Time Features Need Careful Architecture. Broadcasting To All Clients Kills Performance. Room-Based Subscriptions Are The Way.</p>
<p>━━━━━━━━━━━━━━━━━━</p>
<p>Interested In The Full Source Code Or Getting This Project For Your Portfolio?</p>
<p>🌐 <a href="https://www.theprojectstack.com/">https://www.theprojectstack.com/</a></p>
<p>Happy To Answer Any Questions About The Architecture Or AI Integration. Drop A Comment Below!</p>
]]></content:encoded></item><item><title><![CDATA[How I Built AirSense A Production -Ready MERN + Generative AI Air Quality Monitoring Ecosystem]]></title><description><![CDATA[Existing Air Quality Dashboards Just Show Numbers. No Context. No Forecasts. No Actionable Insights.
So I Built AirSense A Full-Stack Air Quality Monitoring Ecosystem That Combines Real-Time Data With]]></description><link>https://projectstack.hashnode.dev/how-i-built-airsense-a-production-ready-mern-generative-ai-air-quality-monitoring-ecosystem</link><guid isPermaLink="true">https://projectstack.hashnode.dev/how-i-built-airsense-a-production-ready-mern-generative-ai-air-quality-monitoring-ecosystem</guid><category><![CDATA[webdev]]></category><category><![CDATA[React]]></category><category><![CDATA[Node.js]]></category><category><![CDATA[AI]]></category><category><![CDATA[MERN Stack]]></category><dc:creator><![CDATA[Rishabhh Pandey]]></dc:creator><pubDate>Mon, 12 Oct 2026 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acce9387d53f196bbde3dd6/18d09906-1664-461a-9e80-40d62a00944a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Existing Air Quality Dashboards Just Show Numbers. No Context. No Forecasts. No Actionable Insights.</p>
<p>So I Built AirSense A Full-Stack Air Quality Monitoring Ecosystem That Combines Real-Time Data With Generative AI.</p>
<p>Here Is The Complete Breakdown Of How It Works.</p>
<p>🛠️ The Tech Stack</p>
<ul>
<li><p>Frontend - React.Js + Tailwind CSS</p>
</li>
<li><p>Backend - Node.Js + Express.Js</p>
</li>
<li><p>Database - MongoDB + Mongoose</p>
</li>
<li><p>Real-Time - Socket.IO</p>
</li>
<li><p>AI Layer - Groq LLM</p>
</li>
<li><p>Cloud - Cloudinary + WAQI API</p>
</li>
<li><p>Authentication - JWT With 2FA And OTP Verification</p>
</li>
</ul>
<p>🌬️ Core Features</p>
<p>Real-Time Monitoring</p>
<p>A Multi-Station AQI Dashboard With Live Updates Via Socket.IO. Color-Coded Heatmaps Across All Monitoring Stations. A 24-Hour Timeline Scrubber And Trend History. Every New Reading Pushes Instantly To Connected Clients Without A Page Refresh.</p>
<p>Generative AI Layer Powered By Groq LLM</p>
<ul>
<li><p>AI Insight Narrator - Plain-English AQI Explanations With Exact Numbers</p>
</li>
<li><p>Anomaly Explainer - Detects Unusual Pollution Patterns And Suggests Causes</p>
</li>
<li><p>Health Advisory Writer - Real-Time Precautions For Sensitive Zones Like Schools And Hospitals</p>
</li>
<li><p>Pollution Source Narrator - Explains Why A Specific Pollutant Dominates At A Station</p>
</li>
<li><p>Compliance Summarizer - Regulatory Insights For WHO US EPA CPCB And EU Standards</p>
</li>
<li><p>Report Writer - AI-Generated Executive Reports For Any Time Period</p>
</li>
<li><p>KPI Advisor - Recommends Which Metrics To Focus On Based On Live Data</p>
</li>
<li><p>Trend Explainer - Breaks Down Why A Metric Moved Up Down Or Stayed Stable</p>
</li>
</ul>
<p>Forecasting Engine</p>
<p>Statistical Time-Series Forecasting Using Linear Regression. Predictions For 12-Hour 7-Day And 30-Day Horizons. Every Forecast Is Enhanced With AI-Generated Explanations And Confidence Scoring. Also Supports Side-By-Side Forecast Comparison Across Multiple Stations.</p>
<p>Multi-Standard Compliance</p>
<p>Instantly Check Pollutant Levels Against WHO US EPA CPCB And EU Standards. Each Reading Is Graded As Pass Or Fail With Exceedance Percentage Calculated Automatically.</p>
<p>Pollution Source Attribution</p>
<p>AI Analyzes And Attributes Pollution To Sources Like Traffic Industrial Construction Crop Burning Natural And Other. Each Source Comes With Impact Metrics For Population Health Economy And Carbon Footprint.</p>
<p>🤖 The AI Layer In Detail</p>
<p>Every AI Feature Runs On Groq LLM Using Two Models. The Primary Model Is openai/gpt-oss-120b For Complex Reasoning And The Secondary Model Is llama-3.1-8b-instant For Faster Simpler Tasks.</p>
<p>Key Engineering Decisions</p>
<ol>
<li><p>JSON Mode - Every Prompt Forces The LLM To Return Valid JSON. This Prevents Parsing Errors And Broken UI.</p>
</li>
<li><p>cleanValue Helper - The AI Sometimes Returns Placeholder Values Like A Hyphen Or N/A Or Empty Strings. This Helper Sanitizes Them Before They Reach The Frontend.</p>
</li>
<li><p>sessionSeed - A Random 6-Character String Is Injected Into Every Prompt. This Prevents The AI From Repeating The Same Answer On Every Call.</p>
</li>
<li><p>Post-Processing - After Every AI Response Arrays Are Filtered To Remove Invalid Values. Generation Plus Cleanup Is The Reliable Pattern.</p>
</li>
<li><p>Temperature Tuning - Different AI Services Use Different Temperature Settings. Creative Tasks Use Higher Temperature Around 0.85 While Deterministic Tasks Use Lower Temperature Around 0.3.</p>
</li>
</ol>
<p>📊 Forecasting Is Not AI But Enhanced By It</p>
<p>The Prediction Itself Uses Linear Regression Which Is A Statistical Method. Not A Neural Network. Not A Transformer. Just Classic Maths.</p>
<p>But Every Forecast Is Enhanced With -</p>
<ul>
<li><p>AI-Generated Explanations Of The Trend</p>
</li>
<li><p>Confidence Scoring That Decreases With Horizon</p>
</li>
<li><p>Health Advisory Recommendations Based On Predicted AQI</p>
</li>
<li><p>Weather Impact Analysis</p>
</li>
</ul>
<p>This Hybrid Approach Is What Modern Production Apps Actually Use.</p>
<p>🔐 Security Architecture</p>
<ul>
<li><p>JWT Authentication With 2FA</p>
</li>
<li><p>OTP Verification Via Email For Registration And Password Reset</p>
</li>
<li><p>Role-Based Access Control For Admin And User Roles</p>
</li>
<li><p>Session Management With Full Audit Trail</p>
</li>
<li><p>Password Hashing With Bcrypt</p>
</li>
<li><p>Rate Limiting On Sensitive Endpoints</p>
</li>
<li><p>Environment Variables For All Secrets</p>
</li>
</ul>
<p>💡 Key Challenges And Learnings</p>
<p>Challenge 1 - AI Output Reliability</p>
<p>Sometimes The AI Returned Placeholder Values Empty Arrays Or Even Broke JSON Format. This Was Fixed With A Three-Layer Approach. First Force JSON Mode At The API Level. Second Sanitize Every Value With The cleanValue Helper. Third Filter Arrays During Post-Processing.</p>
<p>Challenge 2 - Real-Time Sync</p>
<p>The Dashboard Needed Live Updates Without Refreshing. This Was Solved With Socket.IO Room-Based Subscriptions Using station-id Format. Each Client Joins Only The Rooms It Needs.</p>
<p>Challenge 3 - Stateless Uploads</p>
<p>Storing Images On The Server Would Break In Serverless Deployments. This Was Solved By Using Cloudinary Streaming API Instead Of Local Disk Storage.</p>
<p>Challenge 4 - Multi-Standard Compliance Logic</p>
<p>Each Regulatory Body Has Different Limits For Each Pollutant. This Was Solved With A Central LIMITS Object That Maps Every Standard-Pollutant Combination To Its Threshold Value.</p>
<p>🎯 What Comes Next</p>
<p>I Am Currently Working On Adding LSTM Neural Networks For Forecasting To Push Accuracy Higher Than Linear Regression. The Plan Is To Use TensorFlow.Js For Direct Node.Js Integration Without Needing A Separate Python Service.</p>
<p>Other Planned Features Include -</p>
<ul>
<li><p>Real Payment Gateway Integration</p>
</li>
<li><p>Mobile App Using React Native</p>
</li>
<li><p>Public API For Third-Party Developers</p>
</li>
<li><p>Advanced Historical Analytics Dashboard</p>
</li>
</ul>
<p>📌 Final Thoughts</p>
<p>Building AirSense Taught Me That Production AI Is Not Just About Calling An LLM. It Is About Prompt Engineering Error Handling Post-Processing And Delivering Clean Data To Users.</p>
<p>The Biggest Lesson Was That Reliability Matters More Than Cleverness. A Simple JSON Mode Plus Cleanup Logic Beats An Elaborate Prompt That Sometimes Fails.</p>
<p>Interested In The Full Source Code Or Getting This For Your Portfolio?</p>
<p>🌐 <a href="https://www.theprojectstack.com/">https://www.theprojectstack.com/</a></p>
<p>Happy To Answer Any Questions About The Architecture Or AI Integration. Drop A Comment Below!</p>
]]></content:encoded></item></channel></rss>