<?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>Forem: Amir</title>
    <description>The latest articles on Forem by Amir (@amirhossein_ln).</description>
    <link>https://forem.com/amirhossein_ln</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%2F3689048%2F4d50efba-90d8-44cd-b2f0-26c84756d7b0.png</url>
      <title>Forem: Amir</title>
      <link>https://forem.com/amirhossein_ln</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/amirhossein_ln"/>
    <language>en</language>
    <item>
      <title>Building a Structured Finance Tracker in Vanilla JavaScript (Without Frameworks)</title>
      <dc:creator>Amir</dc:creator>
      <pubDate>Wed, 11 Feb 2026 16:48:59 +0000</pubDate>
      <link>https://forem.com/amirhossein_ln/building-a-structured-finance-tracker-in-vanilla-javascript-without-frameworks-2aa2</link>
      <guid>https://forem.com/amirhossein_ln/building-a-structured-finance-tracker-in-vanilla-javascript-without-frameworks-2aa2</guid>
      <description>&lt;p&gt;Modern front-end development is heavily framework-driven.&lt;/p&gt;

&lt;p&gt;React, Vue, Angular — they give us structure, state management patterns, and predictable rendering out of the box.&lt;/p&gt;

&lt;p&gt;But I recently asked myself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What happens if you remove all of that?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not to avoid frameworks.&lt;br&gt;&lt;br&gt;
But to understand what they’re actually solving.&lt;/p&gt;

&lt;p&gt;So I built a personal project:&lt;/p&gt;

&lt;p&gt;An advanced personal finance tracker using &lt;strong&gt;pure Vanilla JavaScript&lt;/strong&gt; — no frameworks, no UI libraries, no charting libraries.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Real Goal Wasn't the UI
&lt;/h2&gt;

&lt;p&gt;Yes, the app includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Income and expense tracking
&lt;/li&gt;
&lt;li&gt;Dynamic filtering
&lt;/li&gt;
&lt;li&gt;Live search
&lt;/li&gt;
&lt;li&gt;Monthly grouping
&lt;/li&gt;
&lt;li&gt;CSV export
&lt;/li&gt;
&lt;li&gt;Dark/Light mode
&lt;/li&gt;
&lt;li&gt;Canvas-based chart visualization
&lt;/li&gt;
&lt;li&gt;LocalStorage persistence
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the real challenge was architectural:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do you prevent your application from becoming fragile as features grow?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Core Architectural Decisions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Centralized State Object
&lt;/h3&gt;

&lt;p&gt;All application data lives in a single &lt;code&gt;state&lt;/code&gt; object.&lt;/p&gt;

&lt;p&gt;Instead of mutating the DOM everywhere, state changes trigger rendering functions.&lt;/p&gt;

&lt;p&gt;This helped prevent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inconsistent UI updates
&lt;/li&gt;
&lt;li&gt;Scattered data mutations
&lt;/li&gt;
&lt;li&gt;Hard-to-track side effects
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. State-Driven Rendering
&lt;/h3&gt;

&lt;p&gt;Rather than updating isolated DOM fragments manually, rendering is driven by the current state.&lt;/p&gt;

&lt;p&gt;When state changes → render cycle runs → UI reflects state.&lt;/p&gt;

&lt;p&gt;This mirrors how modern frameworks operate internally.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Separation of Logic and Rendering
&lt;/h3&gt;

&lt;p&gt;Business logic (adding transactions, filtering, exporting, formatting) is kept separate from UI rendering.&lt;/p&gt;

&lt;p&gt;That separation made it easier to extend features without breaking existing functionality.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Canvas Without Chart Libraries
&lt;/h3&gt;

&lt;p&gt;The income vs expense chart is built directly using the &lt;strong&gt;Canvas API&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;No Chart.js.&lt;br&gt;&lt;br&gt;
No abstraction layer.&lt;/p&gt;

&lt;p&gt;That forced me to think about scaling, layout, and rendering math manually.&lt;/p&gt;




&lt;h2&gt;
  
  
  What This Reinforced for Me
&lt;/h2&gt;

&lt;p&gt;Frameworks are powerful.&lt;/p&gt;

&lt;p&gt;But understanding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State flow
&lt;/li&gt;
&lt;li&gt;Rendering cycles
&lt;/li&gt;
&lt;li&gt;Data mutations
&lt;/li&gt;
&lt;li&gt;UI synchronization
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;without relying on them builds real confidence.&lt;/p&gt;

&lt;p&gt;It also makes you appreciate what frameworks abstract away — and when they’re truly needed.&lt;/p&gt;




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

&lt;p&gt;Try the application here:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://amirhosseinln.github.io/advanced-finance-tracker/" rel="noopener noreferrer"&gt;https://amirhosseinln.github.io/advanced-finance-tracker/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source code:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/AmirhosseinLN/advanced-finance-tracker" rel="noopener noreferrer"&gt;https://github.com/AmirhosseinLN/advanced-finance-tracker&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Connect
&lt;/h2&gt;

&lt;p&gt;If you're interested in frontend architecture, state management, or UI engineering discussions, feel free to connect:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://www.linkedin.com/in/amirhossein-latifinavid-5923272a7/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/amirhossein-latifinavid-5923272a7/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Open Question
&lt;/h2&gt;

&lt;p&gt;For developers building vanilla projects:&lt;/p&gt;

&lt;p&gt;At what point do you introduce architectural patterns?&lt;/p&gt;

&lt;p&gt;Do you design for scale early — or let complexity drive abstraction?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'd genuinely appreciate feedback on the structure or UX decisions.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>frontend</category>
      <category>javascript</category>
      <category>learning</category>
    </item>
    <item>
      <title>I thought I knew JavaScript.</title>
      <dc:creator>Amir</dc:creator>
      <pubDate>Thu, 29 Jan 2026 13:05:45 +0000</pubDate>
      <link>https://forem.com/amirhossein_ln/i-thought-i-knew-javascript-4kpb</link>
      <guid>https://forem.com/amirhossein_ln/i-thought-i-knew-javascript-4kpb</guid>
      <description>&lt;p&gt;I had studied:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;arrays and objects&lt;/li&gt;
&lt;li&gt;loops and conditionals&lt;/li&gt;
&lt;li&gt;destructuring&lt;/li&gt;
&lt;li&gt;string methods&lt;/li&gt;
&lt;li&gt;even &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, &lt;code&gt;reduce&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But every time I opened a “simple” problem, my brain froze.&lt;/p&gt;

&lt;p&gt;Not because of syntax.&lt;br&gt;&lt;br&gt;
Because I didn’t know &lt;strong&gt;how to think&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The mistake I kept making
&lt;/h3&gt;

&lt;p&gt;I was asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What code should I write?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the &lt;strong&gt;input&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;What shape should the &lt;strong&gt;output&lt;/strong&gt; have?&lt;/li&gt;
&lt;li&gt;Am I &lt;strong&gt;counting&lt;/strong&gt;, &lt;strong&gt;grouping&lt;/strong&gt;, or &lt;strong&gt;transforming&lt;/strong&gt; data?&lt;/li&gt;
&lt;li&gt;Should the result be &lt;code&gt;{}&lt;/code&gt; or &lt;code&gt;[]&lt;/code&gt;?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That single question — &lt;code&gt;{}&lt;/code&gt; or &lt;code&gt;[]&lt;/code&gt; — blocked me more times than syntax errors ever did.&lt;/p&gt;

&lt;h3&gt;
  
  
  The moment things clicked
&lt;/h3&gt;

&lt;p&gt;I stopped rushing to write code.&lt;/p&gt;

&lt;p&gt;Before touching the keyboard, I started writing this in plain English:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“I need to group items by X”&lt;/li&gt;
&lt;li&gt;“I need to count how many times Y appears”&lt;/li&gt;
&lt;li&gt;“I need one value per key”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only then did loops, accumulators, and dynamic keys make sense.&lt;br&gt;
&lt;strong&gt;_What was the moment JavaScript finally “clicked” for you???&lt;br&gt;
_&lt;/strong&gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
js
const result = {};

for (const item of data) {
  const key = item.type;
  result[key] = (result[key] ?? 0) + 1;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>javascript</category>
      <category>learning</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Practicing JavaScript Data Structures Without map/filter/reduce</title>
      <dc:creator>Amir</dc:creator>
      <pubDate>Thu, 22 Jan 2026 16:44:54 +0000</pubDate>
      <link>https://forem.com/amirhossein_ln/practicing-javascript-data-structures-without-mapfilterreduce-h9h</link>
      <guid>https://forem.com/amirhossein_ln/practicing-javascript-data-structures-without-mapfilterreduce-h9h</guid>
      <description>&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.amazonaws.com%2Fuploads%2Farticles%2Fbd9ohi767vyyit964xqu.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.amazonaws.com%2Fuploads%2Farticles%2Fbd9ohi767vyyit964xqu.png" alt=" " width="800" height="854"&gt;&lt;/a&gt;&lt;br&gt;
_I’ve been practicing JavaScript data structures with a strict rule set:&lt;br&gt;
_   • no DOM&lt;br&gt;
    • no map, filter, or reduce&lt;br&gt;
    • only objects, arrays, loops, and conditionals&lt;/p&gt;

&lt;p&gt;The focus wasn’t syntax — it was learning how to think in data flow.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Exercise 1: Daily Store Report&lt;/p&gt;

&lt;p&gt;From a flat list of products, generate:&lt;br&gt;
    • items that must be reordered&lt;br&gt;
    • items that are risky based on time in store&lt;/p&gt;

&lt;p&gt;Rules:&lt;br&gt;
    • negative stock → 0&lt;br&gt;
    • missing values → 0&lt;br&gt;
    • reorder if stock &amp;lt; min&lt;br&gt;
    • risky if daysInStore &amp;gt;= 5&lt;/p&gt;

&lt;p&gt;function buildDayliyReports(products) {&lt;br&gt;
  const orderList = [];&lt;br&gt;
  const riskyProducts = [];&lt;/p&gt;

&lt;p&gt;for (const item of products) {&lt;br&gt;
    const { name, stock, min, daysInStore } = item;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const minValue = min ?? 0;
const days = daysInStore ?? 0;
let currentStock = stock ?? 0;
if (currentStock &amp;lt; 0) currentStock = 0;

if (currentStock &amp;lt; minValue) {
  const order = minValue - currentStock;
  orderList.push({ name, order });
}

if (days &amp;gt;= 5) {
  riskyProducts.push(name);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;return { orderList, riskyProducts };&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Exercise 2: Supplier Report (Dynamic Grouping)&lt;/p&gt;

&lt;p&gt;Extend the same logic to:&lt;br&gt;
    • group orders by category&lt;br&gt;
    • compute totals per category&lt;br&gt;
    • handle missing categories safely&lt;/p&gt;

&lt;p&gt;function buildSuppliersReport(products) {&lt;br&gt;
  const orderByCategory = { uncategorised: [] };&lt;br&gt;
  const riskyProducts = [];&lt;br&gt;
  const totals = { uncategorised: 0 };&lt;/p&gt;

&lt;p&gt;for (const item of products) {&lt;br&gt;
    const { name, category, stock, min, daysInStore } = item;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const minValue = min ?? 0;
const days = daysInStore ?? 0;
let currentStock = stock ?? 0;
if (currentStock &amp;lt; 0) currentStock = 0;

const cat = category ?? "uncategorised";

if (!(cat in orderByCategory)) orderByCategory[cat] = [];
if (!(cat in totals)) totals[cat] = 0;

if (currentStock &amp;lt; minValue) {
  const order = minValue - currentStock;
  orderByCategory[cat].push({ name, order });
  totals[cat] += order;
}

if (days &amp;gt;= 5) {
  riskyProducts.push(name);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;return { orderByCategory, riskyProducts, totals };&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Takeaway&lt;/p&gt;

&lt;p&gt;What helped me most was following this order consistently:&lt;br&gt;
    1.  Normalize data&lt;br&gt;
    2.  Make decisions independently&lt;br&gt;
    3.  Aggregate results explicitly&lt;/p&gt;

&lt;p&gt;This approach made nested data feel manageable and prepared me for more complex state logic.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>I Stopped Memorizing JavaScript — Here’s What Changed</title>
      <dc:creator>Amir</dc:creator>
      <pubDate>Wed, 21 Jan 2026 12:35:05 +0000</pubDate>
      <link>https://forem.com/amirhossein_ln/i-stopped-memorizing-javascript-heres-what-changed-3gf4</link>
      <guid>https://forem.com/amirhossein_ln/i-stopped-memorizing-javascript-heres-what-changed-3gf4</guid>
      <description>&lt;p&gt;For a long time, I thought learning JavaScript meant memorizing syntax.&lt;/p&gt;

&lt;p&gt;Methods.&lt;br&gt;
Operators.&lt;br&gt;
Exact function signatures.&lt;/p&gt;

&lt;p&gt;But the more I practiced, the clearer something became:&lt;br&gt;
syntax was never the real problem.&lt;/p&gt;

&lt;p&gt;What actually changed things for me was understanding &lt;em&gt;how data flows&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;When I started working with things like:&lt;br&gt;
*&lt;em&gt;- spread vs rest&lt;br&gt;
*&lt;/em&gt;- destructuring&lt;br&gt;
*&lt;em&gt;- event bubbling&lt;br&gt;
*&lt;/em&gt;- passing data through functions&lt;/p&gt;

&lt;p&gt;I stopped asking “what does this keyword do?”&lt;br&gt;
and started asking “why is this data shaped this way?”&lt;/p&gt;

&lt;p&gt;That shift made debugging easier.&lt;br&gt;
It made reading other people’s code less intimidating.&lt;br&gt;
And it made tools (including AI) actually useful instead of confusing.&lt;/p&gt;

&lt;p&gt;I still forget syntax.&lt;br&gt;
I still look things up.&lt;br&gt;
But now I know &lt;em&gt;what&lt;/em&gt; to look for and &lt;em&gt;why&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Curious:&lt;br&gt;
Do you still focus on memorizing syntax, or has something else helped things click for you?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>learning</category>
      <category>career</category>
    </item>
    <item>
      <title>Building a Multilingual AI Personality Quiz with Google AI Studio (Gemini)</title>
      <dc:creator>Amir</dc:creator>
      <pubDate>Tue, 20 Jan 2026 12:29:30 +0000</pubDate>
      <link>https://forem.com/amirhossein_ln/building-a-multilingual-ai-personality-quiz-with-google-ai-studio-gemini-18ga</link>
      <guid>https://forem.com/amirhossein_ln/building-a-multilingual-ai-personality-quiz-with-google-ai-studio-gemini-18ga</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is my submission for &lt;a href="https://dev.to/deved/build-apps-with-google-ai-studio"&gt;DEV Education Track: Build Apps with Google AI Studio&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;I built a fun, multilingual personality-style web app that asks users 10 humorous questions and then matches them with an ideal thinker or scientist from history (such as Einstein, Da Vinci, Tesla, and others).&lt;/p&gt;

&lt;p&gt;The app uses Google AI Studio (Gemini API) to dynamically generate:&lt;br&gt;
    • The final match explanation&lt;br&gt;
    • A personalized title, short bio, and match reason for each scientist&lt;/p&gt;

&lt;p&gt;At the beginning, users can select their preferred language (English, Turkish, Italian, Persian, or Arabic), and all questions, UI text, and results are displayed in that language.&lt;br&gt;
The questions are intentionally playful and conversational to keep the experience light and engaging.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&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.amazonaws.com%2Fuploads%2Farticles%2Fljwub8rikq1puuynu6j6.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.amazonaws.com%2Fuploads%2Farticles%2Fljwub8rikq1puuynu6j6.png" alt=" " width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Experience
&lt;/h2&gt;

&lt;p&gt;Working on this project helped me understand how powerful and flexible the Gemini API is for building user-facing AI experiences.&lt;br&gt;
I learned how to:&lt;br&gt;
    • Structure prompts so the model generates consistent but creative outputs&lt;br&gt;
    • Combine static app logic with dynamic AI-generated content&lt;br&gt;
    • Handle multilingual UX in a clean and scalable way&lt;/p&gt;

&lt;p&gt;What surprised me most was how well Gemini handled tone and personality when generating explanations, especially across different languages. It made the app feel much more human and interactive than a traditional quiz.&lt;/p&gt;

&lt;p&gt;Overall, this track gave me confidence to integrate generative AI into real products, not just experiments.&lt;/p&gt;

</description>
      <category>deved</category>
      <category>learngoogleaistudio</category>
      <category>ai</category>
      <category>gemini</category>
    </item>
    <item>
      <title>Building a Todo App with Vanilla JavaScript</title>
      <dc:creator>Amir</dc:creator>
      <pubDate>Mon, 19 Jan 2026 17:19:29 +0000</pubDate>
      <link>https://forem.com/amirhossein_ln/building-a-todo-app-with-vanilla-javascript-32k</link>
      <guid>https://forem.com/amirhossein_ln/building-a-todo-app-with-vanilla-javascript-32k</guid>
      <description>&lt;p&gt;This is a small practice project built to improve my understanding of JavaScript logic and DOM manipulation, without using any frameworks.&lt;/p&gt;

&lt;p&gt;The app follows a *&lt;em&gt;state-driven *&lt;/em&gt; approach, where the UI is always derived from the application state rather than updated through scattered DOM operations.&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://amirhosseinln.github.io/Todo-app-V1/" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;amirhosseinln.github.io&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;




&lt;p&gt;&lt;a href="https://github.com/AmirhosseinLN/Todo-app-V1" rel="noopener noreferrer"&gt;https://github.com/AmirhosseinLN/Todo-app-V1&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>frontend</category>
      <category>vanillajs</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
