DEV Community

Anirudha Kalita
Anirudha Kalita

Posted on

How I Built a Privacy-First, Zero-Server Cost Social Media Feed Simulator in Astro

Hey dev community! šŸ‘‹

I recently noticed a major problem content writers face: writing beautiful social media posts, only to have the platform UI brutally slice their opening line behind an awkward ... more link.

To fix this workflow bottleneck, I built and launched PostTruncate.com.

šŸ—ļø The Architectural Philosophy: 100% Client-Side

I wanted the tool to be blistering fast and completely private. Copywriters paste proprietary ideas into these text boxes, so keeping data away from a traditional database server was rule #1.

Here is how the system handles the stack:

  1. Astro Framework: Serves static HTML modules instantly with a near-zero JS runtime footprint.
  2. Cloudflare Workers: Runs directly on the edge, routing global traffic with custom domain configurations instantly.
  3. Browser LocalStorage: All processing, keyword density analysis, and multi-post thread fragmenting execute completely inside the user's browser local cache.

🧮 Slicing Code Snippet (The Core Logic)

Here is a basic view of how our simulation arrays map platform folds without triggering multi-post chaining prematurely:

  • Instagram: Folds visually at 125 characters across devices.
  • Threads: Retains a 500 hard-cap, but folds on mobile viewports at roughly 250 characters.

šŸš€ Check It Out

The full project is completely live, completely free, and natively localised across 10 languages.

I’d love to hear your thoughts on optimisation or edge route structures:
šŸ‘‰ Live Site: PostTruncate.com
šŸ‘‰ GitHub Core Repo: [https://github.com/Anirudha-Kalita/PostTruncate.com]
main tool text editor

Socialmedia post preview

Top comments (0)