<?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: Tabrez Ahmed</title>
    <description>The latest articles on DEV Community by Tabrez Ahmed (@seucra).</description>
    <link>https://dev.to/seucra</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%2F3844957%2F9a0d7eb3-d14b-42a1-8a09-2a818c591780.jpg</url>
      <title>DEV Community: Tabrez Ahmed</title>
      <link>https://dev.to/seucra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/seucra"/>
    <language>en</language>
    <item>
      <title>Publishing My First Rust npm Package (@seucra/matrix-sdk-bridge)</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Fri, 14 Aug 2026 14:20:36 +0000</pubDate>
      <link>https://dev.to/seucra/publishing-my-first-rust-npm-package-seucramatrix-sdk-bridge-21mb</link>
      <guid>https://dev.to/seucra/publishing-my-first-rust-npm-package-seucramatrix-sdk-bridge-21mb</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Publishing a package to npm is a common milestone for JavaScript developers. However, publishing an npm package &lt;strong&gt;written in Rust and compiled to WebAssembly&lt;/strong&gt; introduces a completely different set of tooling, cross-compilation target considerations, and TypeScript definition generation.&lt;/p&gt;

&lt;p&gt;Recently, I published &lt;a href="https://www.npmjs.com/package/@seucra/matrix-sdk-bridge" rel="noopener noreferrer"&gt;&lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt;&lt;/a&gt;—the extracted WebAssembly wrapper around &lt;code&gt;matrix-sdk&lt;/code&gt; used by Vigilant. &lt;/p&gt;

&lt;p&gt;This post documents the exact workflow, build scripts, pitfalls, and lessons learned during the publishing process.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tooling Stack
&lt;/h2&gt;

&lt;p&gt;To build and package Rust code for WebAssembly, I used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;wasm-pack&lt;/code&gt;&lt;/strong&gt;: The official CLI tool for building and packaging Rust-generated WebAssembly for npm.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;wasm-bindgen&lt;/code&gt;&lt;/strong&gt;: The core library facilitating high-level interactions between Rust and JavaScript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript&lt;/strong&gt;: Auto-generated &lt;code&gt;.d.ts&lt;/code&gt; definition files ensuring strong typing for JS consumers.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────────┐     wasm-pack build     ┌────────────────────────┐
│  Rust Source │ ───────────────────────►│  WebAssembly Binary    │
│  (src/lib.rs)│   --target web          │  (.wasm + .js + .d.ts) │
└──────────────┘                         └───────────┬────────────┘
                                                     │
                                                     │ npm publish
                                                     ▼
                                         ┌────────────────────────┐
                                         │ npm Registry Package   │
                                         │ @seucra/matrix-sdk-b.. │
                                         └────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step-by-Step Publishing Workflow
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Configuring &lt;code&gt;Cargo.toml&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The Rust crate must be configured as a dynamic system library (&lt;code&gt;cdylib&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[package]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"matrix-sdk-bridge"&lt;/span&gt;
&lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.1.0"&lt;/span&gt;
&lt;span class="py"&gt;edition&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"2021"&lt;/span&gt;

&lt;span class="nn"&gt;[lib]&lt;/span&gt;
&lt;span class="py"&gt;crate-type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"cdylib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"rlib"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nn"&gt;[dependencies]&lt;/span&gt;
&lt;span class="py"&gt;wasm-bindgen&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.2"&lt;/span&gt;
&lt;span class="py"&gt;wasm-bindgen-futures&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.4"&lt;/span&gt;
&lt;span class="py"&gt;matrix-sdk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.7"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;default-features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"e2e-encryption"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="py"&gt;serde&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"1.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="py"&gt;features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"derive"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="py"&gt;serde-wasm-bindgen&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.6"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Building for Web Targets
&lt;/h3&gt;

&lt;p&gt;Building the compiled WASM artifacts for browser environments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wasm-pack build &lt;span class="nt"&gt;--target&lt;/span&gt; web &lt;span class="nt"&gt;--scope&lt;/span&gt; seucra
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This generates a &lt;code&gt;pkg/&lt;/code&gt; folder containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;matrix_sdk_bridge_bg.wasm&lt;/code&gt;: The compiled WebAssembly bytecode.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;matrix_sdk_bridge.js&lt;/code&gt;: The JS glue code initializing and exposing WASM functions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;matrix_sdk_bridge.d.ts&lt;/code&gt;: TypeScript typings for all &lt;code&gt;#[wasm_bindgen]&lt;/code&gt; functions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;package.json&lt;/code&gt;: Configured package manifest under scope &lt;code&gt;@seucra&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Publishing to npm
&lt;/h3&gt;

&lt;p&gt;After logging in with &lt;code&gt;npm login&lt;/code&gt;, publishing the scoped package:&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;pkg
npm publish &lt;span class="nt"&gt;--access&lt;/span&gt; public
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Lessons &amp;amp; Gotchas
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Target Selection (&lt;code&gt;--target web&lt;/code&gt; vs &lt;code&gt;--target bundler&lt;/code&gt;)&lt;/strong&gt;:
&lt;code&gt;--target web&lt;/code&gt; generates ES module outputs using native &lt;code&gt;fetch()&lt;/code&gt; to load &lt;code&gt;.wasm&lt;/code&gt; files. This avoids complex Webpack/Vite loader configurations for consumers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript Generation is Automatic&lt;/strong&gt;:
&lt;code&gt;wasm-bindgen&lt;/code&gt; automatically generates TypeScript &lt;code&gt;.d.ts&lt;/code&gt; files for annotated Rust structs and functions. Ensuring Rust doc comments are clean means your published npm package gets instant IntelliSense documentation!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate Builds with Scripts&lt;/strong&gt;:
Always script your build and test flow to prevent publishing stale WASM binaries.&lt;/li&gt;
&lt;/ol&gt;




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

&lt;p&gt;Publishing &lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt; was a major milestone in my Rust learning journey. It proved that Rust and WebAssembly can bridge the gap between low-level systems programming and modern browser applications seamlessly.&lt;/p&gt;

</description>
      <category>seucra</category>
      <category>npm</category>
      <category>rust</category>
    </item>
    <item>
      <title>Extracting Matrix SDK into a Rust WASM Library</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Fri, 14 Aug 2026 14:19:55 +0000</pubDate>
      <link>https://dev.to/seucra/extracting-matrix-sdk-into-a-rust-wasm-library-2mko</link>
      <guid>https://dev.to/seucra/extracting-matrix-sdk-into-a-rust-wasm-library-2mko</guid>
      <description>&lt;h2&gt;
  
  
  The Monolith Problem in Early Prototypes
&lt;/h2&gt;

&lt;p&gt;When building an ambitious application, it is tempting to put all code into a single repository. In early iterations of &lt;strong&gt;Vigilant&lt;/strong&gt;, the Rust Matrix SDK integration was tightly coupled with application-specific state handlers and UI glue code. &lt;/p&gt;

&lt;p&gt;As the project grew, this coupling created several friction points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Testing the Matrix SDK integration independently from application UI state was difficult.&lt;/li&gt;
&lt;li&gt;Changes to the frontend interface required touching deep backend Matrix sync loops.&lt;/li&gt;
&lt;li&gt;Reusing the Matrix integration in another web client or tool was impossible without copy-pasting code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I realized that Matrix client integration is fundamentally an independent concern. That realization led to extracting the Rust integration code into a standalone, reusable library: &lt;strong&gt;&lt;code&gt;matrix-sdk-bridge&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why WebAssembly for Matrix Client Logic?
&lt;/h2&gt;

&lt;p&gt;The Matrix client ecosystem has robust native implementations, with &lt;a href="https://github.com/matrix-org/matrix-rust-sdk" rel="noopener noreferrer"&gt;&lt;code&gt;matrix-sdk&lt;/code&gt;&lt;/a&gt; in Rust being one of the most active and feature-complete SDKs available.&lt;/p&gt;

&lt;p&gt;By compiling Rust to WebAssembly target &lt;code&gt;wasm32-unknown-unknown&lt;/code&gt; via &lt;code&gt;wasm-bindgen&lt;/code&gt;, we get several advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Memory Safety &amp;amp; Correctness&lt;/strong&gt;: Rust's type system ensures data race safety, strict lifetime checks, and zero-cost abstractions inside the browser environment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upstream Alignment&lt;/strong&gt;: We leverage official, audited Matrix Rust SDK crates directly rather than reimplementing protocol handling in JavaScript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clean Architectural Boundary&lt;/strong&gt;: WebAssembly exposes a clear ABI (Application Binary Interface). JavaScript handles UI rendering while WebAssembly handles protocol state, cryptographic sessions, and timeline synchronization.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Designing the WASM Bridge Interface
&lt;/h2&gt;

&lt;p&gt;Bridging Rust async types (&lt;code&gt;Future&lt;/code&gt;, &lt;code&gt;Stream&lt;/code&gt;, &lt;code&gt;tokio&lt;/code&gt;/&lt;code&gt;wasm-bindgen-futures&lt;/code&gt;) to JavaScript promises requires careful API design.&lt;/p&gt;

&lt;p&gt;Here is a simplified architectural view of how data flows across the WASM boundary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌───────────────────────────────────────┐
│     JavaScript Application / UI       │
└───────────────────┬───────────────────┘
                    │  call async WASM methods (e.g. client.login())
                    ▼
┌───────────────────────────────────────┐
│     wasm-bindgen Export Layer         │
│  - JsValue serialization              │
│  - Future -&amp;gt; Promise conversion       │
└───────────────────┬───────────────────┘
                    │  Rust async calls
                    ▼
┌───────────────────────────────────────┐
│       matrix-sdk (Rust Crates)        │
│  - Room handling                      │
│  - Sync loops                         │
│  - Session state                      │
└───────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Design Principles:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hide Upstream Complexity&lt;/strong&gt;: Upstream &lt;code&gt;matrix-sdk&lt;/code&gt; exposes dozens of types (&lt;code&gt;Client&lt;/code&gt;, &lt;code&gt;Room&lt;/code&gt;, &lt;code&gt;Timeline&lt;/code&gt;, &lt;code&gt;SyncResponse&lt;/code&gt;). The bridge packages these into high-level, serializable JS structures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explicit Event Passing&lt;/strong&gt;: Matrix live sync updates are passed across the WASM boundary using JS callbacks or event dispatchers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graceful Error Handling&lt;/strong&gt;: Rust &lt;code&gt;Result&amp;lt;T, E&amp;gt;&lt;/code&gt; types are converted to structured JavaScript errors rather than panicking inside the WebAssembly module.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Decoupling Accelerates Iteration&lt;/strong&gt;: Once &lt;code&gt;matrix-sdk-bridge&lt;/code&gt; was extracted, developing the frontend became significantly cleaner. The frontend team can mock or consume WASM methods without needing to touch Rust code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WASM Memory Management Matters&lt;/strong&gt;: Passing large byte arrays or string structures continuously across the JS/WASM boundary can introduce garbage collection overhead. Using lightweight JSON or typed array structures minimizes serialization overhead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat Internal Tooling as Open Source&lt;/strong&gt;: Even if a library starts as part of an internal project, structuring it like an open-source package forces cleaner abstractions, better documentation, and higher code quality.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the next post, I will share the process of packaging this Rust WebAssembly bridge and publishing it to npm as &lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>softwaredevelopment</category>
      <category>softwareengineering</category>
      <category>webassembly</category>
    </item>
    <item>
      <title>Building Vigilant — Cycle 1 Complete</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Fri, 07 Aug 2026 15:09:06 +0000</pubDate>
      <link>https://dev.to/seucra/building-vigilant-cycle-1-complete-o7m</link>
      <guid>https://dev.to/seucra/building-vigilant-cycle-1-complete-o7m</guid>
      <description>&lt;p&gt;_&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Reflections on finishing Cycle 1 of Vigilant's backend, adopting Matrix Synapse, and choosing architectural focus over protocol reinvention.&lt;/em&gt;&lt;br&gt;
_&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Building a modern secure communication application is one of the most effective ways to understand backend systems. However, it is also a project where it is easy to get lost in the wrong problem.&lt;/p&gt;

&lt;p&gt;When I first conceived &lt;strong&gt;CipherLink&lt;/strong&gt;—the project that eventually evolved into &lt;strong&gt;Vigilant&lt;/strong&gt;—my goal was simple: write a complete messaging application from scratch, including the protocol, authentication, server storage, and encryption. &lt;/p&gt;

&lt;p&gt;It did not take long to realize that building a custom protocol from scratch is a massive undertaking. Designing key management, device synchronization, offline message delivery, and federation requires years of protocol engineering and security auditing. Attempting to build all of that alone meant spending 90% of my time reinventing established cryptography and messaging infrastructure, leaving almost no time for application architecture, backend robustness, or client integration.&lt;/p&gt;

&lt;p&gt;Near the end of B.Tech Semester 4, I made a major architectural pivot: &lt;strong&gt;adopt the open Matrix protocol, build on top of Matrix Synapse, and implement the application logic in Rust compiled to WebAssembly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Cycle 1 of Vigilant’s backend now complete&lt;/strong&gt;, this post reflects on what was accomplished, why this architecture was chosen, and what I learned along the way.&lt;/p&gt;


&lt;h2&gt;
  
  
  What is Vigilant?
&lt;/h2&gt;

&lt;p&gt;Vigilant is a secure communication platform built on top of the Matrix ecosystem. &lt;/p&gt;

&lt;p&gt;Rather than treating Matrix as just a third-party API, Vigilant uses a self-hosted Matrix stack (Synapse, PostgreSQL, MinIO, Nginx) as its underlying persistence and synchronization engine, while relying on a custom Rust backend and WebAssembly bridge for client state, authentication, room management, and timeline handling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────────┐
│                   Vigilant Frontend                    │
└───────────────────────────┬────────────────────────────┘
                            │ (TypeScript / JS)
                            ▼
┌────────────────────────────────────────────────────────┐
│            @seucra/matrix-sdk-bridge (WASM)            │
└───────────────────────────┬────────────────────────────┘
                            │ (Rust matrix-sdk)
                            ▼
┌────────────────────────────────────────────────────────┐
│                 Matrix Synapse Engine                  │
│       ┌──────────────┐          ┌──────────────┐       │
│       │  PostgreSQL  │          │    MinIO     │       │
│       └──────────────┘          └──────────────┘       │
└────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Cycle 1 Accomplishments
&lt;/h2&gt;

&lt;p&gt;During Cycle 1, the primary objective was establishing a rock-solid backend foundation that could reliably interact with Matrix Synapse. &lt;/p&gt;

&lt;p&gt;Key backend milestones completed in Cycle 1:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Authentication &amp;amp; Session Persistence&lt;/strong&gt;: Implementing login, registration, homeserver discovery, and secure token storage across page reloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Room Management &amp;amp; Discovery&lt;/strong&gt;: Joining public rooms, creating direct message channels, and mapping Matrix room states to application views.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timeline Loading &amp;amp; Message History&lt;/strong&gt;: Fetching room timelines, listening to live sync events, and handling message pagination tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WASM Bridge Extraction&lt;/strong&gt;: Separating the Rust integration logic into a standalone library published as &lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt; on npm.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Key Lessons &amp;amp; Architectural Trade-offs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Build on Proven Standards
&lt;/h3&gt;

&lt;p&gt;Choosing Matrix over a custom protocol was the single best decision in this project. It shifted my effort from &lt;em&gt;reinventing the wheel&lt;/em&gt; to &lt;em&gt;learning how real distributed communication engines work&lt;/em&gt;. Matrix Synapse handles event graph ordering, federation, and persistence, allowing me to focus on Rust async state management and client integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Rust for Client Integration
&lt;/h3&gt;

&lt;p&gt;Writing the core logic in Rust using &lt;code&gt;matrix-sdk&lt;/code&gt; provided strong memory safety guarantees and compile-time correctness. Upstream Matrix SDK updates can be integrated directly, and compiling to WebAssembly (&lt;code&gt;wasm32-unknown-unknown&lt;/code&gt;) ensures high performance in the browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Read Upstream Source Code
&lt;/h3&gt;

&lt;p&gt;Documentation for emerging SDKs is often sparse. I frequently had to dive directly into the Rust &lt;code&gt;matrix-sdk&lt;/code&gt; source code to understand event handlers, sync loops, and sliding sync behaviors. Reading primary source code is a muscle every backend engineer must develop.&lt;/p&gt;




&lt;h2&gt;
  
  
  What’s Next for Cycle 2
&lt;/h2&gt;

&lt;p&gt;Now that Cycle 1 backend milestones are solid, the focus shifts toward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Refining frontend integration with my project collaborator.&lt;/li&gt;
&lt;li&gt;Hardening timeline pagination and offline event caching.&lt;/li&gt;
&lt;li&gt;Expanding documentation and integration tests for &lt;code&gt;@seucra/matrix-sdk-bridge&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Building Vigilant has proven that engineering depth comes from understanding system boundaries, making deliberate trade-offs, and shipping defensible work.&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Links :
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/seucra/vigilant/" rel="noopener noreferrer"&gt;project repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://seucra.tech/" rel="noopener noreferrer"&gt;main site / portfolio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://journal.seucra.tech/" rel="noopener noreferrer"&gt;personal journal&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Concurrency in Python: Solving the Dining Philosophers Problem</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Sun, 19 Apr 2026 17:26:11 +0000</pubDate>
      <link>https://dev.to/seucra/concurrency-in-python-solving-the-dining-philosophers-problem-6ao</link>
      <guid>https://dev.to/seucra/concurrency-in-python-solving-the-dining-philosophers-problem-6ao</guid>
      <description>&lt;p&gt;If you are writing multithreaded applications, you are going to run into deadlocks. There’s no avoiding it. To understand how to fix them, you need to understand the Dining Philosophers problem.&lt;/p&gt;

&lt;p&gt;Five philosophers sit at a round table. There are five forks. To eat, a philosopher needs the fork on their left and the fork on their right. If everyone grabs their left fork at the exact same time, they all wait forever for the right fork. Deadlock.&lt;/p&gt;

&lt;p&gt;In this series, my team and I will break down how we built a visual simulator for this problem in Python. For part one, we are looking at the core mechanics and Dijkstra’s Resource Hierarchy solution.&lt;br&gt;
The Setup&lt;/p&gt;

&lt;p&gt;We want raw execution without third-party bloat, so we rely entirely on Python's standard threading library. Each philosopher is a daemon thread, and each fork is a threading.Lock.&lt;br&gt;
Python&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;threading&lt;/span&gt;

&lt;span class="n"&gt;NUM_PHILOSOPHERS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;forks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;threading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NUM_PHILOSOPHERS&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we just wrote forks[left].acquire() followed by forks[right].acquire(), the script would eventually freeze.&lt;br&gt;
The Solution: Resource Hierarchy&lt;/p&gt;

&lt;p&gt;To break the circular wait, we assign a hierarchy to the resources (forks). Instead of "grab left, then right," the rule becomes "grab the lower-numbered fork first, then the higher-numbered one."&lt;/p&gt;

&lt;p&gt;Here is how that logic looks in our simulation loop:&lt;br&gt;
Python&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_cycle_resource_hierarchy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Determine fork indices
&lt;/span&gt;    &lt;span class="n"&gt;left&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;NUM_PHILOSOPHERS&lt;/span&gt;
    &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;

    &lt;span class="c1"&gt;# Establish hierarchy
&lt;/span&gt;    &lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Acquire in strict order
&lt;/span&gt;    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;acquire&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;acquire&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;# CRITICAL SECTION: Eating
&lt;/span&gt;    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uniform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="c1"&gt;# Release locks
&lt;/span&gt;    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;release&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;forks&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;release&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the last philosopher (index 4) sits next to the first fork (index 0), they will try to grab fork 0 first, while philosopher 0 is also trying to grab fork 0 first. The cycle is broken. Someone gets blocked, allowing someone else to eat.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>My First Week Learning Offensive Security (Before Hitting the Paywall)</title>
      <dc:creator>Tabrez Ahmed</dc:creator>
      <pubDate>Sun, 05 Apr 2026 12:06:17 +0000</pubDate>
      <link>https://dev.to/seucra/my-first-week-learning-offensive-security-before-hitting-the-paywall-3g55</link>
      <guid>https://dev.to/seucra/my-first-week-learning-offensive-security-before-hitting-the-paywall-3g55</guid>
      <description>&lt;p&gt;I started learning red team fundamentals on TryHackMe. Here's what I learned before running into premium content limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Day 1: Red Team Basics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What offensive security actually means&lt;/li&gt;
&lt;li&gt;Learned about dirb tool for directory brute-forcing&lt;/li&gt;
&lt;li&gt;[Explain what dirb does and why it's useful]&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Day 2: Blue Team Perspective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Defense in depth concept&lt;/li&gt;
&lt;li&gt;SOC analyst role&lt;/li&gt;
&lt;li&gt;What SIEM tools do&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Day 3: Research Skills
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How to find CVEs and exploits&lt;/li&gt;
&lt;li&gt;Tools: Shodan, Censys, VirusTotal&lt;/li&gt;
&lt;li&gt;GitHub for exploit code&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Day 4: Linux Fundamentals
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Commands I learned: ls, cd, cat, grep&lt;/li&gt;
&lt;li&gt;Operators: &amp;amp;&amp;amp;, &amp;gt;, |&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Paywall Problem
&lt;/h2&gt;

&lt;p&gt;TryHackMe's free tier is limited. Switching to OverTheWire (completely free) to continue learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next Week
&lt;/h2&gt;

&lt;p&gt;Starting OverTheWire Bandit challenges. Goal: Complete levels 0-10.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
