<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by aysunitai on Medium]]></title>
        <description><![CDATA[Stories by aysunitai on Medium]]></description>
        <link>https://medium.com/@aysunitai?source=rss-b847de69b7d8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BznsjO3Fbno_mQNIAhRgmg.jpeg</url>
            <title>Stories by aysunitai on Medium</title>
            <link>https://medium.com/@aysunitai?source=rss-b847de69b7d8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:28:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aysunitai/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Chose My First Open Source Issue Without Getting Lost]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@aysunitai/how-i-chose-my-first-open-source-issue-without-getting-lost-8863f283bca3?source=rss-b847de69b7d8------2"><img src="https://cdn-images-1.medium.com/max/1920/1*2TrojetEmObpSSokBoDCJQ.png" width="1920"></a></p><p class="medium-feed-snippet">Open source always sounded exciting to me.</p><p class="medium-feed-link"><a href="https://medium.com/@aysunitai/how-i-chose-my-first-open-source-issue-without-getting-lost-8863f283bca3?source=rss-b847de69b7d8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@aysunitai/how-i-chose-my-first-open-source-issue-without-getting-lost-8863f283bca3?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8863f283bca3</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[developer-career]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 13:01:03 GMT</pubDate>
            <atom:updated>2026-06-09T13:01:03.394Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why Slow Databases Kill Good Websites — And How Smart SQL Can Save Your Business]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@aysunitai/why-slow-databases-kill-good-websites-and-how-smart-sql-can-save-your-business-5ef627d49927?source=rss-b847de69b7d8------2"><img src="https://cdn-images-1.medium.com/max/1920/1*15IDFqbHwgQby8d3Es5mrA.png" width="1920"></a></p><p class="medium-feed-snippet">Not a Medium member? You can read the full article for free on my blog here</p><p class="medium-feed-link"><a href="https://medium.com/@aysunitai/why-slow-databases-kill-good-websites-and-how-smart-sql-can-save-your-business-5ef627d49927?source=rss-b847de69b7d8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@aysunitai/why-slow-databases-kill-good-websites-and-how-smart-sql-can-save-your-business-5ef627d49927?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ef627d49927</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[performance-optimization]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Mon, 01 Jun 2026 13:31:00 GMT</pubDate>
            <atom:updated>2026-06-01T13:31:00.771Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Tracing Next.js]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Recently I started spending time inside the Next.js source code rather than only working at the application layer.</p><p class="medium-feed-link"><a href="https://medium.com/@aysunitai/tracing-next-js-925c835bc24f?source=rss-b847de69b7d8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@aysunitai/tracing-next-js-925c835bc24f?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/925c835bc24f</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript-frameworks]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Fri, 15 May 2026 09:22:55 GMT</pubDate>
            <atom:updated>2026-05-15T09:22:55.558Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What I’m Realizing While Learning AI Engineering]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@aysunitai/what-im-realizing-while-learning-ai-engineering-8d47d47874e7?source=rss-b847de69b7d8------2"><img src="https://cdn-images-1.medium.com/max/1920/1*rHDiQzlcdiklHk0XY7sOAw.png" width="1920"></a></p><p class="medium-feed-snippet">For the past few days I&#x2019;ve been going deeper into AI engineering concepts. I&#x2019;m already building AI-powered systems and automations, but I&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@aysunitai/what-im-realizing-while-learning-ai-engineering-8d47d47874e7?source=rss-b847de69b7d8------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@aysunitai/what-im-realizing-while-learning-ai-engineering-8d47d47874e7?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d47d47874e7</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Wed, 13 May 2026 07:48:09 GMT</pubDate>
            <atom:updated>2026-05-13T07:48:09.374Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Deep Dive into GIT Universe — Part1: local side of Git]]></title>
            <link>https://blog.stackademic.com/a-deep-dive-into-git-universe-part1-local-side-of-git-dd3fd96e7de0?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd3fd96e7de0</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Tue, 16 Sep 2025 06:31:44 GMT</pubDate>
            <atom:updated>2025-09-16T17:51:37.426Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Deep Dive into GIT Universe — Part1: <strong>local side of Git</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJVGa_yMw4mZEIKwfOAmsA.png" /></figure><p>If you’re like me, you learn best by turning over every stone and digging into every little detail. This article is for the curious ones.</p><p>And honestly, Git deserves that kind of attention. Who among us hasn’t messed it up at least once?</p><p>This post is <strong>Part 1</strong> of a two-part series. In this first part, we’ll focus on the <strong>local side of Git</strong> — how it works on your machine: the working directory, the staging area, commits, and the mysterious .git folder.</p><p>In <strong>Part 2</strong>, we’ll leave the local universe and explore how to connect your repository to a remote <strong>(like GitHub)</strong> and collaborate with others using push and pull.</p><p>I don’t plan to hide behind fancy words — instead, I’ll walk you through Git step by step, using a real-life example.</p><p>Let’s get started. Open your terminal.</p><h3><strong>Step 1: Create a fresh repo</strong></h3><p>In the terminal, type:</p><pre>mkdir git-lab<br>cd git-lab<br>git init</pre><p>These commands will create a folder named <strong>git-lab</strong>, move you into it, and initialize a hidden .git/ folder in your local machine.</p><p>At this stage, you’re inside your <strong>Working Directory</strong>.</p><p>Now, let’s take a closer look at this newly initialized, invisible .git folder.</p><p>If you run the following command in your terminal:</p><pre>ls</pre><p>you won’t see the .git folder yet. But if you add the -la flag:</p><pre>ls -la</pre><p>there it is — the .git folder.</p><p>So what’s the mystery behind this folder? What is it, and why is it there?</p><p>To answer that, let’s peek inside. In your terminal, type:</p><pre>ls -la .git</pre><p>You will see something like this;</p><pre>total 56<br>drwxr-xr-x   9 aysunitai  staff   288 Sep 15 10:11 .<br>drwxr-xr-x   7 aysunitai  staff   224 Sep 15 10:11 ..<br>-rw-r--r--   1 aysunitai  staff    23 Sep 15 10:11 HEAD<br>-rw-r--r--   1 aysunitai  staff   137 Sep 15 10:11 config<br>-rw-r--r--   1 aysunitai  staff    73 Sep 15 10:11 description<br>-rw-r--r--   1 aysunitai  staff  1234 Sep 15 10:11 index<br>drwxr-xr-x   3 aysunitai  staff    96 Sep 15 10:11 objects<br>drwxr-xr-x   4 aysunitai  staff   128 Sep 15 10:11 refs<br>...</pre><h3>What’s important in here:</h3><ul><li><strong>HEAD</strong> → points to your current branch.</li><li><strong>index</strong> → the staging area (binary file).</li><li><strong>objects/</strong> → where all blobs, trees, and commits live.</li><li><strong>refs/</strong> → branch pointers (refs/heads/main etc.).</li><li><strong>config</strong> → repo config file.</li></ul><h3>config</h3><ul><li>A plain-text file with repo-specific configuration.</li><li>Things like: remote URLs, user name/email (if overridden), merge tool, etc.</li></ul><p>Example content:</p><pre>[core]<br>  repositoryformatversion = 0<br>  filemode = true<br>  bare = false<br>[remote &quot;origin&quot;]<br>  url = git@github.com:username/repo.git<br>  fetch = +refs/heads/*:refs/remotes/origin/*</pre><h3><strong>Description</strong></h3><ul><li>Used only by GitWeb (a web UI for Git repos).</li><li>Default content: “Unnamed repository; edit this file to name it for gitweb.”</li><li>Safe to ignore in normal Git usage.</li></ul><h3><strong>HEAD</strong></h3><ul><li>A small text file pointing to your <strong>current branch ref</strong>.</li><li>Example:</li></ul><pre>ref: refs/heads/main</pre><p>Because you’re currently on the local <strong>main</strong> branch, this file points to main. Once you make a commit (I’ll explain commits in a moment — feel free to come back and reread this part after that), the main branch — or whichever branch you’re on — will point to the latest commit.</p><p>In other words:</p><p><strong>“HEAD → branch → commit.”</strong></p><p>And don’t forget: you can always use git checkout (I’ll explain this command in detail later) to move HEAD to another branch or even directly to a specific commit.</p><h3><strong>hooks/</strong></h3><ul><li>Contains <strong>sample scripts</strong> for Git hooks.</li><li>Hooks are scripts that run automatically on certain Git events.</li><li>pre-commit → run before committing (e.g. linting).</li><li>pre-push → run before pushing.</li><li>post-merge → run after merging.</li><li>Disabled by default (they end in .sample).</li><li>You can make them executable to customize repo workflows.</li></ul><h3>info/</h3><ul><li>Contains the exclude file → a local version of .gitignore.</li><li>Example: you can put patterns here to ignore files just for <em>you</em>, without changing the project’s .gitignore.</li></ul><h3>objects/</h3><ul><li>The <strong>core database</strong> of Git.</li><li>Stores all content (commits, trees, blobs, tags).</li><li>Objects are named by their hash (first 2 chars = folder, rest = file).</li><li>Example: e9650473... lives in .git/objects/e9/650473...</li><li>Immutable: once written, never changed.</li></ul><h3>refs/</h3><ul><li>Stores branch and tag pointers.</li><li>Subfolders:</li><li>refs/heads/ → local branches (main, dev, etc.). Each file contains a commit hash.</li><li>refs/remotes/ → remote-tracking branches (origin/main etc.).</li><li>refs/tags/ → tags.</li><li>Example: .git/refs/heads/main might contain:</li></ul><pre>e83c5163316f89bfbde7d9ab23ca2e25604af290</pre><p>That’s the commit hash your main branch currently points to.</p><p>Now that we’ve taken a look inside the .git folder, let’s move on and create some files in our project folder <strong>git-lab</strong>.</p><h3><strong>Step 2: Create 3 files</strong></h3><p>In your terminal, run:</p><pre>echo &quot;This is file A&quot; &gt; a.txt<br>echo &quot;This is file B&quot; &gt; b.txt<br>echo &quot;This is file C&quot; &gt; c.txt</pre><p>Now check:</p><pre>ls</pre><p>You’ll see:</p><pre>a.txt  b.txt  c.txt</pre><p>Open this folder in VS Code:</p><pre>code .</pre><p>👉 In VS Code Source Control panel, you should see all three files as <strong>untracked</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySUzXhw3ulBPnqy9sX9UvQ.png" /></figure><p>Do you see the letter U next to each file ? This means Untracked….</p><h3><strong>Step 3: Check repo state</strong></h3><pre>git status</pre><p>Output:</p><pre>Untracked files:<br>  a.txt<br>  b.txt<br>  c.txt</pre><p>Meaning:</p><ul><li>Files exist in <strong>working directory</strong>.</li><li>Nothing is in <strong>index</strong>(?).</li><li>Nothing is in <strong>repo history</strong>(?).</li></ul><h3><strong>Step 4: git add (</strong><strong>a.txt…)</strong></h3><p>This step called <strong>staging…</strong></p><p>Now let’s type the git add command in the terminal and take a closer look at what it really does. Ready?</p><pre>git add a.txt</pre><p>When we run this command, what we’re really telling Git is: <em>“Hey, I want you to start tracking this file.”</em> But how does Git actually do that under the hood? Let’s break it down:</p><p><strong>1.Index creation (first time)</strong><br> After the very first git add command, Git creates a new file called .git/index inside the .git folder. This file is the <strong>staging area</strong>, where Git keeps track of files you’ve marked for the next commit.</p><p>2. <strong>Ignore check</strong></p><p>Git checks your .gitignore and attribute rules. If a.txt is listed there (and you don’t force it with -f), the file won’t be staged.</p><p>3. <strong>Read the file from disk (Working Directory)</strong></p><p>Git reads the current contents of a.txt directly from your working directory — byte by byte.</p><p><strong>4. Apply “clean” filters</strong></p><p>If you have rules in .gitattributes, Git normalizes content before storing (e.g., EOL normalization, custom filters, Git LFS pointer writing, etc.).</p><p><strong>5. Compute the blob’s object ID (OID)</strong></p><p>Git computes a hash (SHA-1 by default; SHA-256 in newer repos) of<br> (&quot;blob &quot; + size + &quot;\0&quot; + normalized_content).</p><p>Example: e9650473…</p><p><strong>5. Repo state you’ll see</strong></p><p>git status → <strong>“Changes to be committed: new file: a.txt”</strong></p><p>git ls-files --stage will show something like:</p><pre>100644 e9650473… 0    a.txt</pre><p>(mode, blob OID, stage=0, path)</p><p><strong>Verify each piece yourself</strong></p><pre>git ls-files --stage            # see path → blob mapping in the index<br>git cat-file -p &lt;blobOID&gt;       # print the staged content<br>git diff                        # WD vs Index (what you changed but didn’t add)<br>git diff --staged               # Index vs HEAD (what will be committed)</pre><p>git add a.txt creates (or reuses) a <strong>blob</strong> for the current content and records a <strong>pointer (OID)</strong> to that blob in the <strong>index</strong> for a.txt. No history/branch changes happen until you git commit (which turns the whole index into a tree + commit).</p><p>At that point what happens if you stage another file?</p><pre>git add b.txt<br>git ls-files --stage</pre><p>Now you’ll see two entries:</p><pre>100644 &lt;blobA&gt; 0    a.txt<br>100644 &lt;blobB&gt; 0    b.txt</pre><p>👉 The index now has two mappings: a.txt → blobA, b.txt → blobB.</p><h3><strong>Step5.:Commit</strong></h3><p>When you run:</p><pre>git commit -m &quot;Add a and b&quot;</pre><p>Git takes what’s in the <strong>index</strong> (.git/index) and turns it into <strong>history</strong> objects inside .git/objects.</p><p>Read the index</p><p>The index says:</p><pre>a.txt → blob A1<br>b.txt → blob B1<br></pre><p>Create a tree object</p><p>Git builds a <strong>tree object</strong> from the index.</p><p>This is like a directory listing:</p><pre>100644 blob A1    a.txt<br>100644 blob B1    b.txt<br></pre><p>If you have subfolders, trees can contain other trees (recursive).</p><h3>Create a commit object</h3><ul><li>Git writes a <strong>commit object</strong> with:</li><li>Pointer to the tree object <strong>(snapshot of the project at this commit)</strong>.</li><li>One or more parent commit IDs (if this isn’t the first commit).</li><li>Metadata: author, committer, timestamps.</li><li>The commit message you gave.</li></ul><p>Example (git cat-file -p &lt;commit-hash&gt;):</p><pre>tree f23a1e9...<br>parent a1b2c3d...<br>author Aysun Itai &lt;aysun@example.com&gt; 1694776000 +0300<br>committer Aysun Itai &lt;aysun@example.com&gt; 1694776000 +0300<br><br>Message</pre><p>Update branch ref</p><ul><li>If you’re on main, .git/refs/heads/main now contains the new commit hash.</li><li>.git/HEAD points to that branch, so HEAD is now “at” this commit.</li></ul><p>So which object “records” the files?</p><ul><li><strong>Blobs</strong>: hold the <em>contents</em> of files.</li><li><strong>Tree</strong>: holds the <em>directory structure</em> and filenames pointing to blobs.</li><li><strong>Commit</strong>: holds metadata + points to the tree.</li></ul><p>👉 The <strong>commit object</strong> is what officially places the files into <strong>history</strong>, because it locks in the snapshot (tree of blobs) and connects it to the chain of parent commits.</p><p>Now check history:</p><pre>git log --oneline</pre><p>Output:</p><pre>abc1234 Add a and b</pre><p>And peek inside the commit:</p><pre>git cat-file -p abc1234</pre><p>You’ll see:</p><pre>tree f12ab34...<br>author ...<br>committer ...<br>Add a and b</pre><p>Follow the tree:</p><pre>git cat-file -p f12ab34...</pre><p>You’ll see entries for a.txt and b.txt, each pointing to the blobs you saw earlier.</p><p>Add c.txt</p><pre>git add c.txt<br>git commit -m &quot;Add c&quot;</pre><p>Now you’ll have 2 commits.</p><p>Run:</p><pre>git log --oneline</pre><p>You’ll see:</p><pre>def5678 Add c<br>abc1234 Add a and b</pre><p>With git commit you take a snapshot of the current state of the project…</p><p>When you commit, <strong>HEAD points to the new commit</strong>.<br> And because every commit records its parent, HEAD is effectively your bookmark into the project’s <strong>history</strong>.</p><h3>Another example — with a simple graph</h3><p>Let’s say we already have <strong>Commit A</strong> on the main branch.</p><pre>HEAD → main → a1b2c3 (Commit A)</pre><p>After another commit, <strong>Commit B</strong></p><ul><li>New commit d4e5f6 is created with <strong>parent = a1b2c3</strong>.</li><li>Branch main is updated to d4e5f6.</li><li>HEAD follows main.</li></ul><pre>HEAD → main → d4e5f6 (Commit B)<br>                 ↑<br>              parent<br>                 ↓<br>              a1b2c3 (Commit A)</pre><p>👉 Old commit a1b2c3 is not “lost” — it’s just not the tip anymore.</p><h3>Why the old commit isn’t deleted</h3><ul><li>Git is <strong>immutable</strong>: once a commit object is created, it’s never modified.</li><li>Commits become “unreachable” only if no branch, tag, or reflog points to them.</li><li>Even then, Git keeps them for a while (in the reflog and object database) before garbage collection (git gc) eventually prunes them.</li></ul><h3>So in plain words</h3><ul><li><strong>The old commit stays in history</strong>.</li><li><strong>The branch pointer moves forward</strong> to the new commit.</li><li><strong>The new commit links back</strong> to the old one via its parent field.</li></ul><p>That’s why git log shows a timeline — it’s literally walking those parent pointers backward.</p><p>TL;DR</p><ul><li>git checkout &lt;branch&gt; → move HEAD to branch ref (normal case).</li><li>git checkout &lt;commit&gt; → move HEAD directly to commit (detached).</li></ul><p>🔗 Chain so far</p><pre>Commit (f23a1e9)<br>  │<br>  └── tree (257cc564…)<br>        │<br>        └── a.txt → blob (e9650473…)<br>                        │<br>                        └── &quot;hello git&quot;</pre><p>Right now, everything you did (add, commit, inspecting blobs/trees) happened <strong>only in your local machine</strong> — inside the hidden .git/ folder.</p><ul><li>This is your <strong>local repository</strong>.</li><li>It already contains the <em>full history</em>, even without any remote server.</li><li>That’s why Git is called a <strong>Distributed Version Control System (DVCS)</strong>: every clone has the whole repo, not just a partial copy.</li></ul><p>So far:</p><ul><li><strong>Working directory</strong> = your actual project files.</li><li><strong>Index</strong> = staging area.</li><li><strong>Local repo (.git)</strong> = the permanent history.</li></ul><p>Congratulations! You’ve just walked through the “Git universe” step by step — from raw files on disk to how Git stores them as blobs, trees, and commits inside .git.</p><p>You now understand what <strong>staging</strong> really means, what a <strong>commit</strong> really saves, and how <strong>HEAD</strong> keeps track of your place in history.</p><p>This is your <strong>local Git repository</strong> — powerful enough on its own to track your entire project’s timeline.</p><p>In the next part, we’ll leave your machine and head into the <strong>social side of Git</strong>: how push and pull connect your local repo with GitHub, and how collaboration really works.</p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd3fd96e7de0" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/a-deep-dive-into-git-universe-part1-local-side-of-git-dd3fd96e7de0">A Deep Dive into GIT Universe — Part1: local side of Git</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB Transactions in Action: Managing Advertisers, Publishers & Views in Real Time]]></title>
            <link>https://medium.com/@aysunitai/mongodb-transactions-in-action-managing-advertisers-publishers-views-in-real-time-cdc4a203e294?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdc4a203e294</guid>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Fri, 12 Sep 2025 07:06:01 GMT</pubDate>
            <atom:updated>2025-09-12T07:06:01.437Z</atom:updated>
            <content:encoded><![CDATA[<p>How I built an <strong>ad-tech prototype backend</strong> using <strong>Node.js, Express, MongoDB, and transactions</strong> — handling advertisers, publishers, views, and campaign automation in real time …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t14QM8r_dVI_0wfuW1ZEFw.png" /></figure><p>Modern ad-tech platforms have one big challenge: <strong>keeping everything in sync</strong>.</p><ul><li>Advertisers run <strong>campaigns</strong>.</li><li>Publishers own <strong>groups</strong> where ads appear.</li><li>Every <strong>view</strong> affects budgets, earnings, and stats.</li><li>Campaigns must <strong>start</strong> and <strong>end</strong> automatically.</li></ul><p>I built mongodb-transactions— a backend prototype that demonstrates how to manage all this using:</p><ul><li><strong>Node.js + Express</strong> for APIs</li><li><strong>MongoDB + Mongoose</strong> for data</li><li><strong>Transactions</strong> for atomic updates</li><li><strong>cron-job.org</strong> for automation</li><li><strong>Zod</strong> for request validation</li></ul><p>In this post, I’ll walk you through:</p><ul><li>The <strong>architecture</strong></li><li>How <strong>transactions</strong> keep data consistent</li><li>How campaigns are managed automatically</li><li>Code examples from my project</li><li>How you can <strong>try it yourself</strong></li></ul><h3>1. The Problem</h3><p>Let’s say you’re building an ad platform:</p><ul><li>Advertisers create campaigns with a <strong>start</strong> and <strong>end date</strong>.</li><li>Publishers own Telegram groups where ads are posted.</li><li>You must track <strong>views</strong> and <strong>earnings</strong> in real time.</li><li>When a campaign <strong>starts</strong>, its status changes automatically.</li><li>When it <strong>ends</strong>, you mark it <strong>finished</strong>.</li></ul><p>We need a <strong>backend</strong> that:</p><p><em>Manages campaigns<br>Tracks daily stats<br>Updates wallets in real time<br>Automates campaign rollovers</em></p><p><strong>2. Tech Stack</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JSvE4X9fByBNMRrc" /></figure><p><strong>3. System Architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t14QM8r_dVI_0wfuW1ZEFw.png" /></figure><h3>4. The Heart of the System: /views Endpoint</h3><p>When a user views an ad, <strong>four collections</strong> must update <strong>together</strong>:</p><ul><li>DailyStats → views, spend, earnings</li><li>Campaign → total spent</li><li>Wallets → advertiser spent, publisher earnings</li></ul><p>We need <strong>transactions</strong> to keep them in sync.</p><p>Code Example</p><pre>r.post(&quot;/&quot;, async (req,res) =&gt; {<br>  const session = await mongoose.startSession();<br>  try {<br>    const { campaignId, groupId, advertiserId, publisherId, views } = ViewSchema.parse(req.body);<br><br>    await session.withTransaction(async () =&gt; {<br>      const camp = await Campaign.findById(campaignId).session(session);<br>      if (!camp) throw new Error(&quot;Campaign not found&quot;);<br>      if (camp.status !== &quot;RUNNING&quot;) throw new Error(&quot;Campaign not running&quot;);<br><br>      const date = todayStr();<br>      const spendInc = (camp.cpm / 1000) * views;<br>      const earnInc  = spendInc;<br><br>      // Update daily stats<br>      await DailyStats.updateOne(<br>        { campaignId, groupId, date },<br>        { $inc: { views, spend: spendInc, earnings: earnInc } },<br>        { upsert:true, session }<br>      );<br><br>      // Update campaign budget<br>      await Campaign.updateOne(<br>        { _id: campaignId },<br>        { $inc: { spent: spendInc } },<br>        { session }<br>      );<br><br>      // Update advertiser &amp; publisher wallets<br>      await Wallets.updateOne({ advertiserId }, { $inc: { spent: spendInc } }, { upsert:true, session });<br>      await Wallets.updateOne({ publisherId }, { $inc: { earnings: earnInc } }, { upsert:true, session });<br>    });<br><br>    res.json({ ok: true });<br>  } catch (e) {<br>    res.status(400).json({ ok:false, error: e.errors ?? e.message });<br>  } finally {<br>    session.endSession();<br>  }<br>});</pre><h3>5. Automated Campaign Rollover</h3><p>We don’t want to manually manage campaign statuses.<br> That’s where <strong>cron-job.org</strong> comes in. It calls /tasks/rollover every 15 minutes.</p><pre>r.post(&quot;/rollover&quot;, async (req, res) =&gt; {<br>  if (req.headers[&quot;x-cron-secret&quot;] !== process.env.CRON_SECRET)<br>    return res.status(401).json({ ok: false, error: &quot;unauthorized&quot; });<br><br>  const now = new Date();<br><br>  const toRunning = await Campaign.updateMany(<br>    { status: &quot;APPROVED&quot;, startAt: { $lte: now }, endAt: { $gt: now } },<br>    { $set: { status: &quot;RUNNING&quot; } }<br>  );<br><br>  const toFinished = await Campaign.updateMany(<br>    { status: &quot;RUNNING&quot;, endAt: { $lte: now } },<br>    { $set: { status: &quot;FINISHED&quot; } }<br>  );<br><br>  res.json({<br>    ok: true,<br>    movedToRunning: toRunning.modifiedCount,<br>    movedToFinished: toFinished.modifiedCount,<br>    ts: now.toISOString()<br>  });<br>});</pre><p>Ensures campaigns <strong>start and finish automatically</strong>.<br>Can be tested locally using Thunder/Postman.</p><p>With MongoDB replica sets, Node.js, and Mongoose transactions, I was able to keep:</p><ul><li><strong>Advertiser budgets</strong>,</li><li><strong>Publisher earnings</strong>,</li><li><strong>Daily stats</strong>, and</li><li><strong>Campaign states</strong></li></ul><p>…all perfectly in sync.</p><p>By combining <strong>cron-job.org</strong> for automation and <strong>Zod</strong> for safe validation, the system runs smoothly without manual intervention. Campaigns flip from <em>APPROVED → RUNNING → FINISHED</em> automatically, while each view updates the right wallets and stats in one atomic operation.</p><p>This project is still just a <strong>prototype</strong>, but the principles scale into production:</p><ul><li>Always use <strong>transactions</strong> when multiple documents matter together.</li><li>Keep your business logic <strong>modular</strong> (campaigns, views, tasks).</li><li>Automate repetitive status changes with a scheduler.</li></ul><p>If you want to dive deeper, check out the full project on GitHub:<br> 🔗 <a href="https://github.com/aysunitai/mongodb-transactions"><strong>mongodb-transactions</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdc4a203e294" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JWT vs Session-Based Auth: A Developer’s Complete Guide]]></title>
            <link>https://medium.com/@aysunitai/jwt-vs-session-based-auth-a-developers-complete-guide-9e0a7929afda?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e0a7929afda</guid>
            <category><![CDATA[api-authentication]]></category>
            <category><![CDATA[nodejs-security]]></category>
            <category><![CDATA[jwt-authentication]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Sat, 06 Sep 2025 12:51:03 GMT</pubDate>
            <atom:updated>2025-09-06T12:51:03.913Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rWPe589WfLOA-jMhoN2TGg.png" /></figure><p>Modern web apps need a secure way to <strong>verify users</strong> and <strong>control access</strong> to resources.<br> There are two main approaches to handling user authentication:</p><ul><li><strong>Session-based authentication</strong> (stateful) — used traditionally with server-stored sessions</li><li><strong>JWT-based authentication</strong> (stateless) — designed for scalability and distributed systems</li></ul><p>In this guide, we’ll <strong>demystify JWT (JSON Web Tokens)</strong> by covering:</p><ul><li>What JWTs are and how they work internally</li><li>The difference between <strong>authentication</strong> and <strong>authorization</strong></li><li>How JWT compares to session-based authentication</li><li>A complete <strong>Node.js + Express</strong> implementation with code examples</li><li>Best practices for <strong>security</strong> and <strong>scalability</strong></li></ul><p>By the end of this article, you’ll not only understand how JWT works but also know <strong>when to use it</strong>, <strong>how to implement it</strong>, and <strong>how to secure it</strong> in production.</p><h4><strong>What is JWT?</strong></h4><p><strong>JWT</strong> stands for <strong>JSON Web Token</strong> — a secure, compact, and self-contained way to <strong>authenticate users</strong> and <strong>authorize access</strong> to protected resources.</p><p>A JWT is just a <strong>string</strong> with three parts:</p><pre>HEADER.PAYLOAD.SIGNATURE</pre><p>Example:</p><pre>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9<br>.<br>eyJpZCI6MTIzLCJlbWFpbCI6ImpvaG5AZXhhbXBsZS5jb20ifQ<br>.<br>m2LdZs8XUQJhQT1b9-dKXo3FakeSignature123</pre><h4>Authentication vs Authorization</h4><p><strong>Authentication</strong> → Confirms <strong>who</strong> the user is.<br><strong>Authorization</strong> → Decides <strong>what</strong> the user can access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2DQuZLvv4EfYjKVh" /></figure><h4>JWT vs Session-Based Authentication</h4><p>There are <strong>two main ways</strong> to manage user login state:</p><h4>Option 1: Session-Based Authentication (Stateful)</h4><ul><li>Server creates a <strong>session</strong> after login.</li><li>A <strong>session ID</strong> is stored in a <strong>cookie</strong>.</li><li>On each request, the client sends the cookie → server looks up session data in memory or DB.</li></ul><p><strong>How It Works</strong></p><pre>[Client] → Login → [Server]  <br>Server stores session in DB  <br>Server sends session_id cookie  <br>Client sends cookie back each request  <br>Server finds session in DB → grants/denies access</pre><p><strong>Pros</strong></p><ul><li>Easy to implement</li><li>Simple logout handling</li></ul><p><strong>Cons:</strong></p><ul><li>Requires <strong>server-side storage</strong></li><li>Harder to scale with load balancers</li></ul><h4>Option 2: JWT Authentication (Stateless)</h4><ul><li>Server creates a <strong>signed token</strong> after login.</li><li>Token contains user info + expiration date.</li><li>Client stores token in localStorage, cookies, or memory.</li><li>On each request, the client sends the token in the Authorization header.</li><li>Server <strong>verifies</strong> the token signature → no DB lookup needed.</li></ul><pre>[Client] → Login → [Server]<br>Server creates signed JWT  <br>Server sends JWT to client  <br>Client stores JWT (cookie/localStorage)  <br>Client sends JWT in Authorization header each request  <br>Server verifies signature → grants/denies access</pre><p><strong>Pros:</strong></p><ul><li><strong>Stateless</strong> — no session DB required</li><li>Perfect for scaling across multiple servers</li><li>Faster authentication</li></ul><p><strong>Cons:</strong></p><ul><li>Must manage token expiration &amp; refresh</li><li>Requires secure handling of secrets</li></ul><h4>JWT Structure</h4><p>As we already know, a JWT has <strong>three parts</strong>, separated by dots:</p><pre>HEADER.PAYLOAD.SIGNATURE</pre><ol><li>Header</li></ol><pre>{<br>  &quot;alg&quot;: &quot;HS256&quot;,<br>  &quot;typ&quot;: &quot;JWT&quot;<br>}</pre><ul><li>Algorithm (HS256 = HMAC SHA-256)</li><li>Token type (JWT)</li></ul><p>2. Payload</p><pre>{<br>  &quot;id&quot;: 123,<br>  &quot;email&quot;: &quot;john@example.com&quot;,<br>  &quot;role&quot;: &quot;admin&quot;,<br>  &quot;exp&quot;: 1694023456<br>}</pre><ul><li>Contains user info</li><li>Not encrypted → just Base64-encoded</li></ul><p>3. Signature</p><pre>HMACSHA256(<br>    base64UrlEncode(header) + &quot;.&quot; + base64UrlEncode(payload),<br>    JWT_SECRET<br>)</pre><ul><li>Uses <strong>server’s secret key</strong> to create a unique hash</li><li>Ensures token integrity</li></ul><p><strong>Implementing JWT Authentication in Node.js + Express</strong></p><p>Step 1. Install Dependencies</p><pre>npm install express jsonwebtoken bcryptjs cors dotenv</pre><h4>Step 2. Setup Express Server</h4><p><strong>server.js</strong></p><pre>import express from &quot;express&quot;;<br>import jwt from &quot;jsonwebtoken&quot;;<br>import bcrypt from &quot;bcryptjs&quot;;<br>import cors from &quot;cors&quot;;<br>import dotenv from &quot;dotenv&quot;;<br><br>dotenv.config();<br>const app = express();<br>app.use(express.json());<br>app.use(cors());<br><br>const PORT = 4000;<br>const JWT_SECRET = process.env.JWT_SECRET || &quot;supersecretkey&quot;;<br><br>// Simulated user database<br>const users = [<br>  {<br>    id: 1,<br>    email: &quot;john@example.com&quot;,<br>    password: bcrypt.hashSync(&quot;123456&quot;, 10) // hashed password<br>  }<br>];</pre><p>Step 3. Create Login Route</p><pre>app.post(&quot;/login&quot;, async (req, res) =&gt; {<br>  const { email, password } = req.body;<br><br>  const user = users.find(u =&gt; u.email === email);<br>  if (!user) return res.status(400).json({ message: &quot;Invalid credentials&quot; });<br><br>  const isMatch = await bcrypt.compare(password, user.password);<br>  if (!isMatch) return res.status(400).json({ message: &quot;Invalid credentials&quot; });<br><br>  // Create JWT token<br>  const token = jwt.sign({ id: user.id, email: user.email },JWT_SECRET,<br>    { expiresIn: &quot;1h&quot; }<br>  );<br><br>  res.json({ token });<br>});</pre><p><strong>Creating JWT token</strong></p><p>Under the hood, the library does this:</p><pre>signature = HMACSHA256(<br>    base64UrlEncode(header) + &quot;.&quot; + base64UrlEncode(payload),<br>    JWT_SECRET<br>);</pre><p>Server, <strong>mixes</strong> the <strong>header</strong> + <strong>payload</strong> + <strong>server’s secret key </strong>and hashes them.</p><p>Step 4. Create Authentication Middleware</p><pre>function authenticateToken(req, res, next) {<br>  const authHeader = req.headers[&quot;authorization&quot;];<br>  const token = authHeader &amp;&amp; authHeader.split(&quot; &quot;)[1];<br><br>  if (!token) return res.status(401).json({ message: &quot;Token missing&quot; });<br><br>  jwt.verify(token, JWT_SECRET, (err, decoded) =&gt; {<br>    if (err) return res.status(403).json({ message: &quot;Invalid or expired token&quot; });<br><br>    req.user = decoded; // attach user info<br>    next();<br>  });<br>}</pre><p>The way how server checks if the token is right is this:</p><p>Again, our token had 3 parts had three parts :</p><pre>HEADER.PAYLOAD.SIGNATURE</pre><p>and you already know how signature is created ;</p><p>so as you see function from step 4;</p><p>Server :</p><ul><li><strong>Extracts token</strong> from client’s request→ full JWT.</li><li><strong>Splits</strong> into header, payload, signature.</li></ul><pre>const [headerBase64, payloadBase64, signatureFromToken] = token.split(&quot;.&quot;);</pre><ul><li><strong>Recomputes signature</strong> using header + payload + server’s JWT_SECRET.</li></ul><pre>newSignature = HMACSHA256(<br>    base64UrlEncode(header) + &quot;.&quot; + base64UrlEncode(payload),<br>    JWT_SECRET<br>);</pre><ul><li>Compares recomputed signature with token’s signature:</li></ul><pre>if (newSignature === signatureFromToken) {<br>    Token is valid → proceed<br>} else {<br>    Token is invalid → reject<br>}</pre><p>Step 5. Protect Routes</p><pre>app.get(&quot;/profile&quot;, authenticateToken, (req, res) =&gt; {<br>  res.json({<br>    message: &quot;Welcome to your profile!&quot;,<br>    user: req.user<br>  });<br>});</pre><p>Step 6. Start Server</p><pre>app.listen(PORT, () =&gt; console.log(`Server running at http://localhost:${PORT}`));</pre><h4>Client-Side Example (JavaScript)</h4><p>Login &amp; Save Token</p><pre>async function loginUser(email, password) {<br>  const res = await fetch(&quot;http://localhost:4000/login&quot;, {<br>    method: &quot;POST&quot;,<br>    headers: { &quot;Content-Type&quot;: &quot;application/json&quot; },<br>    body: JSON.stringify({ email, password })<br>  });<br><br>  const data = await res.json();<br>  if (res.ok) {<br>    localStorage.setItem(&quot;token&quot;, data.token);<br>    console.log(&quot;Logged in:&quot;, data);<br>  } else {<br>    console.error(data.message);<br>  }<br>}</pre><p>Access Protected Route</p><pre>async function getProfile() {<br>  const token = localStorage.getItem(&quot;token&quot;);<br>  const res = await fetch(&quot;http://localhost:4000/profile&quot;, {<br>    headers: { &quot;Authorization&quot;: `Bearer ${token}` }<br>  });<br><br>  const data = await res.json();<br>  console.log(data);<br>}</pre><h3>Final Thoughts</h3><p>JWTs have become the <strong>industry standard</strong> for securing modern web apps, APIs, and microservices — but understanding how they work is <strong>crucial</strong> for using them safely.</p><p><strong>Key takeaways:</strong></p><ul><li><strong>Sessions</strong> are <strong>stateful</strong> → server stores session data.</li><li><strong>JWTs</strong> are <strong>stateless</strong> → the token itself carries authentication data.</li><li>JWT = Header.Payload.Signature → the <strong>signature</strong> proves authenticity.</li><li>Always:</li><li>Use <strong>HTTPS</strong></li><li>Keep your JWT_SECRET safe</li><li>Use <strong>short-lived tokens</strong> with refresh tokens</li><li>Prefer <strong>HttpOnly cookies</strong> for storage</li><li>Validate tokens carefully on every request</li></ul><p>By mastering JWT authentication, you’ll be able to build <strong>scalable</strong>, <strong>secure</strong>, and <strong>high-performance</strong> applications that handle <strong>millions of users</strong> without overloading your servers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e0a7929afda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why the Fundamentals Still Matter: MIT 6.001, Python, and the Coming Age of AI]]></title>
            <link>https://medium.com/@aysunitai/why-the-fundamentals-still-matter-mit-6-001-python-and-the-coming-age-of-ai-d312f0396a3f?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d312f0396a3f</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[abstraction]]></category>
            <category><![CDATA[programming-fundament]]></category>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Mon, 02 Jun 2025 08:34:29 GMT</pubDate>
            <atom:updated>2025-06-02T08:34:29.247Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>“Computer Science is not about computers any more than astronomy is about telescopes.”</strong><br> — Edsger Dijkstra</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xXVUkiALWewtEMU6hWu1A.png" /></figure><h3>Why revisit the classics?</h3><p>I recently found myself re-reading the legendary notes from MIT’s 6.001 <em>Structure and Interpretation of Computer Programs</em> (SICP), and it struck me how <strong>timeless</strong> and <strong>urgent</strong> these foundations feel right now.<br> With AI rushing into our workflows and the promise (or threat) of “no-code” and auto-generated apps everywhere, it’s easy to forget what programming is really about. But <em>understanding things deeply</em> — not just copying code — will matter <strong>more</strong>, not less, as software evolves.</p><p>Let’s break down what makes these foundations so powerful, and why they’re more relevant than ever — with real, modern Python examples.</p><h3>1. What is Computer Science really about?</h3><p>SICP starts by flipping the script:<br> It’s not about computers. Not about the latest framework.<br> It’s about <strong>“how to” knowledge</strong> — how to describe processes, not just facts.</p><ul><li><strong>Declarative knowledge:</strong> <em>What is true?</em> Example: “The square root of x is a number y such that y² = x.”</li><li><strong>Imperative knowledge:</strong> <em>How do you do it?</em> Example: An algorithm for finding the square root of 2 by iteratively improving guesses.</li></ul><p><strong>Why does this matter?</strong><br> Because code is not just a set of answers, but a <em>recipe</em> — a step-by-step way of moving from one state to another. In the future, <em>telling AI what you want</em> will still require you to understand what “how to” means.</p><h3>2. From Bits to Abstraction</h3><p>Ever wondered why computers use all those 0s and 1s?<br> At their core, computers represent everything — numbers, text, images — as sequences of <strong>bits</strong> (binary digits).</p><p><strong>Why binary (base-2)?</strong><br> Because hardware can reliably distinguish only two states: <em>on</em> or <em>off</em>.<br> With more states (like base-10), circuits would be fragile and complex.</p><p><strong>How does a number like 13 become binary?</strong></p><ul><li>13 in decimal is 1101 in binary:</li><li>Each place represents a power of 2:</li><li>1×8 + 1×4 + 0×2 + 1×1 = 13</li></ul><p><strong>Characters?</strong><br> We map each character to a number (using ASCII or Unicode), then store that number as bits. For example, &#39;A&#39; is 65 in ASCII, which is 01000001 in binary.</p><pre># Python: Character to binary<br>char = &#39;A&#39;<br>binary = format(ord(char), &#39;08b&#39;)<br>print(binary)  # 01000001</pre><p><strong>But nobody wants to write code manipulating raw bits!</strong><br> So we use layers of <em>abstraction</em> — numbers, strings, lists — built from these binary basics.</p><h3>3. Building Blocks: Expressions, Combinations, and Naming</h3><h3>Expressions &amp; Combinations</h3><p>Programming languages let us combine simple things into complex ones.<br> In Scheme (Lisp), it’s:</p><pre>(+ 2 (* 3 4))  ; 2 + (3 * 4)</pre><p>In Python:</p><pre>2 + (3 * 4)</pre><p>Languages give us <strong>syntax</strong> (rules for writing code) and <strong>semantics</strong> (rules for what code <em>means</em>).</p><h3>Abstraction: Naming things</h3><p>Imagine if every time you wanted the area of a circle, you had to write out the formula instead of just calling area(radius).</p><p>In Scheme:</p><pre>(define pi 3.14159)<br>(define (area r) (* pi r r))</pre><p>In Python:</p><pre>pi = 3.14159<br>def area(r):<br>    return pi * r * r</pre><p>Abstraction means we can <strong>bury complexity behind names</strong> — treating our own functions as if they were primitives like + or *.</p><h3>4. Environments: Where Do Variables Live?</h3><p>Here’s where many new programmers get tripped up:<br> <strong>When you create a variable, <em>where</em> does the computer actually put it? How does it know what “pi” refers to?</strong></p><p>In Python (and almost every language), variables are stored in an <strong>environment</strong> — a kind of table (technically, a namespace or symbol table) in memory.</p><ul><li>When you write pi = 3.14159, Python:</li><li>Evaluates the right side (3.14159).</li><li>Binds the name &quot;pi&quot; to this value in the current namespace (a dictionary mapping names to objects).</li></ul><p>You can even see this table:</p><pre>print(globals())  # Shows global variables and their values</pre><p>Variables live in RAM while your program runs. Depending on how you create them, they’re managed by the language’s <em>memory management</em> system — either in the <strong>stack</strong> (for temporary, local variables) or the <strong>heap</strong> (for things that might last longer, like objects and large data). When a variable is no longer needed, Python’s <em>garbage collector</em> cleans up the memory.</p><h3>5. How Evaluation Works: The Two Worlds</h3><p>SICP beautifully explains the <strong>two worlds</strong> of programming:</p><ul><li><strong>Visible world:</strong> What you see — writing code, seeing outputs.</li><li><strong>Execution world:</strong> What the computer actually does behind the scenes.</li></ul><p>Every time you type an expression:</p><ol><li><strong>Reader:</strong> Parses your code.</li><li><strong>Evaluator:</strong> Figures out what it means, following precise rules.</li><li><strong>(Possibly recursively!)</strong> For complex expressions, evaluates sub-expressions first.</li><li><strong>Printer:</strong> Converts the result back into something you can see.</li></ol><pre>a = 10<br>b = a + 5<br>print(b)</pre><p>Python parses, evaluates each part, stores values in the environment, and finally prints 15.</p><h3>6. Special Forms and Names as Values</h3><p>Not everything is evaluated the same way. In Scheme, define is a <em>special form</em>—it doesn&#39;t assess the variable name on the left, just binds it.<br> Python’s assignment (=) is similar.</p><p>You can also <em>bind</em> new names to existing functions or operators:</p><pre>import operator<br>plus = operator.add<br>print(plus(2, 3))  # 5</pre><h3>7. Why Abstraction is the Secret Superpower</h3><p>This leads to the “black box” idea:<br> <strong>Once you’ve defined something complex, you can treat it as a primitive.</strong><br> You can combine these building blocks, give <em>them</em> names, and build ever more powerful abstractions — hiding all the messy details.</p><p>This is how software grows from a single function to an entire operating system or AI model — layer upon layer of abstraction, each one burying complexity and letting you think at a higher level.</p><h3>8. Why This Matters Now (and in the Age of AI)</h3><ul><li>20 years ago, knowing HTML and CSS was enough.</li><li>Then came JavaScript, backend frameworks, mobile, cloud…</li><li>Now, <strong>AI is becoming a new layer</strong> — but you still need to understand what’s happening underneath.</li><li>The deeper your understanding, the better your prompts, debugging, and designs will be — even if the AI is writing code for you!</li></ul><p><strong>The future belongs to those who know how to abstract, combine, and create new primitives — no matter what the surface syntax looks like.</strong></p><h3>9. Want to Go Deeper?</h3><p>The entire <a href="https://ocw.mit.edu/courses/6-001-structure-and-interpretation-of-computer-programs-spring-2005/">MIT 6.001 lecture series</a> is available for free.<br> And Python is the perfect playground for these ideas. Try translating some classic Scheme or SICP examples into Python. See how naming, combination, and abstraction are universal.</p><h3>Final Thoughts</h3><p><strong>Programming is not about tools, frameworks, or even computers — it’s about <em>thinking</em> in processes, building abstractions, and shaping your own vocabulary for solving problems.</strong></p><p>AI will become the world’s most powerful black box, but if you want to truly harness it, understanding these timeless fundamentals is your edge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d312f0396a3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stories Behind the Code: Real-Life Reflections of a Developer]]></title>
            <link>https://medium.com/@aysunitai/stories-behind-the-code-real-life-reflections-of-a-developer-2f5329548724?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f5329548724</guid>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[türkiye]]></category>
            <category><![CDATA[women]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[personal-growth]]></category>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Wed, 14 May 2025 08:34:15 GMT</pubDate>
            <atom:updated>2025-05-14T09:42:26.450Z</atom:updated>
            <content:encoded><![CDATA[<p>From Surgery to the Pool Table — Learning Never Stops</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wnZ2MdB1KWKKN8JXdqBK_w.png" /></figure><p>About three years ago, while I was in Eskişehir, Turkiye, I had a minor surgery. The doctor told me not to do any physical exercise for at least two weeks. :)<br> But that was almost impossible for me. I needed to move, to be active, to be outside.</p><p>One day, while walking down the street near the house I was staying at the time, I noticed a small billiard hall. It immediately reminded me of the pool table we had under the dormitory during my university years. I had tried it a few times back then but never took it seriously.<br> I thought, <em>“Maybe now is the perfect time to improve a bit.”</em> And maybe, just maybe, the doctor would allow me to play billiards — no gym, no intense activity — but this could be okay.</p><p>So I walked in.</p><p>Now, you have to imagine this: in Turkiye, these kinds of billiard saloons are typically male-dominated spaces—absolutely no women. I’m unsure if a woman has ever entered this place. It felt like an all-men’s club, filled with the smell of Turkish tea and cigarettes.<br> But that wasn’t going to stop me.</p><p>You should’ve seen the expression on their faces when I asked if I could take a billiards lesson. One man looked at me for a few seconds, visibly surprised, and then replied, still a bit in shock, with an underestimating tone.<br> But I’m used to this. As a woman, you’re often underestimated. I didn’t care.</p><p>They said they could help and called someone named Asım Ağabey. We met, and I quickly learned that he had been playing billiards for many years and had competed in tournaments all across the country. He was a real champion, but also incredibly humble and kind.</p><p>After a quick check-in with my doctor, I got the green light. Billiards was gentle enough to be allowed, so I began the lessons.</p><p>To my surprise, I loved it. And from Asım Ağabey, I learned more than just how to play the game.<br> He taught me lessons about patience, observation, and focus — things I realized applied far beyond the billiard table.</p><p>If we know how to look and how to truly see, we can always find ways to learn and grow, no matter the situation.</p><p>To this day, that story has a special place in the back of my mind. Whenever I need a little inspiration or a spark of motivation, I replay it.<br> I go back to that little saloon with the sharp smell of cigarettes… and the beautiful sound of a metal spoon gently hitting the side of a tea glass, stirring that hot, dark Turkish tea.<br> It’s a moment I carry with me. Always.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f5329548724" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Materials Engineer to Machine Learning Developer: Predicting Tensile Strength with Python and…]]></title>
            <link>https://medium.com/@aysunitai/from-materials-engineer-to-machine-learning-developer-predicting-tensile-strength-with-python-and-244e4b6a6238?source=rss-b847de69b7d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/244e4b6a6238</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[material-science]]></category>
            <category><![CDATA[flyio]]></category>
            <category><![CDATA[streamlit]]></category>
            <dc:creator><![CDATA[aysunitai]]></dc:creator>
            <pubDate>Wed, 30 Apr 2025 18:58:38 GMT</pubDate>
            <atom:updated>2025-04-30T18:58:38.877Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Materials Engineer to Machine Learning Developer: Predicting Tensile Strength with Python and Web Tech</h3><p>When I began my journey in materials science, I never imagined that I’d someday deploy my own machine learning models on the web. But today, I have a fully functioning web app that predicts tensile strength based on material parameters — and I built it using Python, machine learning, and modern web development tools.</p><p>This article is my story — from raw data in Excel to a live app deployed on the cloud. Whether you’re an engineer curious about machine learning or a developer wanting to apply AI in a real-world domain, I hope my journey helps light the path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nrkrkTZVp8JphgpNnatd8g.png" /></figure><h3>The Engineering Problem</h3><p>As a materials engineer, tensile strength is one of the most critical mechanical properties we work with. It defines how a material behaves under stress and determines its applications.</p><p>Traditionally, predicting tensile strength required lab experiments, which are time-consuming and expensive. But what if we could <strong>predict it automatically</strong> using <strong>machine learning</strong>?</p><h3>My Dataset</h3><p>I started with a dataset that includes properties like:</p><ul><li>Matrix-filler ratio</li><li>Density</li><li>Modulus of elasticity</li><li>Hardener amount</li><li>Epoxy content</li><li>Flash point</li><li>Surface density</li><li>Resin consumption</li><li>Tensile modulus</li></ul><p>The target variable was <strong>tensile strength (MPa)</strong>.</p><p>I used Excel and pandas to clean and preprocess the data. Some basic feature engineering (like log_density and modulus_squared) helped improve performance.</p><h3>Training the Machine Learning Model</h3><p>I used scikit-learn to train a <strong>Random Forest Regressor</strong>. Here’s the training snippet:</p><pre>from sklearn.ensemble import RandomForestRegressor<br>from sklearn.model_selection import train_test_split<br><br>important_features = [<br>    &#39;hardener_amount&#39;,<br>    &#39;surface_density&#39;,<br>    &#39;tensile_modulus&#39;,<br>    &#39;flash_point&#39;,<br>    &#39;epoxy_content&#39;,<br>    &#39;resin_consumption&#39;<br>]<br><br>X = df[important_features]<br>y = df[&#39;tensile_strength&#39;]<br><br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<br><br>model = RandomForestRegressor(random_state=42)<br>model.fit(X_train, y_train)</pre><p>I saved the model using joblib:</p><pre>import joblib<br>joblib.dump(model, &quot;tensile_model.pkl&quot;)</pre><p>The model achieved a decent R² score, enough to move forward with deployment.</p><h3>Building the Web App with Streamlit</h3><p>Next, I created a <strong>Streamlit app</strong> to allow users to input material properties and get an instant tensile strength prediction.</p><p>The UI was minimal but effective — just a few input fields and a big “Predict” button.</p><pre>import streamlit as st<br>import joblib<br>import pandas as pd<br><br>model = joblib.load(&quot;tensile_model.pkl&quot;)<br><br>st.title(&quot;Smart Materials: Tensile Strength Predictor&quot;)<br><br>hardener_amount = st.number_input(&quot;Hardener Amount (m%)&quot;, 0.0, 100.0)<br># ... other inputs ...<br><br>input_data = pd.DataFrame([{<br>    &#39;hardener_amount&#39;: hardener_amount,<br>    # ...<br>}])<br><br>if st.button(&quot;Predict Strength&quot;):<br>    prediction = model.predict(input_data)[0]<br>    st.success(f&quot;Predicted Tensile Strength: {prediction:.2f} MPa&quot;)</pre><h3>Deploying to the Web with Fly.io</h3><p>This was the hardest part — but the most rewarding.</p><p>Streamlit apps need to run on a server and listen on 0.0.0.0, and Fly.io (a lightweight cloud platform) was the perfect fit.</p><p>I wrote a Dockerfile, created a fly.toml, and deployed using:</p><pre>fly deploy</pre><p>After dealing with issues like:</p><ul><li>Port binding (0.0.0.0:8080)</li><li>HTTPS certificates not auto-assigning</li><li>Rewriting the Docker command</li></ul><p>…I finally saw it live. My app. Predicting tensile strength. In the cloud.</p><h3>What I Learned</h3><p>This journey taught me a lot:</p><ul><li>Machine learning is accessible to engineers.</li><li>Web development bridges data science with real users.</li><li>Deployment is hard — but worth it.</li><li>You don’t need to be a software engineer to build powerful tools.</li></ul><h3>What’s Next</h3><p>I plan to continue refining this app:</p><ul><li>Better UI/UX with Streamlit components</li><li>Save prediction history</li><li>Add multiple model options</li><li>Try deep learning for more complex properties</li></ul><p><strong>Thanks for reading!</strong><br> Let me know what you’re working on in the comments, and follow me for more on Python, ML, and engineering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=244e4b6a6238" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>