<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aashutosh Bairagi</title>
    <description>The latest articles on DEV Community by Aashutosh Bairagi (@aashutosh_bairagi_31).</description>
    <link>https://dev.to/aashutosh_bairagi_31</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3604420%2Fef46fc80-d2fe-485e-b921-ea76f5ac10bb.png</url>
      <title>DEV Community: Aashutosh Bairagi</title>
      <link>https://dev.to/aashutosh_bairagi_31</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aashutosh_bairagi_31"/>
    <language>en</language>
    <item>
      <title>From a Fresh Arch Install to a Fully Configured Development Environment in One Command</title>
      <dc:creator>Aashutosh Bairagi</dc:creator>
      <pubDate>Mon, 20 Jul 2026 18:31:55 +0000</pubDate>
      <link>https://dev.to/aashutosh_bairagi_31/from-a-fresh-arch-install-to-a-fully-configured-development-environment-in-one-command-4cg5</link>
      <guid>https://dev.to/aashutosh_bairagi_31/from-a-fresh-arch-install-to-a-fully-configured-development-environment-in-one-command-4cg5</guid>
      <description>&lt;p&gt;&lt;em&gt;How I automated my Arch Linux + Omarchy + Hyprland setup with reproducible dotfiles, backups, and a single bootstrap script.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/VLXFC8DVdHk"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Like many Arch Linux users, I've reinstalled my system more times than I'd like to admit.&lt;/p&gt;

&lt;p&gt;Every reinstall meant spending hours installing packages, configuring Hyprland, tweaking Waybar, setting up Ghostty, restoring VS Code settings, copying wallpapers, and hoping I didn't forget some tiny configuration that I'd eventually notice days later.&lt;/p&gt;

&lt;p&gt;I wanted my development environment to be reproducible.&lt;/p&gt;

&lt;p&gt;So I built a repository that can recreate my entire setup—from packages to desktop configuration—with a single command while safely backing up any existing configuration before making changes.&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;GitHub Repository:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/Aashutosh31/dotfiles" rel="noopener noreferrer"&gt;https://github.com/Aashutosh31/dotfiles&lt;/a&gt;&lt;/p&gt;


&lt;h1&gt;
  
  
  Why I Built This
&lt;/h1&gt;

&lt;p&gt;I wanted a setup that could:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Recreate my workstation in minutes&lt;/li&gt;
&lt;li&gt;Install required packages automatically&lt;/li&gt;
&lt;li&gt;Restore all configurations&lt;/li&gt;
&lt;li&gt;Never overwrite files without creating a backup&lt;/li&gt;
&lt;li&gt;Stay version-controlled in Git&lt;/li&gt;
&lt;li&gt;Be easy to maintain and extend&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of manually configuring everything after every reinstall, I wanted to simply run one command.&lt;/p&gt;


&lt;h1&gt;
  
  
  What's Included
&lt;/h1&gt;
&lt;h2&gt;
  
  
  Desktop
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Distribution:&lt;/strong&gt; Arch Linux (Omarchy)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Window Manager:&lt;/strong&gt; Hyprland&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Status Bar:&lt;/strong&gt; Waybar&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Theme:&lt;/strong&gt; Tokyo Night&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Terminal
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Terminal:&lt;/strong&gt; Ghostty&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shell:&lt;/strong&gt; Zsh&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt:&lt;/strong&gt; Starship&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;System Information:&lt;/strong&gt; Fastfetch&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Development
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Editor:&lt;/strong&gt; VS Code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alternative Editor:&lt;/strong&gt; LazyVim&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terminal Multiplexer:&lt;/strong&gt; Zellij&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Utilities
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File Manager:&lt;/strong&gt; Yazi&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audio:&lt;/strong&gt; Wiremix&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OSD:&lt;/strong&gt; SwayOSD&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;
  
  
  Desktop Preview
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcyqq1ppxr13nm2lf1hn7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcyqq1ppxr13nm2lf1hn7.png" alt="Desktop Preview" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is my everyday desktop powered by Hyprland, Waybar, Ghostty, and the Tokyo Night color scheme.&lt;/p&gt;

&lt;p&gt;The goal wasn't to create an eye-catching desktop for screenshots—it was to build something comfortable enough to use every day for software development.&lt;/p&gt;


&lt;h1&gt;
  
  
  Terminal Setup
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsa5pojpu9rera1i35wgs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsa5pojpu9rera1i35wgs.png" alt="Terminal" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ghostty has become my preferred terminal thanks to its speed and modern rendering.&lt;/p&gt;

&lt;p&gt;Combined with Zsh, Starship, and Fastfetch, it creates a clean and productive terminal experience.&lt;/p&gt;


&lt;h1&gt;
  
  
  VS Code Configuration
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fahiotiu8lvhg7676t0g2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fahiotiu8lvhg7676t0g2.png" alt="VS Code" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although the repository also includes my LazyVim configuration, VS Code is currently my primary editor.&lt;/p&gt;

&lt;p&gt;My VS Code setup includes custom settings, extensions, keybindings, and themes that match the rest of the desktop.&lt;/p&gt;


&lt;h1&gt;
  
  
  Yazi File Manager
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6fqs8o1bridl0hf1xa8r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6fqs8o1bridl0hf1xa8r.png" alt="Yazi" width="799" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yazi is an incredibly fast terminal file manager that fits naturally into my workflow.&lt;/p&gt;

&lt;p&gt;It's keyboard-driven, lightweight, and feels right at home alongside the rest of the terminal-based tools.&lt;/p&gt;


&lt;h1&gt;
  
  
  One Command Installation
&lt;/h1&gt;

&lt;p&gt;For a fresh Arch installation, everything can be installed using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Aashutosh31/dotfiles/main/bootstrap.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bootstrap script automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installs Git (if needed)&lt;/li&gt;
&lt;li&gt;Installs &lt;code&gt;yay&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Clones the repository&lt;/li&gt;
&lt;li&gt;Installs required packages&lt;/li&gt;
&lt;li&gt;Applies all configurations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After that, the actual installation is handled by &lt;code&gt;install.sh&lt;/code&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Automatic Backups
&lt;/h1&gt;

&lt;p&gt;One feature I cared about the most was safety.&lt;/p&gt;

&lt;p&gt;Before replacing &lt;strong&gt;any&lt;/strong&gt; configuration, the installer creates a timestamped backup.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.dotfiles-backup/
└── 20260720-184501/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing gets overwritten without first being backed up.&lt;/p&gt;

&lt;p&gt;If I ever want to restore an older configuration, it's just a simple copy operation.&lt;/p&gt;




&lt;h1&gt;
  
  
  Repository Structure
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── hypr/
├── ghostty/
├── fastfetch/
├── starship/
├── yazi/
├── vscode/
├── waybar/
├── wallpapers/
├── packages/
├── scripts/
├── install.sh
└── bootstrap.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keeping every application's configuration inside its own directory makes the repository easier to maintain and extend over time.&lt;/p&gt;




&lt;h1&gt;
  
  
  Why I Didn't Use GNU Stow
&lt;/h1&gt;

&lt;p&gt;Many dotfile repositories rely on GNU Stow.&lt;/p&gt;

&lt;p&gt;While it's a great tool, I wanted something that also handled package installation, backups, and first-time machine setup.&lt;/p&gt;

&lt;p&gt;The installer performs everything in one workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Package installation&lt;/li&gt;
&lt;li&gt;Backup creation&lt;/li&gt;
&lt;li&gt;Configuration deployment&lt;/li&gt;
&lt;li&gt;Initial machine bootstrap&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes it much easier to move to a brand-new machine.&lt;/p&gt;




&lt;h1&gt;
  
  
  Lessons Learned
&lt;/h1&gt;

&lt;p&gt;Working on this project taught me a lot beyond shell scripting.&lt;/p&gt;

&lt;p&gt;Some takeaways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Good documentation is just as important as good code.&lt;/li&gt;
&lt;li&gt;Automated backups make installation much safer.&lt;/li&gt;
&lt;li&gt;Modular configuration directories are much easier to maintain.&lt;/li&gt;
&lt;li&gt;Version-controlling your development environment saves a tremendous amount of time.&lt;/li&gt;
&lt;li&gt;Small automation scripts quickly become some of the most useful tools you write.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Future Improvements
&lt;/h1&gt;

&lt;p&gt;There are still plenty of ideas I'd like to add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Theme switching&lt;/li&gt;
&lt;li&gt;Optional package groups&lt;/li&gt;
&lt;li&gt;Better wallpaper management&lt;/li&gt;
&lt;li&gt;CI validation&lt;/li&gt;
&lt;li&gt;More customization options&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;What started as a personal backup of my Linux setup gradually evolved into a fully reproducible development environment.&lt;/p&gt;

&lt;p&gt;If you're using Arch Linux, Omarchy, or Hyprland, I hope this repository helps you build your own workflow—or at least gives you some ideas for organizing your own dotfiles.&lt;/p&gt;

&lt;p&gt;If you find it useful, feel free to ⭐ star the repository, open an issue, or suggest improvements.&lt;/p&gt;

&lt;p&gt;I'd love to hear your feedback.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Repository
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Aashutosh31/dotfiles" rel="noopener noreferrer"&gt;https://github.com/Aashutosh31/dotfiles&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>archlinux</category>
      <category>programming</category>
      <category>hyprland</category>
    </item>
    <item>
      <title>ARC-AI: I built an autonomous, AI agent workspace Using MERN stack (RAG memory, live web research, WhatsApp automation, and more)</title>
      <dc:creator>Aashutosh Bairagi</dc:creator>
      <pubDate>Sat, 18 Jul 2026 18:54:45 +0000</pubDate>
      <link>https://dev.to/aashutosh_bairagi_31/arc-ai-i-built-an-autonomous-self-hosted-ai-agent-workspace-on-the-mern-stack-rag-memory-live-3hdj</link>
      <guid>https://dev.to/aashutosh_bairagi_31/arc-ai-i-built-an-autonomous-self-hosted-ai-agent-workspace-on-the-mern-stack-rag-memory-live-3hdj</guid>
      <description>&lt;h2&gt;
  
  
  🤖 What is ARC-AI?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ARC-AI (Autonomous Real-time Conversational Agent)&lt;/strong&gt; is a full-stack, voice-activated AI assistant I've been building that goes beyond the typical "chatbot with a system prompt." It's a persistent, AI workspace with long-term memory, live web research, proactive scheduled routines, and the ability to actually &lt;em&gt;act&lt;/em&gt; — sending WhatsApp messages, emails, and controlling its own UI.&lt;/p&gt;

&lt;p&gt;Think of it as sitting somewhere between ChatGPT, Claude, and Cursor — but self-hosted, MERN-based, and fully yours.&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://arc-ai-project.vercel.app/" rel="noopener noreferrer"&gt;https://arc-ai-project.vercel.app/&lt;/a&gt;&lt;br&gt;
🔗 &lt;strong&gt;Source code:&lt;/strong&gt; &lt;a href="https://github.com/Aashutosh31/arc-ai-project" rel="noopener noreferrer"&gt;https://github.com/Aashutosh31/arc-ai-project&lt;/a&gt;&lt;br&gt;
📽️ &lt;strong&gt;Latest Video:&lt;/strong&gt;&lt;a href="https://www.instagram.com/aashutosh_bairagi.31/reel/DYmluEPxOhf/" rel="noopener noreferrer"&gt;https://www.instagram.com/aashutosh_bairagi.31/reel/DYmluEPxOhf/&lt;/a&gt;&lt;br&gt;
🎥 &lt;strong&gt;Full walkthrough:&lt;/strong&gt; &lt;a href="https://www.youtube.com/watch?v=jt7q8v5KsrU" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=jt7q8v5KsrU&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpvmdi2ci9gpa9in2fbd1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpvmdi2ci9gpa9in2fbd1.png" alt="ARC-AI" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Why I built it
&lt;/h2&gt;

&lt;p&gt;Most "AI assistants" are reactive — you ask, it answers, and it forgets everything the moment the tab closes. I wanted something that behaves more like an actual agent: it remembers what matters, researches things on its own, runs scheduled tasks in the background, and can reach across into the real world (browser, WhatsApp, email) instead of being boxed into a chat window.&lt;/p&gt;

&lt;p&gt;That meant building real infrastructure, not just wiring up an LLM API call — a provider-agnostic runtime, workspace isolation, vector memory, sandboxed code execution, and production-grade lifecycle management.&lt;/p&gt;


&lt;h2&gt;
  
  
  🧠 Core Features
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Infinite Memory (RAG)
&lt;/h3&gt;

&lt;p&gt;ARC-AI doesn't just keep a chat log — it separates memory into four distinct layers to avoid contamination and keep retrieval sharp:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conversation History&lt;/li&gt;
&lt;li&gt;Working Context&lt;/li&gt;
&lt;li&gt;Semantic Memory&lt;/li&gt;
&lt;li&gt;Long-Term User Facts
Retrieval runs through relevance scoring, recency weighting, and duplicate suppression using &lt;strong&gt;Pinecone&lt;/strong&gt; vector search, so the assistant pulls in prioritized, low-noise context instead of dumping everything it knows into the prompt.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx6pa64uejoolohrlsued.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx6pa64uejoolohrlsued.png" alt="Command Pallete" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  🎥 Live Vision &amp;amp; Multimodal Routing
&lt;/h3&gt;

&lt;p&gt;ARC-AI can see. When you speak while your webcam is active, it captures the current frame and pipes it straight into the same real-time socket payload as your voice input, routing visual context to a vision-capable model (Pixtral) with guardrails to prevent silent attachment loss on fallback.&lt;/p&gt;
&lt;h3&gt;
  
  
  🌐 Live Web Research
&lt;/h3&gt;

&lt;p&gt;Real-time DOM scraping (Cheerio) plus API-based search, weather, and news retrieval — so answers aren't capped at a training cutoff.&lt;/p&gt;
&lt;h3&gt;
  
  
  ⏰ Proactive Routine Engine
&lt;/h3&gt;

&lt;p&gt;Ask it in plain English and it turns that into a scheduled cron job — recurring reminders, deferred tasks, background routines — no manual cron syntax required.&lt;/p&gt;
&lt;h3&gt;
  
  
  💬 WhatsApp Automation
&lt;/h3&gt;

&lt;p&gt;Full autonomous message composition and delivery through an integrated WhatsApp workflow, so the agent can actually reach you (or others) outside the app.&lt;/p&gt;
&lt;h3&gt;
  
  
  🖥️ UI Actuation
&lt;/h3&gt;

&lt;p&gt;The assistant can act on its own interface — switching themes, opening websites, playing media, copying to clipboard — driven directly by conversational context.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frbaz9gdcu136jljya6hm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frbaz9gdcu136jljya6hm.png" alt="Isolated-WorkSpaces" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  🏗️ Under the Hood: Provider-Agnostic, Workspace-Isolated Runtime
&lt;/h2&gt;

&lt;p&gt;The architecture went through several major evolutions to get here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Provider-orchestrated runtime&lt;/strong&gt; — an &lt;code&gt;LLMRouter&lt;/code&gt; dynamically selects between &lt;strong&gt;Gemini&lt;/strong&gt; (reasoning, multimodal, planning, long-context) and &lt;strong&gt;Mistral&lt;/strong&gt; (fast, cheap, summarization, fallback), while preserving streaming continuity and tool-call consistency across providers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-workspace runtime&lt;/strong&gt; — every workspace behaves as its own isolated environment. Conversations, memories, executions, and even Pinecone vector namespaces are fully scoped per workspace, with zero cross-workspace leakage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execution isolation&lt;/strong&gt; — the &lt;code&gt;TaskPlanner&lt;/code&gt;/&lt;code&gt;TaskExecutor&lt;/code&gt; system keeps retries, recovery, and replanning strictly bound to their originating workspace.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  - &lt;strong&gt;Realtime Socket.IO pipeline&lt;/strong&gt; — voice or text input flows through &lt;code&gt;ai:stt:final&lt;/code&gt;, gets routed for generation, streams token-by-token, and guarantees clean finalization even on interruption.
&lt;/h2&gt;
&lt;h2&gt;
  
  
  🔥 What's new in v1.0.0 (first stable release)
&lt;/h2&gt;

&lt;p&gt;The latest release was all about turning ARC-AI from "cool demo" into something you can actually self-host in production:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security hardening&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replaced the deprecated, vulnerable &lt;code&gt;vm2&lt;/code&gt; executor with &lt;strong&gt;QuickJS WebAssembly sandboxing&lt;/strong&gt; (&lt;code&gt;quickjs-emscripten&lt;/code&gt;) for any code the LLM executes — closing an RCE vulnerability.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GOOGLE_TOKEN_ENCRYPTION_KEY&lt;/code&gt; is now a mandatory env var — the server fails fast on startup if it's missing, instead of silently falling back to something insecure.&lt;/li&gt;
&lt;li&gt;Replaced wildcard CORS with a dynamic origin resolver, fixing credentialed-request validation issues.
&lt;strong&gt;Runtime reliability&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;An activity-aware idle reaper kills headless Chromium (WhatsApp) sessions after 5 minutes of inactivity, so it stops eating RAM/CPU.&lt;/li&gt;
&lt;li&gt;Graceful shutdown on &lt;code&gt;SIGINT&lt;/code&gt;/&lt;code&gt;SIGTERM&lt;/code&gt; — HTTP servers, MongoDB connections, and Puppeteer/WhatsApp processes all tear down cleanly and in parallel.&lt;/li&gt;
&lt;li&gt;Fixed race conditions between client destruction and recovery hooks.
&lt;strong&gt;Onboarding &amp;amp; deployment&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Docker Compose now uses portable relative bind mounts instead of hardcoded host paths.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  - Full &lt;code&gt;.env.example&lt;/code&gt; templates for both root and server, documenting every LLM routing/model/timeout option.
&lt;/h2&gt;
&lt;h2&gt;
  
  
  💻 Tech Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;td&gt;React, Vite, Tailwind CSS, Web Speech API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend&lt;/td&gt;
&lt;td&gt;Node.js, Express.js, Socket.IO, node-cron&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;MongoDB Atlas, Pinecone (vector RAG)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI / ML&lt;/td&gt;
&lt;td&gt;Gemini, Mistral AI, Pixtral&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Infra&lt;/td&gt;
&lt;td&gt;Docker Compose, Google Apps Script (webhook email)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  ⚙️ Try it yourself
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Aashutosh31/arc-ai-project.git
&lt;span class="nb"&gt;cd &lt;/span&gt;arc-ai-project/server
npm &lt;span class="nb"&gt;install
cp&lt;/span&gt; .env.example .env   &lt;span class="c"&gt;# fill in your keys — GOOGLE_TOKEN_ENCRYPTION_KEY is mandatory&lt;/span&gt;
npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Or spin it up with Docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;server
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env
docker compose up &lt;span class="nt"&gt;--build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Full setup instructions (frontend, Docker, persistent WhatsApp sessions) are in the &lt;a href="https://github.com/Aashutosh31/arc-ai-project" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;I'm continuing to harden the multi-workspace runtime and expand the autonomous tool ecosystem. If you try it out, run into issues, or have ideas, I'd genuinely love the feedback — issues and PRs are open on the repo.&lt;/p&gt;

&lt;p&gt;If this is interesting to you, a ⭐ on the repo goes a long way.&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/Aashutosh31" rel="noopener noreferrer"&gt;github.com/Aashutosh31&lt;/a&gt;&lt;br&gt;
🔗 LinkedIn: &lt;a href="https://in.linkedin.com/in/aashutosh-bairagi-559aa530b" rel="noopener noreferrer"&gt;https://in.linkedin.com/in/aashutosh-bairagi-559aa530b&lt;/a&gt;&lt;br&gt;
🐦 X/Twitter: &lt;a href="https://x.com/Aashutosh_dev31" rel="noopener noreferrer"&gt;@Aashutosh_dev31&lt;/a&gt;&lt;br&gt;
🌐 Portfolio: &lt;a href="https://aashutoshbairagi.vercel.app" rel="noopener noreferrer"&gt;aashutoshbairagi.vercel.app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How I Built a Real-Time Stock Suggestion App with the MERN Stack, WebSockets, and Algorithmic Trading Logic ?</title>
      <dc:creator>Aashutosh Bairagi</dc:creator>
      <pubDate>Mon, 10 Nov 2025 17:59:12 +0000</pubDate>
      <link>https://dev.to/aashutosh_bairagi_31/how-i-built-a-real-time-stock-suggestion-app-with-the-mern-stack-websockets-and-algorithmic-1mk7</link>
      <guid>https://dev.to/aashutosh_bairagi_31/how-i-built-a-real-time-stock-suggestion-app-with-the-mern-stack-websockets-and-algorithmic-1mk7</guid>
      <description>&lt;p&gt;&lt;a href="https://stock-suggestion-application.vercel.app/" rel="noopener noreferrer"&gt;Web Application Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finance and tech are converging faster than ever. As developers, we have the tools to build incredibly powerful applications that demystify market data. I set out to do just that: build a full-stack web application that not only tracks stock data but also provides actionable, AI-driven suggestions in real-time.&lt;/p&gt;

&lt;p&gt;This article is a technical deep-dive into the architecture and key features of my Stock Suggestion App. We'll cover the "AI" backend, the real-time WebSocket layer, and how it all connects to a resilient React frontend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Tech Stack 🥞&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Frontend: React 18, Vite, React Router 7, Tailwind CSS, Framer Motion.&lt;br&gt;
2.State Management: @tanstack/react-query (for server state) &amp;amp; React Context (for auth/theme).&lt;br&gt;
3.Backend: Node.js, Express, Mongoose (MongoDB).&lt;br&gt;
4.Real-time Layer: ws (WebSocketServer).&lt;br&gt;
5.Authentication: Passport.js.&lt;br&gt;
6.Charting: lightweight-charts &amp;amp; recharts.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Architecture: A Three-Layered Approach
&lt;/h2&gt;

&lt;p&gt;The app is broken down into three core components: the "AI" Signal Service, the Real-time Data Hub, and the Reactive Frontend.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;1. The "Brain": Algorithmic Signal Generation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The term "AI" gets thrown around a lot. In this project, it refers to a dedicated backend service (signalService.js) that runs technical analysis on historical stock data to generate actionable insights.&lt;/p&gt;

&lt;p&gt;It calculates several key Technical Indicators (TIs):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Simple Moving Average (SMA): I calculate both the 50-day and 200-day SMAs to identify long-term trends.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Relative Strength Index (RSI): A proxy calculation to determine if a stock is overbought or oversold.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Moving Average Convergence Divergence (MACD): A proxy to gauge momentum by comparing short-term and long-term averages.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These indicators are fed into two key functions:&lt;br&gt;
1.determineSignal(latestData): This function applies a rules-based logic (e.g., "if RSI &amp;lt; 30 and MACD &amp;gt; 0, signal 'Strong Buy'") to provide a clear BUY, SELL, or HOLD recommendation.&lt;/p&gt;

&lt;p&gt;2.calculateTrendingScore(latestData): This is the secret sauce for the "Top Picks" page. It generates a proprietary score from 0-100 based on a weighted average of momentum, RSI strength, and long-term trend confirmation (e.g., is the price above its 200-day SMA?).&lt;/p&gt;

&lt;p&gt;This service runs on the backend, enriches the data, and saves the results to MongoDB. This pre-calculated data is then served to the user.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;2. The "Heartbeat": Real-Time with WebSockets&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A stock app without real-time data feels static. I used the ws library to build a lightweight WebSocket server that integrates directly with the main Express API.&lt;/p&gt;

&lt;p&gt;On the Backend (server.js): Instead of running a separate server, I attach the WebSocketServer to the same HTTP server instance that Express uses. This is efficient and simplifies deployment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In server.js...
import { WebSocketServer } from 'ws';
import { handleConnection } from './core/websocket.js';

// ... after mongoose connects ...
const server = app.listen(process.env.PORT || 5000, /* ... */);

// --- 2. INITIALIZE THE *NEW* WEBSOCKET SERVER ---
const wss = new WebSocketServer({ server }); // Attach to the Express server

wss.on('connection', (ws) =&amp;gt; {
    handleConnection(ws); // Delegate logic to a separate module
});

console.log("✅ Real-time WebSocket service initialized...");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This handleConnection module is responsible for managing connected clients and, crucially, broadcasting real-time price and signal updates as they happen.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. The "Face": A Resilient React Frontend&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The frontend's main challenge is managing data from two sources: a traditional REST API (for historical data, watchlist) and a WebSocket (for live updates).&lt;/p&gt;

&lt;p&gt;1.The Hybrid Data-Fetching Pattern: I landed on a powerful hybrid pattern using Tanstack Query (React Query) and a WebSocketContext. The TopPicks.jsx page is the best example of this.&lt;/p&gt;

&lt;p&gt;2.Initial Load (HTTP): The page first uses useQuery to fetch the pre-calculated list of top picks from the /api/stocks/top-picks REST endpoint. This gives the user instant, cached data.&lt;/p&gt;

&lt;p&gt;3.Live Updates (WebSocket): Simultaneously, useWebSocket() (from my custom context) is connected. It listens for live "tick" messages from the server.&lt;/p&gt;

&lt;p&gt;4.Merging Data: The component intelligently decides which data to display. If the WebSocket is connected and has sent data, it uses that live data. If not, it falls back to the useQuery batch data.&lt;/p&gt;

&lt;p&gt;Here's the key logic from TopPicks.jsx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In TopPicks.jsx...
import { useWebSocket } from '../context/WebSocketContext';
import { useQuery } from '@tanstack/react-query';

// ...

const { topPicks: wsTopPicks, realtimeData } = useWebSocket();
const { data: batchData, isLoading } = useQuery(
    'topPicksBatch', 
    () =&amp;gt; fetchTopPicksBatch(token),
    { enabled: wsTopPicks.length === 0 } // Only run if WS isn't ready
);

// Source of Truth: Prefer live data, fall back to batch API data
const sourceData = wsTopPicks.length &amp;gt; 0 ? wsTopPicks : (batchData?.picks || []);

// Combine with real-time price ticks
const rankedStocks = sourceData.map(stock =&amp;gt; {
    const realtime = realtimeData[stock.symbol] || {};
    return {
        ...stock,
        latestPrice: realtime.price || stock.latestPrice,
        signal: realtime.signal || stock.signal, // Live signal!
    };
}).sort((a, b) =&amp;gt; b.trendingScore - a.trendingScore);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern makes the app feel incredibly fast and resilient. It loads instantly and provides live-tick updates without complex state management. For simpler data, like the WatchlistPage.jsx, I just use useQuery for a standard, cached fetch.&lt;/p&gt;

&lt;p&gt;Polishing the UI: To make the app feel modern, I used Tailwind CSS for all styling and Framer Motion to add subtle, satisfying animations, like the card load-in effect on the Top Picks page.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Building this app was a fantastic journey into combining data-driven backend logic with a high-performance, real-time frontend. The core challenge—merging historical analysis with live data—was solved by the hybrid useQuery/WebSocket pattern. The signalService.js was my first real attempt at codifying trading logic, and the ws library proved to be a simple yet powerful tool for the real-time layer.&lt;/p&gt;

&lt;p&gt;This architecture provides a scalable and responsive foundation, and I'm excited to continue refining the signal algorithms.&lt;/p&gt;

&lt;p&gt;Thanks for reading! I hope this deep-dive was useful. What real-time data challenges are you tackling?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How I built a Stock Suggestion app using React + node.js + free APIs ?</title>
      <dc:creator>Aashutosh Bairagi</dc:creator>
      <pubDate>Mon, 10 Nov 2025 17:43:06 +0000</pubDate>
      <link>https://dev.to/aashutosh_bairagi_31/how-i-built-a-stock-suggestion-app-using-react-nodejs-free-apis--2bn9</link>
      <guid>https://dev.to/aashutosh_bairagi_31/how-i-built-a-stock-suggestion-app-using-react-nodejs-free-apis--2bn9</guid>
      <description>&lt;p&gt;&lt;a href="https://stock-suggestion-application.vercel.app/" rel="noopener noreferrer"&gt;Application Link &lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;This is How I Built a Real-Time Stock Suggestion App with the MERN Stack, WebSockets, and Algorithmic Trading Logic!&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Finance and tech are converging faster than ever. As developers, we have the tools to build incredibly powerful applications that demystify market data. I set out to do just that: build a full-stack web application that not only tracks stock data but also provides actionable, AI-driven suggestions in real-time.&lt;/p&gt;

&lt;p&gt;This article is a technical deep-dive into the architecture and key features of my Stock Suggestion App. We'll cover the "AI" backend, the real-time WebSocket layer, and how it all connects to a resilient React frontend.&lt;/p&gt;

&lt;p&gt;The Tech Stack 🥞&lt;/p&gt;

&lt;p&gt;1.Frontend: React 18, Vite, React Router 7, Tailwind CSS, Framer Motion.&lt;/p&gt;

&lt;p&gt;2.State Management: @tanstack/react-query (for server state) &amp;amp; React                    Context (for auth/theme).&lt;/p&gt;

&lt;p&gt;3.Backend: Node.js, Express, Mongoose (MongoDB).&lt;/p&gt;

&lt;p&gt;4.Real-time Layer: ws (WebSocketServer).&lt;/p&gt;

&lt;p&gt;5.Authentication: Passport.js.&lt;/p&gt;

&lt;p&gt;6.Charting: lightweight-charts &amp;amp; recharts.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Architecture: A Three-Layered Approach&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The app is broken down into three core components: the "AI" Signal Service, the Real-time Data Hub, and the Reactive Frontend.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The "Brain": Algorithmic Signal Generation
&lt;/h2&gt;

&lt;p&gt;The term "AI" gets thrown around a lot. In this project, it refers to a dedicated backend service (signalService.js) that runs technical analysis on historical stock data to generate actionable insights.&lt;/p&gt;

&lt;p&gt;It calculates several key Technical Indicators (TIs):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple Moving Average (SMA): I calculate both the 50-day and 200-day SMAs to identify long-term trends.&lt;/li&gt;
&lt;li&gt;Relative Strength Index (RSI): A proxy calculation to determine if a stock is overbought or oversold.&lt;/li&gt;
&lt;li&gt;Moving Average Convergence Divergence (MACD): A proxy to gauge momentum by comparing short-term and long-term averages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These indicators are fed into two key functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;determineSignal(latestData): This function applies a rules-based logic (e.g., "if RSI &amp;lt; 30 and MACD &amp;gt; 0, signal 'Strong Buy'") to provide a clear BUY, SELL, or HOLD recommendation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;calculateTrendingScore(latestData): This is the secret sauce for the "Top Picks" page. It generates a proprietary score from 0-100 based on a weighted average of momentum, RSI strength, and long-term trend confirmation (e.g., is the price above its 200-day SMA?).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. The "Heartbeat": Real-Time with WebSockets
&lt;/h2&gt;

&lt;p&gt;A stock app without real-time data feels static. I used the ws library to build a lightweight WebSocket server that integrates directly with the main Express API.&lt;/p&gt;

&lt;p&gt;On the Backend (server.js): Instead of running a separate server, I attach the WebSocketServer to the same HTTP server instance that Express uses. This is efficient and simplifies deployment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In server.js...
import { WebSocketServer } from 'ws';
import { handleConnection } from './core/websocket.js';

// ... after mongoose connects ...
const server = app.listen(process.env.PORT || 5000, /* ... */);

// --- 2. INITIALIZE THE *NEW* WEBSOCKET SERVER ---
const wss = new WebSocketServer({ server }); // Attach to the Express server

wss.on('connection', (ws) =&amp;gt; {
    handleConnection(ws); // Delegate logic to a separate module
});

console.log("✅ Real-time WebSocket service initialized...");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This handleConnection module is responsible for managing connected clients and, crucially, broadcasting real-time price and signal updates as they happen.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The "Face": A Resilient React Frontend
&lt;/h2&gt;

&lt;p&gt;The frontend's main challenge is managing data from two sources: a traditional REST API (for historical data, watchlist) and a WebSocket (for live updates).&lt;/p&gt;

&lt;p&gt;The Hybrid Data-Fetching Pattern: I landed on a powerful hybrid pattern using Tanstack Query (React Query) and a WebSocketContext. The TopPicks.jsx page is the best example of this.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Initial Load (HTTP): The page first uses useQuery to fetch the pre-calculated list of top picks from the /api/stocks/top-picks REST endpoint. This gives the user instant, cached data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Live Updates (WebSocket): Simultaneously, useWebSocket() (from my custom context) is connected. It listens for live "tick" messages from the server.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.Merging Data: The component intelligently decides which data to display. If the WebSocket is connected and has sent data, it uses that live data. If not, it falls back to the useQuery batch data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// In TopPicks.jsx...
import { useWebSocket } from '../context/WebSocketContext';
import { useQuery } from '@tanstack/react-query';

// ...

const { topPicks: wsTopPicks, realtimeData } = useWebSocket();
const { data: batchData, isLoading } = useQuery(
    'topPicksBatch', 
    () =&amp;gt; fetchTopPicksBatch(token),
    { enabled: wsTopPicks.length === 0 } // Only run if WS isn't ready
);

// Source of Truth: Prefer live data, fall back to batch API data
const sourceData = wsTopPicks.length &amp;gt; 0 ? wsTopPicks : (batchData?.picks || []);

// Combine with real-time price ticks
const rankedStocks = sourceData.map(stock =&amp;gt; {
    const realtime = realtimeData[stock.symbol] || {};
    return {
        ...stock,
        latestPrice: realtime.price || stock.latestPrice,
        signal: realtime.signal || stock.signal, // Live signal!
    };
}).sort((a, b) =&amp;gt; b.trendingScore - a.trendingScore);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern makes the app feel incredibly fast and resilient. It loads instantly and provides live-tick updates without complex state management. For simpler data, like the WatchlistPage.jsx, I just use useQuery for a standard, cached fetch.&lt;/p&gt;

&lt;p&gt;Polishing the UI: To make the app feel modern, I used Tailwind CSS for all styling and Framer Motion to add subtle, satisfying animations, like the card load-in effect on the Top Picks page.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Building this app was a fantastic journey into combining data-driven backend logic with a high-performance, real-time frontend. The core challenge—merging historical analysis with live data—was solved by the hybrid useQuery/WebSocket pattern. The signalService.js was my first real attempt at codifying trading logic, and the ws library proved to be a simple yet powerful tool for the real-time layer.&lt;/p&gt;

&lt;p&gt;This architecture provides a scalable and responsive foundation, and I'm excited to continue refining the signal algorithms.&lt;/p&gt;

&lt;p&gt;Thanks for reading! I hope this deep-dive was useful. What real-time data challenges are you tackling?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>mern</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
