<?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: Mohammed Abdulatef</title>
    <description>The latest articles on DEV Community by Mohammed Abdulatef (@pwrst).</description>
    <link>https://dev.to/pwrst</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F300778%2Fef5c351b-4f68-4ca4-92fb-d2a9ddd96366.jpeg</url>
      <title>DEV Community: Mohammed Abdulatef</title>
      <link>https://dev.to/pwrst</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pwrst"/>
    <language>en</language>
    <item>
      <title>🖼️ Building a Dynamic OG Image Generator with Cloudflare Workers: Edge-Powered Social Cards Made Easy</title>
      <dc:creator>Mohammed Abdulatef</dc:creator>
      <pubDate>Thu, 23 Jan 2025 06:14:33 +0000</pubDate>
      <link>https://dev.to/pwrst/building-a-dynamic-og-image-generator-with-cloudflare-workers-edge-powered-social-cards-made-5eba</link>
      <guid>https://dev.to/pwrst/building-a-dynamic-og-image-generator-with-cloudflare-workers-edge-powered-social-cards-made-5eba</guid>
      <description>&lt;p&gt;👋 Hey DEV community!  &lt;/p&gt;

&lt;p&gt;I’m excited to share &lt;strong&gt;&lt;a href="https://github.com/mohdlatif/og-image-generator-cloudflare-worker" rel="noopener noreferrer"&gt;Dynamic OG Image Generator&lt;/a&gt;&lt;/strong&gt;, an open-source project I built to simplify generating &lt;strong&gt;dynamic Open Graph images&lt;/strong&gt; for blogs, apps, and social media. It leverages Cloudflare Workers’ edge network for blazing-fast performance, and I’d love your feedback (and a star ⭐)!  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;The Problem&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Social platforms like Twitter and LinkedIn rely on Open Graph images for rich link previews. But:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Static images get stale quickly
&lt;/li&gt;
&lt;li&gt;Dynamic solutions often require complex backends or paid services
&lt;/li&gt;
&lt;li&gt;Font/licensing issues can derail designs
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This project solves those pain points with &lt;strong&gt;edge computing&lt;/strong&gt; and &lt;strong&gt;flexible customization&lt;/strong&gt;.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Key Features&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✅ &lt;strong&gt;Edge-First Performance&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Runs on Cloudflare Workers’ global network, generating images in &amp;lt;100ms.  &lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;4 Visual Styles&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Pre-built templates for different use cases:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modern gradients
&lt;/li&gt;
&lt;li&gt;Eco/tech themes
&lt;/li&gt;
&lt;li&gt;Branded designs (e.g., Cloudflare)
&lt;/li&gt;
&lt;li&gt;GitHub-style profile cards
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ &lt;strong&gt;Font Loading Flexibility&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Choose your strategy without licensing headaches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Example: Load Google Fonts  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;googleFont&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Noto Sans JP&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;900&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;normal&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  

&lt;span class="c1"&gt;// Or self-host fonts via GitHub  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;githubFonts&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Automatic Caching&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Reduce compute costs by caching fonts and generated images:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Enable cache middleware  &lt;/span&gt;
&lt;span class="nx"&gt;og&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/og&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Tailwind CSS Integration&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Style cards with familiar utility classes for rapid iteration.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;How It Works&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Send a GET request with parameters:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   /og?mainText=Hello World&amp;amp;description=Edge-Powered OG Magic&amp;amp;style=1  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Get a &lt;strong&gt;1200x630px social-ready image&lt;/strong&gt; optimized for Twitter, LinkedIn, etc.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Sample Response&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.playbook.com%2FFqOr8WKk9_thMfSJmn7BTJMSogd3bnQSmKA9T-Nnf1w%2FZ3M6Ly9wbGF5Ym9v%2Fay1hc3NldHMtcHVi%2FbGljLzVhZWY3ZjE0%2FLWJlNTItNGU3Ny1h%2FY2ZlLWMyZTQ5ZTU1%2FZjIxYQ" 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%2Fimg.playbook.com%2FFqOr8WKk9_thMfSJmn7BTJMSogd3bnQSmKA9T-Nnf1w%2FZ3M6Ly9wbGF5Ym9v%2Fay1hc3NldHMtcHVi%2FbGljLzVhZWY3ZjE0%2FLWJlNTItNGU3Ny1h%2FY2ZlLWMyZTQ5ZTU1%2FZjIxYQ" alt="OG Image Example" width="800" height="420"&gt;&lt;/a&gt;  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Quickstart Guide&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Clone the repo:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone https://github.com/mohdlatif/og-image-generator-cloudflare-worker  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install dependencies (uses Bun 🚀):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   bun &lt;span class="nb"&gt;install&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Deploy to Cloudflare:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   bun run deploy  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a detailed walkthrough, check out my &lt;strong&gt;&lt;a href="https://developers.cloudflare.com/workers/tutorials/generate-dynamic-og-images-using-workers/" rel="noopener noreferrer"&gt;Cloudflare Workers tutorial&lt;/a&gt;&lt;/strong&gt;.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Why This Matters&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost-effective&lt;/strong&gt;: No need for dedicated image servers
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalable&lt;/strong&gt;: Workers handle spikes effortlessly
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable&lt;/strong&gt;: Add your own styles/fonts in minutes
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔗 &lt;strong&gt;GitHub Repo&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/mohdlatif/og-image-generator-cloudflare-worker" rel="noopener noreferrer"&gt;mohdlatif/og-image-generator-cloudflare-worker&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;If you find this useful:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;⭐ &lt;strong&gt;Star the repo&lt;/strong&gt; to help others discover it
&lt;/li&gt;
&lt;li&gt;💬 &lt;strong&gt;Share feedback&lt;/strong&gt; – I’d love to hear your use cases!
&lt;/li&gt;
&lt;li&gt;🛠️ &lt;strong&gt;Contribute&lt;/strong&gt;: PRs welcome for new styles, optimizations, or docs!
&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Let’s make dynamic OG images a solved problem for everyone! 🚀  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;P.S. Big thanks to the &lt;a href="https://hono.dev/" rel="noopener noreferrer"&gt;Hono&lt;/a&gt; and &lt;a href="https://vercel.com/docs/functions/og-image-generation" rel="noopener noreferrer"&gt;Vercel OG&lt;/a&gt; teams for their amazing tools!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>javascript</category>
    </item>
    <item>
      <title>EcoLedger: Rewarding Sustainable Actions</title>
      <dc:creator>Mohammed Abdulatef</dc:creator>
      <pubDate>Sun, 18 Aug 2024 16:33:49 +0000</pubDate>
      <link>https://dev.to/pwrst/ecoledger-rewarding-sustainable-actions-13g0</link>
      <guid>https://dev.to/pwrst/ecoledger-rewarding-sustainable-actions-13g0</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/stellar"&gt;Build Better on Stellar: Smart Contract Challenge &lt;/a&gt;: Build a dApp&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I developed EcoLedger, a sustainability tracking and rewards dApp designed to motivate individuals to adopt eco-friendly habits. EcoLedger allows users to log their sustainable actions, earn rewards, and visualize their collective impact on the environment. While I didn't fully integrate blockchain functionality due to time constraints, the app's core features are operational and demonstrate the potential for blockchain integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://green-chain-seven.vercel.app/" rel="noopener noreferrer"&gt;Demo&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/mohdlatif/GreenChain" rel="noopener noreferrer"&gt;Code&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Journey
&lt;/h2&gt;

&lt;p&gt;Developing EcoLedger has been an exhilarating experience that pushed me to explore new technologies and concepts. My motivation stemmed from the desire to create a tangible solution to encourage sustainable living. I wanted to bridge the gap between individual actions and their collective impact, making sustainability more engaging and rewarding.&lt;/p&gt;

&lt;p&gt;The implementation journey was both challenging and rewarding. I leveraged my experience with Astro.js and React to create a responsive and user-friendly interface. The core features I'm particularly proud of include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A intuitive system for logging sustainable actions&lt;/li&gt;
&lt;li&gt;A reward calculation mechanism based on user actions&lt;/li&gt;
&lt;li&gt;A community dashboard showcasing collective impact&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While I couldn't fully integrate blockchain functionality within the hackathon timeframe, this project has given me valuable insights into how blockchain can enhance transparency, security, and decentralization in sustainability tracking. I've learned a lot about the potential of smart contracts and tokenization in creating incentive systems.&lt;/p&gt;

&lt;p&gt;My experience with the Stellar ecosystem, although limited in this iteration, has been enlightening. The resources provided for the hackathon were comprehensive and helped me understand the basics of blockchain technology and its applications.&lt;/p&gt;

&lt;p&gt;Moving forward, I'm excited about the potential of EcoLedger. My next steps would be to fully integrate Stellar blockchain functionality, implement Soroban smart contracts for action logging and reward distribution, and create a custom token for the reward system. I also plan to enhance the AI-powered suggestions feature to provide more personalized sustainability goals.&lt;/p&gt;

&lt;p&gt;This hackathon has been a fantastic learning experience, pushing me to think creatively about how technology can address real-world sustainability challenges. I'm grateful for the opportunity and look forward to continuing my journey in blockchain development and sustainable tech solutions.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>stellarchallenge</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
