<?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 Merve Deniz Senelen on Medium]]></title>
        <description><![CDATA[Stories by Merve Deniz Senelen on Medium]]></description>
        <link>https://medium.com/@mdsenelen?source=rss-5d82c3acbe85------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0lt6IKulGRVDPCvf2_WuGg.jpeg</url>
            <title>Stories by Merve Deniz Senelen on Medium</title>
            <link>https://medium.com/@mdsenelen?source=rss-5d82c3acbe85------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:36:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mdsenelen/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 Deployed a Full-Stack App for Free using Neon, Render, and Vercel]]></title>
            <link>https://medium.com/@mdsenelen/how-i-deployed-a-full-stack-app-for-free-using-neon-render-and-vercel-d6e96457703e?source=rss-5d82c3acbe85------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6e96457703e</guid>
            <category><![CDATA[full-stack-development]]></category>
            <category><![CDATA[render]]></category>
            <category><![CDATA[web-app-deployment]]></category>
            <category><![CDATA[vercel]]></category>
            <category><![CDATA[full-stack-developer]]></category>
            <dc:creator><![CDATA[Merve Deniz Senelen]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 13:06:08 GMT</pubDate>
            <atom:updated>2026-11-18T13:04:28.252Z</atom:updated>
            <content:encoded><![CDATA[<p>I built a small dashboard app for my portfolio. It has a Next.js website, a Node API, and a Postgres database.</p><p>This guide walks through the whole process, step by step.</p><h3>How does it work?</h3><p>The app has three parts, and each one lives on a different free service:</p><ul><li><strong>The database</strong> (Postgres) lives on <strong>Neon</strong></li><li><strong>The API</strong> (the backend) lives on <strong>Render</strong></li><li><strong>The website</strong> (Next.js) lives on <strong>Vercel</strong></li></ul><p>The three parts need to know about each other. The API needs the database address. The website needs the API address. And the API needs to know the website address, so it can allow the website to talk to it.</p><h3><strong>Step 1: Get your code onto the main branch</strong></h3><p>Render and Vercel both deploy from your main branch. If your work is on another branch, open a pull request on GitHub, wait for your checks to pass, and merge it. Nothing in the next steps will work until your code is on main.</p><h3>Step 2: Create the database on Neon</h3><ol><li>Create a new project on Neon.</li><li>Find the <strong>connection string</strong>. It looks like postgresql://user:password@host/dbname?sslmode=require.</li><li>Turn <strong>off</strong> the “pooled connection” option and copy the direct connection string. Pooled strings have -pooler in the host name, so you can recognize them.</li><li>Make sure the string ends with ?sslmode=require.</li><li>Neon may add &amp;channel_binding=require at the end. I removed it, because not every database driver supports it. You can’t edit the string inside Neon’s box, so paste it into your text editor and change it there.</li></ol><p>Treat this string like a password, because it contains one. Never paste it into a public place. Paste it only into Render.</p><h3>Step 3: Deploy the API on Render</h3><p>My repository has a file called render.yaml that describes the API service. Render calls this a <strong>Blueprint</strong>.</p><ol><li>In Render, click <strong>New</strong>, then <strong>Blueprint</strong>.</li><li>Pick your GitHub repository. Render reads render.yaml on its own.</li><li>When Render asks for the database connection string, paste the one from Neon.</li><li>Start the deploy. The first one takes a few minutes, because the API prepares the database and creates sample data.</li><li>When it finishes, Render shows your API address at the top of the service page. It looks like https://your-api.onrender.com. Copy it.</li></ol><h3>Step 4: Deploy the website on Vercel</h3><ol><li>In Vercel, click <strong>Add New</strong>, then <strong>Project</strong>, and import the same repository.</li><li>My website lives in a subfolder, so I set <strong>Root Directory</strong> to apps/web. If your site is at the top level of the repo, skip this.</li><li>Open <strong>Environment Variables</strong> and add the API address. In my project, two variables need it:</li></ol><pre>OPSLENS_API_URL=https://your-api.onrender.com<br>NEXT_PUBLIC_OPSLENS_API_URL=https://your-api.onrender.com</pre><ol><li>No slash at the end of the address.</li><li>Click <strong>Deploy</strong>.</li><li>When it finishes, Vercel gives you the website address, like https://your-site.vercel.app. Copy it.</li></ol><p>One thing worth knowing: variables that start with NEXT_PUBLIC_ are baked into the website when it is built. If you add or change one later, saving is not enough. You must <strong>redeploy</strong> for the change to take effect. This matters because your visitors’ browsers can only see NEXT_PUBLIC_ variables. Without it, my website tried to call localhost:4000, which only exists on my laptop.</p><h3>Step 5: Tell the API which website is allowed to call it</h3><p>Browsers have a safety rule called <strong>CORS</strong>. A website is only allowed to call an API if the API says “yes, I trust this website.” The API says this through a setting. In my project it is called WEB_ORIGIN.</p><ol><li>Go back to Render, open your API service, and click <strong>Environment</strong>.</li><li>Find WEB_ORIGIN. If it isn’t there, click <strong>Add Environment Variable</strong> and create it.</li><li>Set it to your website address:</li></ol><pre>WEB_ORIGIN=https://your-site.vercel.app</pre><ol><li>Save, and let Render redeploy. Wait until the service says <strong>Live</strong>.</li></ol><h3>The three mistakes I made</h3><p><strong>Mistake 1: I pasted the wrong address.</strong> My first attempt used the address of my Vercel <em>dashboard</em> (the page where I manage the project) instead of my <em>website</em>. The right address is the one visitors type to see your site.</p><p><strong>Mistake 2: I left a slash at the end.</strong> I wrote https://your-site.vercel.app/ instead of https://your-site.vercel.app.</p><p><strong>Mistake 3: I forgot to redeploy.</strong> Changing an environment variable does nothing to a deploy that already happened. Render needs to restart, and Vercel needs a redeploy for NEXT_PUBLIC_ variables.</p><h3>How to debug it yourself</h3><p>If your site says “Failed to fetch” or shows no data:</p><ol><li>Open your website, press <strong>F12</strong>, and go to the <strong>Console</strong> tab.</li><li>Read the red error. If it says <strong>CORS</strong>, look at the line that says Access-Control-Allow-Origin header has a value .... The browser is telling you what your API currently allows.</li><li>Compare that value with the address in your browser’s address bar. They must be identical. Any difference (a slash, http instead of https, a different Vercel address) is your bug.</li><li>If you see localhost:4000 in the error, your NEXT_PUBLIC_ variable is missing or you forgot to redeploy.</li><li>If nothing responds at all, open your API address directly in a new tab and check the <strong>Logs</strong> tab on Render for database errors.</li></ol><h3>Bonus: stop the API from falling asleep</h3><p>Render’s free plan puts your API to sleep after about 15 minutes without visitors. The next person who opens your site waits around a minute while it wakes up. For a portfolio project, that is not a great first impression.</p><p>A free fix is a scheduled job on GitHub that pings your API every 10 minutes:</p><ol><li>In your GitHub repository, go to <strong>Settings</strong>, then <strong>Secrets and variables</strong>, then <strong>Actions</strong>.</li><li>Open the <strong>Variables</strong> tab (not Secrets).</li><li>Click <strong>New repository variable</strong>.</li><li>Name it DEMO_API_URL and set the value to your Render API address.</li><li>My repository already has a workflow file that reads this variable and sends the ping. It only runs from the main branch, so make sure it has been merged.</li></ol><p>You can check that it works in the <strong>Actions</strong> tab of your repository. Free plans change over time, so check Render’s current terms, and note that GitHub can pause scheduled jobs in repositories that have been inactive for a long time.</p><h3>Final checklist</h3><ul><li>Code is merged into main</li><li>Neon connection string is the direct one, ending in ?sslmode=require</li><li>Render has the database string and a WEB_ORIGIN that exactly matches your website address</li><li>Vercel has the API address in both variables, with no slash at the end</li><li>You redeployed Vercel after changing any NEXT_PUBLIC_ variable</li><li>The browser console shows no red CORS errors</li></ul><h3>Final thoughts</h3><p>None of the individual steps are hard. The difficulty is that three separate services have to agree on each other’s addresses, and a single typo gives you a vague error like “Failed to fetch.” Once you understand that the API must explicitly trust your website, the error messages start to make sense, and the fix is usually one small change.</p><p>Here`s the link of my app if you want to check out:<br><a href="https://opslens-sigma.vercel.app/">https://opslens-sigma.vercel.app/</a></p><p>Happy deployment!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6e96457703e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Flex Box Default That Quietly Breaks Your React Layouts]]></title>
            <link>https://medium.com/@mdsenelen/the-flex-box-default-that-quietly-breaks-your-react-layouts-2fe72ef42ccd?source=rss-5d82c3acbe85------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fe72ef42ccd</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Merve Deniz Senelen]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 18:51:35 GMT</pubDate>
            <atom:updated>2026-11-18T13:05:22.340Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Flexbox Default That Quietly Breaks Your React Layouts</h3><h4>How conditional text rendering and align-items: stretch caused an invisible bug and the two-line fix.</h4><p>I’ve been rebuilding a side project (an AI melody generator) of mine. Most of that work is unglamorous: swapping out text-only loading states, writing unit tests, and stripping out unused dependencies.</p><p>Last week, I knocked out what felt like a minor cleanup task: replacing every scattered &quot;Uploading…&quot; and &quot;Generating…&quot;string with a single &lt;Spinner/&gt; component. Nine files touched, sixty tests passing, everything green.</p><p>Then I opened the app, hit upload, and watched one of my buttons suddenly balloon in height.</p><p>Side by side, I had two buttons: <strong>“Upload audio”</strong> and <strong>“Record audio.”</strong> Before uploading, they were identical heights. As soon as the upload completed, “Record audio” stretched vertically while “Upload audio” looked squashed right beside it.</p><p>My first thought: <em>The new spinner component blew up the button size.</em></p><p>I was completely wrong. And honestly, being wrong about it twice was the most educational part of the whole fix.</p><h4>The First Wrong Guess</h4><p>Since I’d just swapped a raw string for a component (one rendering a spinning SVG, a gap, and a label), it felt completely reasonable to suspect the component itself.</p><p>I jumped straight into the code I’d just touched. I read through the spinner, re-checked the button component, and double-checked the Tailwind sizing utility classes. Everything looked fine because… well, everything <em>was</em> fine.</p><p>It reminded me of a debugging lesson I have to relearn every few months:</p><p><strong>the code you just touched is often the trigger, but rarely the underlying cause.</strong></p><h4>What Was Actually Happening</h4><p>The “Record audio” button wasn’t expanding on its own. The “Upload audio” column was getting taller, dragging the Record button along for the ride.</p><p>Here’s the layout snippet from inside the upload button component:</p><pre>&lt;div className=&quot;flex flex-col items-start gap-3&quot;&gt;<br>  &lt;label className=&quot;...&quot;&gt;<br>    {isLoading ? &lt;Spinner label=&quot;Uploading&quot; size=&quot;sm&quot; /&gt; : &lt;span&gt;{label}&lt;/span&gt;}<br>    &lt;input type=&quot;file&quot; onChange={handleFile} className=&quot;absolute inset-0 opacity-0&quot; /&gt;<br>  &lt;/label&gt;<br>  {status ? &lt;p className=&quot;text-sm text-gray-300&quot;&gt;{status}&lt;/p&gt; : null}<br>&lt;/div&gt;</pre><p>Notice the conditional rendering on the last line. Before an upload starts, status is empty, so the &lt;p&gt; tag doesn&#39;t exist in the DOM. Once the upload finishes, status turns into &quot;Upload complete&quot;, mounting the paragraph element into the layout.</p><p>That single line of text adds roughly 20px of height, plus the vertical gap above it. The entire left column suddenly grows by ~30px.</p><p>So why did that force the <em>other</em> button to get taller too?</p><h4>The Flexbox Default Nobody Warns You About</h4><p>Both buttons live inside a parent flex row. By default, flex containers apply an alignment rule you almost certainly didn’t request explicitly.</p><p>While the initial CSS spec value for align-items is normal, for flex items it acts identically to stretch:</p><pre>align-items: normal; /* behaves like stretch for flex items */</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*G-24xqbciNSjG4lxSqkV-Q.png" /><figcaption>Diagram from A Complete Guide to Flexbox on CSS-Tricks. Notice stretch: it’s what runs when you leave align-items untouched.</figcaption></figure><p>Unless you override it, every child inside a flex row stretches vertically to match the height of whichever sibling happens to be the tallest.</p><p>It’s worth keeping the axes straight here. In a standard flex row, the main axis runs horizontally, while the cross axis runs vertically. align-items dictates cross-axis behavior, meaning inside a row, align-items controls height, despite items sitting side-by-side.</p><p>Here’s how the DOM chain reaction played out:</p><ol><li><strong>Upload completes</strong> → status text mounts inside the left column.</li><li><strong>The left column expands by ~30px</strong> to make room for the text.</li><li><strong>The flex row’s cross-axis height expands</strong> to match its new tallest child.</li><li><strong>“Record audio” stretches vertically</strong> to match that height.</li></ol><p>The Record button had no status text and no internal reason to grow, it was just blindly following default flexbox rules.</p><h4>Two Potential Fixes (and Wrong Guess #2)</h4><p>To solve this, I had two reasonable options:</p><ul><li><strong>Option 1: Disable stretching.</strong> Add items-start (align-items: flex-start) to the flex row so items size purely to their own content.</li><li><strong>Option 2: Reserve vertical space.</strong> Keep the paragraph mounted permanently with a fixed minimum height so the container height never shifts.</li></ul><pre>&lt;p className=&quot;min-h-[1.25rem] text-sm text-gray-300&quot; aria-live=&quot;polite&quot;&gt;<br>  {status}<br>&lt;/p&gt;</pre><p>I went straight for Option 2. It felt cleaner. Option 1 would stop the button height mismatch, but the overall row height would still jump whenever status text appeared, pushing layout elements below it down the page. Option 2 seemed to kill both issues at once.</p><p>I updated the code, checked the UI, and… the buttons were still mismatched.</p><p>In fact, it was worse: now they were mismatched <em>immediately on page load</em>, before I even touched the upload button.</p><p>Reserving space prevented the layout jump, but it also made the upload column permanently 30px taller than the Record column. The status text mounting wasn’t <em>causing</em> the stretch, it was just the trigger that made an existing flexbox default visible. By reserving space, I had turned a temporary UI bug into a permanent one.</p><p>The parent row was always stretching; I’d just never told it to stop.</p><h4>The Solution: Combining Both Fixes</h4><pre>/* Parent flex container */<br>&lt;div className=&quot;flex flex-wrap items-start gap-3&quot;&gt;<br><br>/* Child status paragraph */<br>&lt;p className=&quot;min-h-[1.25rem] text-sm text-gray-300&quot; aria-live=&quot;polite&quot;&gt;<br>  {status}<br>&lt;/p&gt;</pre><p>Here’s why both are necessary:</p><ul><li><strong>items-start (</strong><strong>align-items: flex-start) handles sibling height decoupling.</strong> It forces elements to size to their own content instead of stretching to match siblings. Used alone, the Record button stops growing, but mounting status text still causes a vertical layout shift for elements below.</li><li><strong>min-h-[1.25rem] handles height stability over time.</strong> It reserves line space so container height stays constant across state changes. Used alone, it prevents layout shift, but the extra height triggers default stretch, making Record permanently taller on load.</li></ul><p>Together, they solve both problems: decoupled sibling heights and zero layout shift.</p><p>Treating these as mutually exclusive choices was the wrong mental model. They target different problems: one handles how sibling elements relate to each other in layout, while the other handles how a single element handles state-driven content changes over time.</p><h4>Clean CSS vs. JSX Hacks</h4><p>If you’ve run into empty &lt;p&gt; tags collapsing before, you might be tempted to force height with a non-breaking space:</p><pre>{/* The quick hack */}<br>&lt;p&gt;{status || &#39;\u00A0&#39;}&lt;/p&gt;</pre><p>While &amp;nbsp; forces a line box to render, using min-h-[1.25rem] keeps layout constraints where they belong: in CSS. It maintains box height cleanly without dropping invisible characters into your JSX.</p><h4>Bonus: An Unexpected Accessibility Win</h4><p>Keeping the paragraph element mounted continuously in the DOM had an unexpected side effect: it fixed screen reader support.</p><p>When dynamic status updates are conditionally mounted and unmounted from scratch, screen readers often miss the state change entirely. A user relying on assistive tech might complete an upload and receive zero audible feedback.</p><p>Because the &lt;p&gt; container now lives in the DOM permanently, aria-live=&quot;polite&quot; works reliably. The accessibility tree connects to the live region on initial page render, ensuring updates are announced smoothly when status changes to &quot;Upload complete&quot;.</p><h4>Preventing Layout Shifts(CLS)</h4><p>Even minor visual shifts carry real performance implications. In web performance metrics, this kind of vertical jumping is measured as <strong>Cumulative Layout Shift (CLS)</strong> , one of Google’s Core Web Vitals.</p><p>Conditional React patterns like {condition ? &lt;Component/&gt; : null} are frequent drivers of layout shift. That doesn&#39;t mean you should abandon conditional rendering, it just means keeping an eye on container geometry when elements mount and unmount.</p><h4>Key Takeaways</h4><ol><li><strong>Check the parent container first.</strong> When an element resizes unexpectedly, look at its siblings and parent wrapper before blaming the element itself.</li><li><strong>Watch out for implicit CSS defaults.</strong> Behaviors like align-items: stretch cause far more layout surprises than explicitly declared styles.</li><li><strong>Don’t rely solely on automated tests for UI fixes.</strong> All 60 unit tests passed after my first “fix.” Only visual inspection revealed I’d just transformed the bug rather than solving it.</li><li><strong>A symptom change isn’t a solution.</strong> Turning an intermittent layout glitch into a permanent one was a clear sign I hadn’t properly identified the root cause yet.</li></ol><p>In the end, the fix took just two lines across two files. Uncovering <em>why</em> those two lines were necessary took much longer, which is pretty much standard operating procedure for CSS debugging.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fe72ef42ccd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>