<?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[Adnan's Blog]]></title><description><![CDATA[Adnan's Blog]]></description><link>https://blogadnan.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 02:56:06 GMT</lastBuildDate><atom:link href="https://blogadnan.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[System Design of SortStory: Next.js 16, Custom Telemetry, and AI-Driven Education
tags: nextjs, architecture, typescript, supabase, system-design]]></title><description><![CDATA[When building an educational platform capable of rendering real-time algorithm visualizations at 60fps while simultaneously managing multi-language code synchronization, standard web architectures qui]]></description><link>https://blogadnan.hashnode.dev/sortstory-dsa-visualizers-adnan-mangaonkar</link><guid isPermaLink="true">https://blogadnan.hashnode.dev/sortstory-dsa-visualizers-adnan-mangaonkar</guid><category><![CDATA[software development]]></category><category><![CDATA[DSA]]></category><category><![CDATA[data visualization]]></category><category><![CDATA[datastructuresandalogrithm]]></category><category><![CDATA[algorithms]]></category><dc:creator><![CDATA[Adnan Mangaonkar]]></dc:creator><pubDate>Thu, 30 Jul 2026 17:47:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/640f0ed5c4be0b60977c1743/ff62566a-ccd8-4aa0-83c8-31fdd177eb38.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When building an educational platform capable of rendering real-time algorithm visualizations at 60fps while simultaneously managing multi-language code synchronization, standard web architectures quickly show their limits.</p>
<p>I recently launched SortStory, a platform designed to share computer science knowledge through interactive 3D/glassmorphism visualizers. Today, I want to pull back the curtain for the engineering community and share the system architecture, tech stack, and design decisions that power the platform.</p>
<p><strong>The Core Technology Stack</strong></p>
<p>SortStory is built on a modern, edge-ready foundation designed for speed and SEO optimization:</p>
<p>Framework: Next.js 16 (App Router + Turbopack) for SSR, SSG, and optimized API routes.</p>
<p>Language: Strict TypeScript.</p>
<p>Styling &amp; Animation: Tailwind CSS with custom Vanilla CSS for glassmorphism tokens, paired with Framer Motion for highly performant UI transitions.</p>
<p>Database: PostgreSQL via Supabase, utilizing strict Row Level Security (RLS).</p>
<p><strong>Managing High-Frequency State Without Bloat</strong></p>
<p>A major challenge was managing the global state for the Multi-Stack Code Engine. SortStory supports 7 languages (Python, JS, TS, C++, Java, Rust, Go).</p>
<p>Instead of reaching for heavy global state libraries, I architected a lightweight LanguageContext tied to browser localStorage. When a user toggles a language in the header, the Context updates globally, instantly re-rendering all code blocks across the 9 learning modules without causing unnecessary repaints in the heavy Visualizer Canvas.</p>
<p>Similarly, an AuthContext dynamically governs site access modes (free_all, free_students, gated), allowing me to toggle paywalls and code-gates via the database without redeploying the application.</p>
<p><strong>Telemetry and AI Predictive Intelligence</strong></p>
<p>To ensure the platform actually serves the educational needs of its users, I built a two-tier analytics engine:</p>
<p>PostHog Product Analytics: Tracks user retention, feature flags, and session replays.</p>
<p>Custom Clickstream &amp; AI Engine: A custom useSiteAnalyticsTracker hook listens to every route change and button click.</p>
<p>This telemetry data is piped into an AI Predictive Weakness Model. The AI calculates a 0–100 "weakness score" for each of the site's modules based on traffic and engagement drop-offs. It then surfaces actionable UI/UX recommendations to my Admin Console—for example, suggesting a new hero CTA for the Automata module if engagement dips.</p>
<p><strong>Database Architecture &amp; Isolation</strong></p>
<p>The backend relies on a shared PostgreSQL database. To maintain strict domain isolation, all SortStory tables utilize a sortstory_ prefix.</p>
<p>The schema includes:</p>
<p>sortstory_users &amp; sortstory_student_applications: For managing access and verifying academic credentials.</p>
<p>sortstory_access_codes: Enforces a strict 1-connection rule to prevent credential sharing on gated plans.</p>
<p>sortstory_site_analytics_events &amp; sortstory_site_module_insights: Stores the telemetry data and AI-generated module weakness scores.</p>
<p><strong>Technical SEO Integration</strong></p>
<p>Because education tools rely heavily on organic discovery, technical SEO was baked in from Day 1:</p>
<p>JSON-LD Schema: Injected WebSite and SiteNavigationElement schemas directly into the Next.js layout.tsx to encourage Google Sitelinks.</p>
<p>Dynamic Sitemaps: Utilizing the Next.js App Router sitemap.ts to map all 11 core routes dynamically with weighted priority scores.</p>
<p><strong>Explore the Platform</strong></p>
<p>Building SortStory has been an incredible journey in system design, performance tuning, and giving back to the developer community.</p>
<p>Experience the architecture live: sortstory.adnan-mangaonkar.com</p>
<p>About the Architect I am Adnan Mangaonkar, a software engineer dedicated to building scalable systems and empowering the next generation of tech talent.</p>
<p>🌐 Portfolio: adnan-mangaonkar.com</p>
<p>💼 Business: business.adnan-mangaonkar.com</p>
<p>I'd love to hear your thoughts on the architecture or how you handle state management for high-frequency renders in Next.js! Let's discuss in the comments.</p>
]]></content:encoded></item></channel></rss>