<?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 Onur Kapucu on Medium]]></title>
        <description><![CDATA[Stories by Onur Kapucu on Medium]]></description>
        <link>https://medium.com/@kapucuonur?source=rss-2e90bd1a7f31------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GRyEOIwyTXGMTEtG4QhdqQ.jpeg</url>
            <title>Stories by Onur Kapucu on Medium</title>
            <link>https://medium.com/@kapucuonur?source=rss-2e90bd1a7f31------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 02:01:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kapucuonur/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[The Hardware Behind It: Sourcing and Setting Up a Pi 5 Production Server]]></title>
            <link>https://kapucuonur.medium.com/the-hardware-behind-it-sourcing-and-setting-up-a-pi-5-production-server-52ccf1384c56?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/52ccf1384c56</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Fri, 24 Jul 2026 18:04:40 GMT</pubDate>
            <atom:updated>2026-07-24T18:04:40.438Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RmIaVkuBVWJsHTJncZCjAw.png" /><figcaption>Pi 5 Production</figcaption></figure><p><em>Part 2 of a series on running a production AI stack on a Raspberry Pi 5</em></p><p>In the last post I explained why I moved my AI startup’s backend off the cloud and onto a Raspberry Pi 5. This time I want to get concrete: what I actually bought, where, and how the storage is laid out on a box that now runs production traffic for two products.</p><h3>What I bought</h3><p>I ordered the board through reichelt.com: a Seeed Studio reComputer AI R2140–12. It’s not a bare Raspberry Pi 5 it’s a purpose-built edge AI unit that bundles the Pi 5 board with a Hailo-8 M.2 AI accelerator module, an aluminum enclosure with active cooling, and the connectivity you’d expect from a small server rather than a hobbyist kit.</p><p>The core spec sheet:</p><ul><li><strong>Processor</strong>: Raspberry Pi 5, 2.4GHz quad-core ARM Cortex-A76</li><li><strong>AI accelerator</strong>: Hailo-8 M.2 module, up to 26 TOPS</li><li><strong>RAM</strong>: 16GB LPDDR4X</li><li><strong>GPU</strong>: Broadcom VideoCore VII</li><li><strong>Storage interfaces</strong>: 2× M.2 PCIe 3.0 slots (one taken by the Hailo-8, one free for an NVMe SSD), plus a microSD slot</li><li><strong>Networking</strong>: Gigabit Ethernet, dual-band 802.11ac Wi-Fi, Bluetooth 5.0</li><li><strong>I/O</strong>: 2× USB 3.0, 2× USB 2.0, 2× micro HDMI, 40-pin GPIO</li><li><strong>Power</strong>: 5V/5A via USB-C</li><li><strong>Dimensions</strong>: 94 × 63 × 45mm</li></ul><p>It ships with the original enclosure and a stock USB-C power delivery charger no third-party PSU needed, which matters more than it sounds like once you’re running an NVMe drive and an NPU under sustained load.</p><h3>The storage layout</h3><p>This is the part that trips people up with Pi-based servers, so I’ll be specific about what’s doing what:</p><ul><li><strong>16GB microSD card </strong>used only to bootstrap the initial OS install. I flashed Raspberry Pi OS to it, booted once, and used that boot to write the real OS onto the NVMe drive. After that, the SD card came out entirely.</li><li><strong>2TB NVMe SSD (Samsung 990 EVO Plus) </strong>this is the actual system disk. Root filesystem, Docker images, containers, application code, Postgres data all of it lives here.</li><li><strong>~1TB USB SSD </strong>external storage, mounted separately, used for backups and bulk data rather than the running system.</li></ul><p>Here’s the real output from the box, lsblk and df -h, so you can see exactly how it&#39;s partitioned:</p><pre>$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,MODEL<br>NAME          SIZE TYPE MOUNTPOINT     MODEL<br>sda         931.5G disk                XS1000<br>└─sda1      931.5G part /mnt/pcloud<br>nvme0n1       1.8T disk                Samsung SSD 990 EVO Plus 2TB<br>├─nvme0n1p1   512M part /boot/firmware<br>└─nvme0n1p2   1.8T part /</pre><pre>$ df -h<br>Filesystem      Size  Used Avail Use% Mounted on<br>/dev/nvme0n1p2  1.8T  191G  1.6T  11% /<br>/dev/nvme0n1p1  511M   81M  431M  16% /boot/firmware<br>/dev/sda1       916G  5.2G  865G   1%  /mnt/pcloud</pre><p>Notice there’s no SD card device listed at all it’s not a leftover boot dependency, it’s genuinely gone. The system boots straight from the NVMe drive’s first partition, and eleven months of production containers, images, and a Postgres database still leave 1.6TB free.</p><h3>Why this layout, specifically</h3><p>Booting from NVMe instead of the SD card isn’t a nice-to-have SD cards are slow and, more importantly, wear out fast under the kind of write load a production database and container runtime generate. Treating the SD card as a one-time installer rather than permanent storage was a deliberate choice, not an afterthought.</p><p>Splitting the USB SSD out as a separate mount rather than extending the root filesystem onto it keeps a clean boundary: anything under /mnt is backups and bulk data, anything under / is the live system. If the USB drive ever gets disconnected or fails, the production stack on NVMe doesn&#39;t even notice.</p><h3>What’s next</h3><p>In the next post, I’ll walk through the actual software stack sitting on top of this hardware: Docker, Portainer, Nginx, Cloudflare Tunnels, Tailscale, and Postgres how they’re wired together, and the specific configs that make one small box behave like a real production environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52ccf1384c56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I Moved My AI Startup Off the Cloud]]></title>
            <link>https://kapucuonur.medium.com/why-i-moved-my-ai-startup-off-the-cloud-4438663e7d82?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/4438663e7d82</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 08:41:04 GMT</pubDate>
            <atom:updated>2026-07-22T08:42:56.495Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 1 of a series on running a production AI stack on a Raspberry Pi 5</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-oZsZ_SE_4ZisGy4uv_7Iw.png" /><figcaption>From cloud to circuit: trading managed infrastructure for a Raspberry Pi 5 on my desk.</figcaption></figure><p>A few months ago, my monthly cloud bill for a solo, pre-revenue AI startup looked exactly like a startup that was scaling except I wasn’t. I was paying for headroom I didn’t need, latency I couldn’t control, and a stack I didn’t fully own. So I did something that sounds almost absurd on paper: I moved my production backend off Render and Supabase and onto a Raspberry Pi 5 sitting on my desk.</p><p>This is the story of why, and the first post in a series about what it actually took to make that work.</p><h3>The setup, before</h3><p>I run TriHonor Oy, a one-person software company out of Tampere, Finland. My two main products CoachOnurAI, an AI triathlon coaching platform, and BikeFit AI, a computer-vision bike fitting tool were both running on fairly standard indie-hacker infrastructure: Render for compute, Supabase for the database. It worked. It was also expensive relative to what a single founder with modest traffic actually needs, and it put a layer of abstraction between me and the thing I most wanted to understand: how my own system behaves under real load.</p><p>There’s also a second, less financial reason. BikeFit AI does real-time pose estimation video-heavy, compute-heavy work. Running that well on generic cloud CPU instances meant either paying for GPU-adjacent pricing or accepting mediocre inference speed. Neither felt right for a bootstrapped company.</p><h3>Enter the Pi 5</h3><p>The hardware I landed on is not the Raspberry Pi most people picture. It’s a Seeed Studio reComputer AI R2140–12: a Raspberry Pi 5 with 16GB of RAM, a 2TB NVMe drive, and the part that mattered most a Hailo-8 NPU delivering 26 TOPS of dedicated AI inference performance. On paper it looks like a hobbyist board. In practice it’s a small, silent, always-on production server with enough dedicated AI silicon to run real-time pose estimation without breaking a sweat.</p><p>The pitch to myself was simple: own the hardware once, stop renting compute forever, and get a machine purpose-built for the one thing my product actually needs fast inference.</p><h3>What actually moved</h3><p>Both CoachOnurAI and a supporting Blog app were migrated to self-hosted Docker containers with git-based CI/CD, replacing the Render deployments entirely. The database moved off Supabase onto a self-managed PostgreSQL instance. Everything now sits behind Nginx, reachable securely through Cloudflare Tunnels, with Tailscale giving me private SSH access to the box from anywhere without opening a single port to the public internet.</p><p>None of this happened in one weekend. It happened service by service, with rollback plans, because a solo founder moving production traffic off managed infrastructure has exactly one engineer on call: me.</p><p>For a taste of what “self-hosted” looks like in practice, here’s roughly the shape of a Cloudflare Tunnel route pointing traffic at a container running on the Pi:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kKSVGypaM2bvx9FFxsn5Iw.png" /></figure><pre>tunnel: trihonor-pi5<br>credentials-file: /home/pi/.cloudflared/creds.json</pre><pre>ingress:<br>  - hostname: coachonurai.com<br>    service: <a href="http://localhost:8000/">http://localhost:8000</a><br>  - hostname: bikefit-api.coachonurai.com<br>    service: <a href="http://localhost:8001/">http://localhost:8001</a><br>  - service: http_status:404</pre><p>No open inbound ports, no public IP exposed just an outbound tunnel from the Pi to Cloudflare’s edge, mapping each subdomain to a local service. It’s a small config file, but it’s doing the job a load balancer and a firewall ruleset would normally do on a cloud platform.</p><h3>What I got back</h3><p>The obvious answer is cost. Owning the hardware outright and paying only for electricity and bandwidth is a different economic model than metered cloud compute, and for a pre-revenue product that difference matters.</p><p>But the bigger win was control. When something breaks at 2am, I’m not filing a support ticket and waiting I’m SSH’d into a machine I understand completely, with logs I can actually read end to end. When BikeFit AI needed hardware-accelerated inference, I wasn’t negotiating with a cloud provider’s GPU pricing tiers I was writing a GStreamer pipeline against an NPU sitting eighteen inches from my keyboard.</p><p>There’s a trade-off, obviously. A single Pi 5 is a single point of failure in a way a managed cloud platform isn’t, by default. That tension and how I’ve been closing the gap with monitoring, automated healing, and defensive infrastructure is exactly where this series is headed next.</p><h3>What’s next</h3><p>In the next post, I’ll go under the hood of the actual stack running on the Pi: Docker, Portainer, Nginx, Cloudflare Tunnels, Tailscale, and Postgres, and how they fit together to make one small box behave like a real production environment.</p><p>After that, I’ll get into the part of this project that turned into its own product: a self-healing SRE daemon I built to watch over this infrastructure autonomously including the week it almost deleted a production file, and what I changed after that.</p><p>If you’re building something small and wondering whether “just self-host it” is a real option in 2026, I think the answer is yes with caveats. Follow along and I’ll show you exactly where those caveats are.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4438663e7d82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Local AI Coding Agents on macOS: How I Bypassed an Xcode Wall to Get OpenCode + Ollama…]]></title>
            <link>https://kapucuonur.medium.com/running-local-ai-coding-agents-on-macos-how-i-bypassed-an-xcode-wall-to-get-opencode-ollama-27603d4179d0?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/27603d4179d0</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 11:35:47 GMT</pubDate>
            <atom:updated>2026-07-19T11:35:47.476Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*U3F8iSnOBuqSdD8IpVRI9A.png" /><figcaption>opencode on terminal</figcaption></figure><h3>Running Local AI Coding Agents on macOS: How I Bypassed an Xcode Wall to Get OpenCode + Ollama Working</h3><h3>A quick fix for anyone stuck installing OpenCode on Apple Silicon because of an outdated Xcode toolchain no multi-gigabyte upgrade required.</h3><p>Autonomous local coding agents are quickly replacing simple autocomplete plugins. Running one locally means your source code never leaves your machine, you pay nothing per API call, and you get to put your Apple Silicon GPU to actual use.</p><p>Setting this up on macOS, though, isn’t always smooth. Here’s the problem I ran into and the fix while wiring up the local coding agent <strong>OpenCode</strong> to <strong>Ollama</strong> running <strong>Qwen 2.5 Coder (32B)</strong>.</p><h3>The Setup: Brain vs. Hands and Feet</h3><p>Before getting into the fix, it helps to separate the two moving parts of a local agentic setup:</p><ul><li><strong>The brain — Ollama.</strong> Ollama is the local runtime that loads and serves LLM weights, like qwen2.5-coder:32b. It handles reasoning and code generation, but has zero ability to touch your files or run anything on its own.</li><li><strong>The hands and feet — OpenCode.</strong> OpenCode (anomalyco/opencode) is the agent layer. It reads your workspace, edits code, runs terminal commands (npm test, flutter run, etc.), inspects the output, and loops back to fix errors automatically.</li></ul><h3>The Problem: An Outdated Xcode Blocks Homebrew</h3><p>The documented way to install OpenCode on macOS is Homebrew:</p><pre>brew install anomalyco/tap/opencode</pre><p>If your Xcode or Command Line Tools version has drifted behind your macOS version, Homebrew refuses to compile and throws this:</p><pre>Error: Your Xcode (26.6) at /Applications/Xcode.app is too outdated.<br>Please update to Xcode 27.0 (or delete it).<br>Error: Your Command Line Tools are too outdated.</pre><p>The obvious fix updating Xcode is a multi-gigabyte download that can eat an afternoon and disrupt whatever you’re already working on. Turns out, you don’t need it.</p><h3>The Fix: Skip Homebrew, Use npx Instead</h3><p>OpenCode is just an npm package under the hood. Instead of routing through Homebrew’s compiled binary (and its Xcode dependency), you can run it directly with Node’s package runner, npx. This sidesteps the compiler checks entirely.</p><p>First, confirm Node and npm are installed:</p><pre>npm --version</pre><p>Then just run the package with npx — no global install, no compilation:</p><pre>npx opencode-ai</pre><p>The first run downloads and launches the latest verified version instantly.</p><h3>Wiring OpenCode Up to Local Ollama</h3><p>Next, point OpenCode at your local Ollama instance via its global config file.</p><p>Create the config directory:</p><pre>mkdir -p ~/.config/opencode</pre><p>Then create or edit ~/.config/opencode/opencode.json:</p><pre>{<br>  &quot;model&quot;: &quot;ollama/qwen2.5-coder:32b&quot;,<br>  &quot;provider&quot;: {<br>    &quot;ollama&quot;: {<br>      &quot;npm&quot;: &quot;@ai-sdk/openai-compatible&quot;,<br>      &quot;name&quot;: &quot;Ollama&quot;,<br>      &quot;options&quot;: {<br>        &quot;baseURL&quot;: &quot;http://localhost:11434/v1&quot;<br>      },<br>      &quot;models&quot;: {<br>        &quot;qwen2.5-coder:32b&quot;: {<br>          &quot;name&quot;: &quot;qwen2.5-coder:32b&quot;<br>        }<br>      }<br>    }<br>  }<br>}</pre><h3>Why Qwen 2.5 Coder (32B)?</h3><p>Agentic coding needs a model that’s reliable at <strong>tool calling </strong>knowing when to read a file, write a file, or fire off a command. Qwen 2.5 Coder (32B) currently holds up well against that bar for local, offline coding on an Apple Silicon Mac with 32GB+ of RAM.</p><p>Pull the model if you haven’t already:</p><pre>ollama pull qwen2.5-coder:32b</pre><h3>Verifying It Works</h3><p>Check that OpenCode picked up the local model:</p><pre>npx opencode-ai models</pre><p>You should see ollama/qwen2.5-coder:32b in the list of active providers.</p><p>To start an interactive session, cd into your project and run:</p><pre>npx opencode-ai</pre><p>This opens the terminal UI. Use @ to pull specific files into context (e.g. @App.jsx), then ask the agent to implement features, fix bugs, or run tests.</p><p>For one-off tasks, skip the interactive mode entirely:</p><pre>npx opencode-ai run &quot;Refactor utility functions to use async/await&quot;</pre><h3>Takeaway</h3><p>If Homebrew blocks your OpenCode install over an Xcode version mismatch, don’t waste an afternoon updating Xcode. Run it through npx instead, point it at a local Ollama server, and you&#39;ve got a private, zero-cost, production-ready coding agent running entirely on your own machine.</p><p>Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27603d4179d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[# How to Run Any Open-Source AI Model Inside Claude Code (For Free)]]></title>
            <link>https://kapucuonur.medium.com/how-to-run-any-open-source-ai-model-inside-claude-code-for-free-a925e7d14fd6?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/a925e7d14fd6</guid>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 07:41:59 GMT</pubDate>
            <atom:updated>2026-05-22T08:49:49.023Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Run Any Open-Source AI Model Inside Claude Code (For Free)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KscDtcafypcXkk6E62JF1A.png" /><figcaption>How to Run Any Open-Source AI Model Inside Claude Code</figcaption></figure><h3>A practical guide to replacing Claude’s backend with Gemma 4, DeepSeek, Llama, and more using Ollama.</h3><p>Most developers using <strong>Claude Code</strong> don’t realize they have a choice about which AI model powers it. By default, Claude Code connects to Anthropic’s cloud API which is incredibly powerful, but quickly racks up token costs.</p><p>What if you could keep Claude Code’s entire agentic workflow engine and plug in a free, locally running model instead?</p><p>Nothing goes to the cloud. No API costs. Your code stays entirely on your machine. Here is a practical guide on how to set it up in less than five minutes.</p><h3>Understanding the Architecture</h3><p>Before touching the terminal, it’s worth understanding what’s actually happening under the hood.</p><p><strong>Claude Code is not a model.</strong> It’s an <em>agentic shell</em> a command-line interface that handles file reading, code editing, terminal execution, git operations, and multi-step task planning. The AI model is a separate component that Claude Code queries over an API.</p><p>By default, that API points to Anthropic’s servers. But Claude Code doesn’t actually care which server it talks to, as long as the server speaks the right protocol.</p><p><strong>Ollama</strong> is a tool that runs open-source models locally and exposes them through an OpenAI-compatible API endpoint. Because Claude Code can communicate with OpenAI-compatible pathways, we can easily redirect its traffic.</p><p>The full local stack looks like this:</p><pre>You (terminal)<br>    ↓<br>Claude Code  ← Agentic shell, file access, task planning<br>    ↓<br>Ollama API   ← Local server running at http://localhost:11434/v1<br>    ↓<br>Gemma 4 / DeepSeek / Llama ← Running locally on your GPU/CPU</pre><h3>Prerequisites</h3><p>To follow this guide, you will need:</p><ul><li><strong>OS:</strong> macOS, Linux, or Windows (via WSL)</li><li><strong>Ollama Installed:</strong> Download it from <a href="https://ollama.com/">ollama.com</a></li><li><strong>Node.js:</strong> Version 18 or higher</li><li><strong>Claude Code</strong> installed on your system</li></ul><h3>Step 1: Install and Verify Ollama</h3><p>If you haven’t already, download Ollama, fire up your terminal, and pull a model. For coding tasks, Google’s <strong>Gemma 4 (31B)</strong> is highly recommended:</p><pre>ollama pull gemma4:31b</pre><blockquote><em>💡 </em><strong><em>Hardware Tip:</em></strong><em> The 31B dense model requires around 19–20GB of disk space and runs beautifully on Apple Silicon (M-series Macs) or consumer GPUs with 24GB VRAM. If your hardware is more constrained, Ollama’s lighter models (like </em><em>qwen2.5-coder:7b or </em><em>llama3.1:8b) are fantastic, lightweight alternatives.</em></blockquote><p>Verify that the model downloaded successfully:</p><pre>ollama list</pre><p>You should see an output similar to this:</p><pre>NAME         ID              SIZE    MODIFIED<br>gemma4:31b   a1b2c3d4e5f6    19 GB   2 minutes ago</pre><p>Make note of the exact model name under the NAME column; you will need it for Step 3. Finally, ensure your local Ollama server is running:</p><pre>ollama serve</pre><p><em>(Ollama will now be actively listening for requests at </em><a href="http://localhost:11434)http://localhost:11434"><em>http://localhost:11434)</em></a><a href="http://localhost:11434)http://localhost:11434">http://localhost:11434</a></p><h3>Step 2: Install Claude Code</h3><p>If you haven’t installed Anthropic’s official CLI tool yet, install it globally via npm:</p><pre>npm install -g @anthropic-ai/claude-code</pre><p>Verify that it’s ready to go:</p><pre>claude --version</pre><h3>Step 3: Connect Claude Code to Your Local Model</h3><p>This is where the magic happens. By overriding two environment variables, you can trick Claude Code into routing its traffic away from Anthropic’s servers and directly into your local Ollama instance:</p><pre>ANTHROPIC_BASE_URL=http://localhost:11434/v1 \<br>ANTHROPIC_API_KEY=ollama \<br>claude --model gemma4:31b</pre><h3>Breakdown of the command:</h3><ul><li>ANTHROPIC_BASE_URL: Redirects API requests from the cloud to your local machine.</li><li>ANTHROPIC_API_KEY: Claude Code&#39;s client requires <em>something</em> to be entered here to initialize. Ollama doesn&#39;t validate it, so any random string (like ollama) works perfectly.</li><li>--model: Tells the client exactly which local model to call. This must match your ollama list output.</li></ul><p>If everything is configured correctly, Claude Code will boot up normally, but your terminal/GPU will spin up as it processes your queries locally!</p><h3>Swapping to Other Open-Source Models</h3><p>This approach isn’t limited to Gemma. You can swap in any model that Ollama supports. Just pull the model first using ollama pull, then substitute it into the launch command:</p><h3>DeepSeek R1 (32B)</h3><pre>ANTHROPIC_BASE_URL=http://localhost:11434/v1 \<br>ANTHROPIC_API_KEY=ollama \<br>claude --model deepseek-r1:32b</pre><h3>Meta Llama 3.3 (70B)</h3><pre>ANTHROPIC_BASE_URL=http://localhost:11434/v1 \<br>ANTHROPIC_API_KEY=ollama \<br>claude --model llama3.3:70b</pre><h3>Alibaba Qwen 2.5 Coder (32B)</h3><pre>ANTHROPIC_BASE_URL=http://localhost:11434/v1 \<br>ANTHROPIC_API_KEY=ollama \<br>claude --model qwen2.5-coder:32b</pre><h3>What Works vs. What Doesn’t</h3><p>Claude Code’s agentic capabilities heavily depend on how well the underlying model follows tool-use instructions and handles structured JSON output. Because models like Gemma 4 and Qwen 2.5 Coder have native function-calling capabilities, they are a great fit.</p><p>However, you should keep expectations realistic compared to hosted frontier models.</p><h3>✅ What works surprisingly well:</h3><ul><li>Reading, analyzing, and editing files across an entire local project workspace.</li><li>Executing terminal commands and running tests automatically.</li><li>Explaining complex legacy code.</li><li>Making targeted, well-scoped git commits and code refactors.</li></ul><h3>⚠️ Where it might underperform:</h3><ul><li>Massive, ambiguous multi-step reasoning chains spanning dozens of files.</li><li>Highly complex, abstract architectural redesigns where Claude 3.7 Sonnet normally excels.</li></ul><p>For day-to-day debugging, boilerplate generation, and local scripting, the local trade-off is absolutely worth it.</p><h3>Why This Changes the Game</h3><p>The open-source AI ecosystem has reached a massive tipping point. Gemma 4’s 31B model ranks highly on global LLM leaderboards, operates under an Apache 2.0 license, and costs nothing to use.</p><p>By marrying open-source weights with Claude Code’s advanced developer toolchain, you unlock:</p><ol><li><strong>Zero API Costs:</strong> No more keeping an eye on your Anthropic billing dashboard during heavy coding sessions.</li><li><strong>Absolute Data Privacy:</strong> Your proprietary source code, environment variables, and local data never leave your physical hard drive.</li><li><strong>Offline Capability:</strong> Keep building, refactoring, and committing even when you’re completely off the grid.</li></ol><h3>Quick Reference Cheat Sheet</h3><p>Save these commands for your daily workflow:</p><pre># 1. Pull your model of choice<br>ollama pull gemma4:31b</pre><pre># 2. Make sure the local server is running<br>ollama serve</pre><pre># 3. Launch Claude Code locally<br>ANTHROPIC_BASE_URL=http://localhost:11434/v1 ANTHROPIC_API_KEY=ollama claude --model gemma4:31b</pre><pre># 4. Launch Claude Code normally (Anthropic Cloud)<br>claude</pre><p><em>Tested on macOS Sequoia with an Apple M-series chip running Ollama 0.6.x. Model availability, generation speed, and performance characteristics will vary based on your local system hardware specs.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a925e7d14fd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving the Last-Mile Problem: Building a Full-Stack Route Optimizer from Scratch]]></title>
            <link>https://kapucuonur.medium.com/solving-the-last-mile-problem-building-a-full-stack-route-optimizer-from-scratch-537fa0ab7366?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/537fa0ab7366</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Thu, 29 Jan 2026 11:53:15 GMT</pubDate>
            <atom:updated>2026-01-29T11:53:15.980Z</atom:updated>
            <content:encoded><![CDATA[<p>How I combined Python’s algorithmic power with Flutter’s UI to visualize real-world logistics.</p><p><strong>Logistics is more than just moving things from A to B.</strong> It is a complex mathematical puzzle involving time, distance, and geometry. As software engineers, we often hear about the “Traveling Salesperson Problem” (TSP) in textbooks, but seeing it come to life on a real map is a completely different experience.</p><p>This weekend, I decided to tackle this classic computer science problem by building a <strong>Full-Stack Delivery Route Optimizer</strong>. My goal was simple: take a list of random delivery stops in Tampere, Finland, and calculate the most efficient path for a courier to follow.</p><p>Here is a deep dive into how I built it, the technologies I chose, and the challenges I faced in moving from theoretical algorithms to real-world street routing.</p><h3>The Tech Stack: Best of Both Worlds</h3><p>To build a robust solution, I needed a powerful backend for calculations and a responsive frontend for visualization. I chose a microservices-based architecture:</p><ul><li><strong>The Brain (Backend):</strong> Python &amp; Flask.</li><li><strong>The Face (Mobile App):</strong> Flutter &amp; Dart.</li></ul><p>I chose <strong>Python</strong> for the backend because of its dominance in data science and algorithmic processing. For the mobile app, <strong>Flutter</strong> was the obvious choice due to its widget-based architecture and the excellent flutter_map ecosystem.</p><h3>Step 1: The Backend Logic (The Algorithm)</h3><p>The core of this project is the optimization engine. When a courier starts their shift, they might have 10 different packages to deliver. Visiting them in a random order is inefficient and costs time and fuel.</p><p>I implemented a RESTful API using <strong>Flask</strong>. When the mobile app sends a request, the Python server:</p><ol><li>Receives the courier’s current location (Depot).</li><li>Receives a list of pending delivery stops.</li><li>Runs a <strong>Nearest Neighbor Algorithm</strong>.</li></ol><p>The algorithm works by acting “greedy.” It looks at the current location, calculates the distance to all unvisited nodes, picks the closest one, and repeats the process until all stops are visited. Finally, it guides the courier back to the depot.</p><h3>Step 2: The Frontend Visualization (The Map)</h3><p>On the Flutter side, I needed to display these coordinates on a map. I used flutter_map with OpenStreetMap tiles.</p><p>At first, I simply drew lines between the sorted coordinates. This resulted in “Euclidean Distance” visualization straight lines connecting points as the crow flies.</p><p>While mathematically correct, this looked unrealistic. Couriers don’t fly over buildings; they drive on streets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*yzA-20U8e-i5QtsuAC2QtA.png" /><figcaption>The initial version using straight-line geometry.</figcaption></figure><h3>Step 3: From Math to Reality (Street Routing)</h3><p>This was the turning point of the project. To make the application production-ready, I had to account for <strong>Road Geometry</strong>.</p><p>I upgraded the system to fetch route data from an OSRM (Open Source Routing Machine) service instead of drawing simple polylines. Now, when the Python backend returns the optimized order of stops (A -&gt; B -&gt; C), the Flutter app queries the routing service to get the actual shape of the road connecting A to B.</p><p>The result was a drastic improvement in user experience. The blue route line now follows the streets of Tampere, respecting turns, one-way streets, and intersections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*gQN76AKdBs5Fp7_g5fF2YA.png" /><figcaption>The final version utilizing OpenStreetMap routing for realistic pathfinding.</figcaption></figure><h3>Conclusion</h3><p>Building this project reinforced an important lesson: <strong>Algorithms are only as good as their implementation.</strong></p><p>A Nearest Neighbor algorithm is just a math concept until you wrap it in an API, consume it with a mobile app, and visualize it on a real map. This project bridges the gap between abstract computer science concepts and tangible, real-world utility.</p><p>Whether you are optimizing delivery routes for a global logistics company or just planning your errands for the day, the code behind the map makes all the difference.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=537fa0ab7366" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Real Meaning of “Full Stack” in 2025]]></title>
            <link>https://kapucuonur.medium.com/the-real-meaning-of-full-stack-in-2025-0287df201120?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/0287df201120</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[full-stack-developer]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Sat, 13 Dec 2025 10:09:47 GMT</pubDate>
            <atom:updated>2026-07-22T08:55:30.236Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*tn0HUC7VUBEp5YYI0BjNJA.png" /><figcaption>full stack</figcaption></figure><p>In 2025, Artificial Intelligence (AI) and automation are core to the full stack landscape. Full stack developers leverage AI-driven tools to boost productivity, automate repetitive tasks, and enable smarter, adaptive user experiences. AI is embedded throughout development from code generation and testing to infrastructure management and intelligent monitoring transforming developers into architects of intelligent systems.</p><p>For years, the term “Full Stack Developer” has been synonymous with someone who can build both the frontend and backend of an application. But in 2025, that definition is no longer sufficient.</p><p>Modern software development demands a broader, deeper understanding of the entire engineering ecosystem. Being “Full Stack” today means navigating a complex landscape of technologies, tools, and responsibilities that go far beyond just UI and APIs.</p><h3>What Full Stack Truly Means Today</h3><p>Here’s a breakdown of the layers that make up the actual full stack in today’s development world:</p><ul><li><strong>Frontend</strong>: Crafting responsive, accessible interfaces with optimized UX, state management, and performance tuning.</li><li><strong>Backend</strong>: Designing robust APIs, implementing business logic, managing integrations, and ensuring scalability and uptime.</li><li><strong>Database</strong>: Mastering SQL/NoSQL, schema design, query optimization, replication, and data modeling.</li><li><strong>Server Management</strong>: Deploying and configuring servers, handling load balancing, and managing runtime environments.</li><li><strong>Networking</strong>: Understanding DNS, routing, firewalls, proxies, and VPNs — the invisible infrastructure that keeps apps connected.</li><li><strong>Cloud Infrastructure</strong>: Leveraging AWS, Azure, or GCP for compute, storage, monitoring, IAM, and automation.</li><li><strong>CI/CD Pipelines</strong>: Automating testing, builds, and deployments to ensure smooth and reliable delivery cycles.</li><li><strong>Security</strong>: Addressing app and network security, encryption, identity management, vulnerability handling, and compliance standards like OWASP, ISO, and SOC.</li><li><strong>Containers &amp; Orchestration</strong>: Using Docker, Kubernetes, service meshes, and cluster design to manage scalable deployments.</li><li><strong>CDNs</strong>: Implementing caching strategies, edge delivery, and latency reduction for global performance.</li><li><strong>Backups &amp; Recovery</strong>: Ensuring data durability, disaster recovery readiness, and snapshot automation.</li><li><strong>Artificial Intelligence &amp; Automation</strong>: Integrating AI-driven tools and automation frameworks to enhance development workflows, optimize code quality, and enable intelligent monitoring and predictive maintenance.</li></ul><h3>Why This Matters</h3><p>Being a Full Stack Developer today isn’t about mastering every layer it’s about understanding how they interconnect. It’s about being able to design, integrate, and troubleshoot across the entire lifecycle of an application.</p><p>Whether you’re building a startup MVP or scaling enterprise systems, this holistic view empowers developers to make smarter decisions, anticipate challenges, and deliver resilient, high-performing software.</p><h3>Final Thoughts</h3><p>The image of full stack as just frontend + backend is outdated. In 2025, Full Stack means embracing complexity, staying curious, and continuously expanding your engineering horizon.</p><p>If you’re a developer, architect, or tech leader, it’s time to rethink what Full Stack means for your team and your career.</p><h3>The Role of AI in Full Stack Development</h3><p>Artificial Intelligence is increasingly becoming an integral part of the full stack landscape. From automating repetitive tasks in CI/CD pipelines to enhancing security through intelligent threat detection, AI tools empower developers to build smarter, more efficient applications. Incorporating AI-driven analytics, natural language processing, and machine learning models into both frontend and backend systems is now a key skill for modern full stack professionals. Embracing AI not only accelerates development but also opens new possibilities for innovation and user experience enhancement.</p><p>#AI #FullStack #SoftwareDevelopment #TechInnovation #LLM #PromptEngineering #DeveloperLife #Frontend #Backend #API #Database #Server #Network #Security #OnurKapucu</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0287df201120" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Full Stack JavaScript Development: Frontend, Backend & Deployment]]></title>
            <link>https://kapucuonur.medium.com/full-stack-javascript-development-frontend-backend-deployment-24ef7a69f9d4?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/24ef7a69f9d4</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[full-stack-developer]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Tue, 20 May 2025 14:01:10 GMT</pubDate>
            <atom:updated>2025-05-20T20:06:34.787Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WOGRDAZREOgUJCKhqzujsw.webp" /><figcaption>Full Stack Development</figcaption></figure><p>JavaScript has evolved into a universal language that powers both <strong>client-side</strong> and <strong>server-side</strong> development. As a <strong>Full Stack JavaScript Developer</strong>, you can build complete web applications using a single language across all layers. This guide covers <strong>modern tech stacks, project architecture, and deployment strategies</strong>.</p><h3>📌 Full Stack JavaScript Tech Stack</h3><h3>1️⃣ Frontend Development</h3><p>Modern frontend development relies on these core technologies:</p><p>TechnologyDescription<strong>React.js</strong>Component-based UI library (State management: Redux, Zustand)<strong>Next.js</strong>React framework for SSR/SSG (SEO optimized)<strong>Vue.js</strong>Progressive JavaScript framework (Vuex/Pinia)<strong>Svelte</strong>Compiler-based optimized framework<strong>TailwindCSS</strong>Utility-first CSS framework<strong>TypeScript</strong>Strongly typed JavaScript</p><h3>2️⃣ Backend Development</h3><p>Node.js enables JavaScript on the server:</p><p>TechnologyDescription<strong>Node.js</strong>JavaScript runtime (Chrome V8 engine)<strong>Express.js</strong>Minimalist web framework<strong>NestJS</strong>Enterprise-grade TypeScript framework<strong>Fastify</strong>High-performance REST/GraphQL API<strong>tRPC</strong>End-to-end typesafe APIs</p><h3>3️⃣ Database Solutions</h3><p>TechnologyDescription<strong>MongoDB</strong>NoSQL document database (Mongoose ODM)<strong>PostgreSQL</strong>SQL database (Prisma ORM)<strong>Firebase</strong>Realtime database &amp; auth<strong>Redis</strong>In-memory caching</p><h3>4️⃣ DevOps &amp; Deployment</h3><p>ToolDescription<strong>Docker</strong>Containerization<strong>GitHub Actions</strong>CI/CD pipelines<strong>AWS/Vercel</strong>Cloud hosting<strong>PM2/Nginx</strong>Production process management</p><h3>🚀 Full Stack JavaScript Project Structure: Detailed Breakdown</h3><p>Here’s a comprehensive folder-by-folder explanation of a modern full-stack JavaScript application structure, optimized for Next.js (frontend) and Node.js/Express (backend):</p><h3>📁 Root Directory Structure</h3><pre>fullstack-app/<br>├── .github/             # GitHub CI/CD workflows<br>├── .husky/              # Git hooks<br>├── client/              # Next.js frontend<br>├── server/              # Node.js backend<br>├── scripts/             # Build/deployment scripts<br>├── .dockerignore        # Docker exclusion rules<br>├── .env                 # Global environment variables<br>├── .eslintrc.json       # ESLint configuration<br>├── .gitignore           # Git exclusion rules<br>├── docker-compose.yml   # Multi-container setup<br>├── Dockerfile           # Backend container config<br>├── LICENSE<br>└── README.md</pre><h3>🔍 Detailed Frontend Structure (Next.js)</h3><pre>client/<br>├── public/              # Static assets<br>│   ├── images/          # App images<br>│   ├── fonts/           # Custom fonts<br>│   └── robots.txt       # SEO configuration<br>│<br>├── src/<br>│   ├── app/             # App Router (Next.js 13+)<br>│   │   ├── (auth)/      # Auth-related routes<br>│   │   ├── (main)/      # Authenticated routes<br>│   │   ├── api/         # Route handlers<br>│   │   └── layout.tsx   # Root layout<br>│   │<br>│   ├── components/      # Reusable UI components<br>│   │   ├── ui/          # ShadCN/ui components<br>│   │   ├── shared/      # Common components<br>│   │   └── features/    # Feature-specific components<br>│   │<br>│   ├── config/          # App configuration<br>│   │   ├── routes.ts    # Route definitions<br>│   │   └── theme.ts     # Theme configuration<br>│   │<br>│   ├── contexts/        # React contexts<br>│   ├── hooks/           # Custom React hooks<br>│   ├── lib/             # Utility functions<br>│   │   ├── api/         # API clients<br>│   │   └── utils.ts     # Helper functions<br>│   │<br>│   ├── middleware.ts    # Next.js middleware<br>│   ├── providers.tsx    # Context providers<br>│   ├── styles/          # Global styles<br>│   │   ├── globals.css  # Global CSS<br>│   │   └── theme/       # Theme variables<br>│   │<br>│   ├── types/           # TypeScript types<br>│   └── utils/           # Additional utilities<br>│<br>├── .env.local           # Frontend environment vars<br>├── next.config.js       # Next.js configuration<br>└── package.json</pre><h3>🔍 Detailed Backend Structure (Node.js/Express)</h3><pre>server/<br>├── src/<br>│   ├── config/          # Configuration files<br>│   │   ├── db.ts        # Database connection<br>│   │   └── env.ts       # Environment validation<br>│   │<br>│   ├── controllers/     # Business logic<br>│   │   ├── auth/        # Auth controllers<br>│   │   └── api/         # API controllers<br>│   │<br>│   ├── middleware/      # Express middleware<br>│   │   ├── auth.ts      # Authentication<br>│   │   └── error.ts     # Error handling<br>│   │<br>│   ├── models/          # Database models<br>│   │   ├── user.model.ts<br>│   │   └── index.ts     # Model exports<br>│   │<br>│   ├── routes/          # API endpoints<br>│   │   ├── v1/          # Versioned routes<br>│   │   └── index.ts     # Route aggregator<br>│   │<br>│   ├── services/        # Business services<br>│   ├── types/           # TypeScript types<br>│   ├── utils/           # Helper functions<br>│   │   ├── api/         # API utilities<br>│   │   └── logger.ts    # Logging system<br>│   │<br>│   ├── app.ts           # Express app setup<br>│   └── server.ts        # Server entry point<br>│<br>├── .env                 # Backend environment vars<br>├── package.json<br>└── tsconfig.json</pre><h3>⚙️ Key Configuration Files Explained</h3><h3>1. Next.js Config (next.config.js)</h3><pre>/** @type {import(&#39;next&#39;).NextConfig} */<br>const nextConfig = {<br>  reactStrictMode: true,<br>  images: {<br>    domains: [&#39;res.cloudinary.com&#39;], // Allowed image domains<br>  },<br>  experimental: {<br>    serverActions: true, // Enable Next.js server actions<br>  },<br>  async rewrites() {<br>    return [<br>      {<br>        source: &#39;/api/:path*&#39;,<br>        destination: &#39;http://localhost:3001/api/:path*&#39;, // Proxy to backend<br>      },<br>    ];<br>  },<br>};</pre><pre>module.exports = nextConfig;</pre><h3>2. Express Server (server/src/server.ts)</h3><pre>import express from &#39;express&#39;;<br>import { createServer } from &#39;http&#39;;<br>import { config } from &#39;./config/env&#39;;<br>import { connectDB } from &#39;./config/db&#39;;<br>import { apiRouter } from &#39;./routes&#39;;<br>import { errorHandler } from &#39;./middleware/error&#39;;</pre><pre>const app = express();<br>const server = createServer(app);</pre><pre>// Middleware<br>app.use(express.json());<br>app.use(&#39;/api&#39;, apiRouter);<br>app.use(errorHandler);</pre><pre>// Start server<br>const start = async () =&gt; {<br>  await connectDB();<br>  server.listen(config.PORT, () =&gt; {<br>    console.log(`Server running on port ${config.PORT}`);<br>  });<br>};</pre><pre>start();</pre><h3>3. Docker Configuration (docker-compose.yml)</h3><p>yaml</p><pre>version: &#39;3.8&#39;</pre><pre>services:<br>  client:<br>    build: ./client<br>    ports:<br>      - &#39;3000:3000&#39;<br>    environment:<br>      - NODE_ENV=development<br>    volumes:<br>      - ./client:/app<br>      - /app/node_modules</pre><pre>  server:<br>    build: ./server<br>    ports:<br>      - &#39;3001:3001&#39;<br>    environment:<br>      - NODE_ENV=development<br>      - DATABASE_URL=mongodb://mongo:27017/appdb<br>    depends_on:<br>      - mongo</pre><pre>  mongo:<br>    image: mongo:6.0<br>    ports:<br>      - &#39;27017:27017&#39;<br>    volumes:<br>      - mongodb_data:/data/db</pre><pre>volumes:<br>  mongodb_data:</pre><h3>🔗 Important Internal Dependencies</h3><p>FolderKey Responsibilities/client/src/appNext.js 13+ App Router structure/client/src/lib/apiAxios/fetch wrappers for API calls/server/src/servicesBusiness logic separation from controllers/server/src/middlewareAuthentication, rate-limiting, logging/server/src/utils/loggerWinston/Morgan logging setup</p><p>This structure provides:</p><ul><li><strong>Clear separation</strong> of concerns</li><li><strong>Type safety</strong> throughout</li><li><strong>Easy scalability</strong> for new features</li><li><strong>Consistent patterns</strong> across team members</li></ul><h3>🔑 Key Best Practices</h3><ol><li><strong>Use TypeScript</strong> for type safety</li><li><strong>Containerize</strong> with Docker for consistency</li><li><strong>Environment variables</strong> for configuration</li><li><strong>API versioning</strong> (/api/v1/endpoint)</li><li><strong>Monitoring</strong> (Sentry, LogRocket)</li><li><strong>Automated testing</strong> (Jest, Cypress)</li></ol><h3>🎯 Conclusion</h3><p>Full Stack JavaScript development offers <strong>end-to-end solutions</strong> using a single language. By combining <strong>React/Next.js</strong> for the frontend and <strong>Node.js/Express</strong> for the backend, you can build scalable applications efficiently. Modern deployment platforms like <strong>Vercel</strong> and <strong>Render</strong> make publishing apps easier than ever.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24ef7a69f9d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FULL STACK PYTHON STRUCTURE]]></title>
            <link>https://kapucuonur.medium.com/full-stack-python-structure-894b4b008107?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/894b4b008107</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Thu, 15 May 2025 17:43:05 GMT</pubDate>
            <atom:updated>2025-05-15T17:43:05.518Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*tahMvRNlBKnL3e1CKt6ryA.png" /><figcaption>full stack developer</figcaption></figure><p>Full-Stack Python Application: Structure &amp; Deployment Guide<br>Introduction (Structure):<br>- “A full-stack Python application consists of a frontend for user interactions, a backend for logic and data processing, and a database for storing information. Technologies such as Flask or Django handle the backend, while React, Vue, or Jinja templates manage the frontend. Database choices range from PostgreSQL and MySQL to MongoDB. Together, these components create a robust and scalable web application.”<br>Introduction (Deployment):<br>- “Deploying a Python application to a live server involves hosting, configuring dependencies, and ensuring security and performance. Popular deployment platforms include Render, Heroku, DigitalOcean, AWS, and Docker, each offering different levels of automation and flexibility. By integrating version control and CI/CD pipelines, developers can ensure smooth updates and stable performance in production environments.” 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*dGXjqPPfQdwUtm6wofl_Cw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*CH3NSk8PY_tVfeNfjUFudQ.png" /></figure><p>Sure! Here’s a full breakdown of how to structure and deploy a **full-stack Python application** on various platforms:</p><ol><li><strong>Structure of Full-Stack Python Application</strong></li></ol><p>A typical **<strong>full-stack Python</strong>** setup includes:<br>- <strong>Frontend</strong>: HTML, CSS, JavaScript (React, Vue, or Jinja templates for Flask/Django)<br>- <strong>Backend</strong>: Flask or Django handling requests, APIs, and business logic<br>- <strong>Database</strong>: PostgreSQL, MySQL, SQLite, or NoSQL options like MongoDB<br>- <strong>Authentication</strong>: JWT, OAuth, or Django’s built-in authentication system<br>- <strong>API Layer</strong>: REST (Flask/Django REST framework) or GraphQL<br>- <strong>Background Jobs</strong>: Celery or Python’s asyncio for task management<br>- <strong>Containerization</strong>: Docker for environment consistency</p><p>— -</p><p><strong>2. Deployment Options &amp; Process</strong><br>Here’s how to deploy a Python full-stack project to different platforms:</p><p><strong>A. Render.com</strong><br>Render makes deployment easy and is great for serverless apps:<br>- <strong>Setup</strong>: Connect a GitHub repository<br>- <strong>Dependencies</strong>:Install using `pip install -r requirements.txt`<br>- <strong>Start Command</strong>: Flask → `gunicorn app:app`, FastAPI → `uvicorn main:app — host 0.0.0.0 — port $PORT`<br>- <strong>Automatic Deployments</strong>:Render rebuilds and updates your app on every push</p><p><strong>B. Heroku</strong><br>Heroku provides simple cloud hosting:<br>- <strong>Setup</strong>: Install the Heroku CLI (`heroku login`)<br>- <strong>Deployment</strong>:`git push heroku main`<br>- <strong>Requirements</strong>: Procfile (`web: gunicorn app:app`), `requirements.txt`, and environment variables</p><p><strong>C. DigitalOcean</strong><br>For more control:<br>- <strong>Droplet Setup</strong>: Choose Ubuntu and install dependencies<br>- <strong>Web Server</strong>:Use **Gunicorn** and **Nginx**<br>- <strong>Deployment</strong>: Configure SSH, push code, and set up a **CI/CD pipeline** with GitHub Actions</p><p><strong>D. AWS (EC2, Lambda, or Elastic Beanstalk)</strong><br>Amazon Web Services offers multiple options:<br>- <strong>EC2</strong>:Configure a virtual server manually<br>- <strong>Lambda</strong>:Serverless functions with FastAPI or Flask for APIs<br>- <strong>Elastic Beanstalk</strong>:Automated deployment with minimal setup</p><p><strong>E. Docker-Based Deployment</strong><br>Docker allows you to package everything as a container:<br>- <strong>Create a Dockerfile</strong>:<br> ```docker<br> FROM python:3.10<br> WORKDIR /app<br>RUN pip install -r requirements.txt<br>CMD [“gunicorn”, “-b”, “0.0.0.0:8000”, “app:app”]<br>- Deploy to **Docker Hub**, Kubernetes, or cloud providers.</p><p><strong>F. GitHub Actions (CI/CD Pipeline)</strong><br>You can automate deployments:<br>- Define a workflow in `.github/workflows/deploy.yml`<br>- Add steps for testing, building, and pushing to a live server</p><p>— -</p><p><strong>Final Thoughts</strong><br>Each platform has pros and cons — **Render** is simple, **Heroku** is beginner-friendly, **AWS/DigitalOcean** offers flexibility, and **Docker** keeps things portable. Pick one based on your needs!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=894b4b008107" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Frontend and Backend with APIs: A Comprehensive Guide]]></title>
            <link>https://kapucuonur.medium.com/integrating-frontend-and-backend-with-apis-a-comprehensive-guide-9d296eef2e33?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d296eef2e33</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[api-development]]></category>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Sat, 19 Apr 2025 06:45:40 GMT</pubDate>
            <atom:updated>2025-04-19T06:45:40.574Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DK-KMgqjIpXO7XKHOjqMhQ.png" /></figure><h3>In the modern web development landscape, the separation of frontend and backend has become a standard practice, largely facilitated by APIs (Application Programming Interfaces). APIs serve as the bridge between the user interface (frontend) and the server-side logic (backend), allowing for a modular, scalable, and maintainable architecture. This guide will delve into how frontend and backend are integrated using APIs, providing detailed explanations, examples, and best practices.</h3><h3>Understanding the Basics</h3><p>Before diving into the integration, let’s clarify some fundamental concepts:</p><ul><li><strong>Frontend:</strong> The client-side of your application, typically built with HTML, CSS, and JavaScript frameworks like React, Angular, or Vue.js. It’s what users interact with directly.</li><li><strong>Backend:</strong> The server-side of your application, responsible for processing data, managing databases, and executing business logic. Common technologies include Node.js, Django, Ruby on Rails, etc.</li><li><strong>API:</strong> A set of protocols and tools for building software and applications. It specifies how software components should interact, often through HTTP requests.</li></ul><h3>The Role of APIs in Integration</h3><p>APIs act as the communication channel between frontend and backend. Here’s how they facilitate this integration:</p><ol><li><strong>Data Exchange:</strong> Frontend sends requests to the backend to fetch or modify data. The backend processes these requests and sends back responses.</li><li><strong>Decoupling: </strong>By using APIs, frontend and backend can be developed, tested, and deployed independently, which enhances development efficiency.</li><li><strong>Security:</strong> APIs can implement authentication and authorization mechanisms to ensure secure data exchange.</li><li><strong>Scalability:</strong> With a clear API layer, scaling either the frontend or backend becomes more manageable.</li></ol><h3>Step-by-Step Integration Process</h3><h3>1. Designing the API</h3><p>Before any code is written, designing your API is crucial. This involves:</p><ul><li>Defining Endpoints: Determine what operations (CRUD — Create, Read, Update, Delete) your application needs. For example, <strong>/users</strong> for user-related operations, <strong>/products</strong> for product management.</li><li>Choosing Data Formats: JSON is the most common format for API data exchange due to its simplicity and compatibility with JavaScript.</li><li>API Versioning: Plan for future changes by versioning your API (e.g., <strong>/api/v1/users</strong>).</li></ul><h3>2. Backend Implementation</h3><p>Let’s consider a simple RESTful API using Node.js and Express for the backend:</p><pre>1const express = require(&#39;express&#39;);<br>2const app = express();<br>3const bodyParser = require(&#39;body-parser&#39;);<br>4const cors = require(&#39;cors&#39;);<br>5<br>6app.use(bodyParser.json());<br>7app.use(cors());<br>8<br>9// Mock database<br>10let users = [];<br>11<br>12// GET all users<br>13app.get(&#39;/api/v1/users&#39;, (req, res) =&gt; {<br>14    res.json(users);<br>15});<br>16<br>17// POST a new user<br>18app.post(&#39;/api/v1/users&#39;, (req, res) =&gt; {<br>19    const user = req.body;<br>20    users.push(user);<br>21    res.status(201).json(user);<br>22});<br>23<br>24// Start server<br>25const PORT = process.env.PORT || 3000;<br>26app.listen(PORT, () =&gt; {<br>27    console.log(`Server running on port ${PORT}`);<br>28});</pre><h3>3. Frontend Implementation</h3><p>For the frontend, let’s use React to fetch and display user data:</p><pre>1import React, { useState, useEffect } from &#39;react&#39;;<br>2import axios from &#39;axios&#39;;<br>3<br>4function UserList() {<br>5    const [users, setUsers] = useState([]);<br>6<br>7    useEffect(() =&gt; {<br>8        // Fetch users when component mounts<br>9        axios.get(&#39;http://localhost:3000/api/v1/users&#39;)<br>10            .then(response =&gt; {<br>11                setUsers(response.data);<br>12            })<br>13            .catch(error =&gt; {<br>14                console.error(&#39;Error fetching users:&#39;, error);<br>15            });<br>16    }, []);<br>17<br>18    return (<br>19        &lt;div&gt;<br>20            &lt;h1&gt;User List&lt;/h1&gt;<br>21            &lt;ul&gt;<br>22                {users.map(user =&gt; (<br>23                    &lt;li key={user.id}&gt;{user.name}&lt;/li&gt;<br>24                ))}<br>25            &lt;/ul&gt;<br>26        &lt;/div&gt;<br>27    );<br>28}<br>29<br>30export default UserList;</pre><h3>4. Handling Authentication</h3><p>For secure communication, implement authentication. Here’s a basic JWT (JSON Web Token) authentication setup:</p><p>Backend (Node.js):</p><pre>1const jwt = require(&#39;jsonwebtoken&#39;);<br>2<br>3// Login route<br>4app.post(&#39;/api/v1/login&#39;, (req, res) =&gt; {<br>5    // In a real app, validate user credentials against a database<br>6    const user = { id: 1, username: &#39;testuser&#39; };<br>7    const token = jwt.sign({ id: user.id }, &#39;your_jwt_secret&#39;, { expiresIn: &#39;1h&#39; });<br>8    res.json({ token });<br>9});<br>10<br>11// Protected route<br>12app.get(&#39;/api/v1/protected&#39;, verifyToken, (req, res) =&gt; {<br>13    res.json({ message: &#39;This is protected!&#39; });<br>14});<br>15<br>16function verifyToken(req, res, next) {<br>17    const bearerHeader = req.headers[&#39;authorization&#39;];<br>18    if(typeof bearerHeader !== &#39;undefined&#39;) {<br>19        const bearer = bearerHeader.split(&#39; &#39;);<br>20        const bearerToken = bearer[1];<br>21        req.token = bearerToken;<br>22        next();<br>23    } else {<br>24        res.sendStatus(403);<br>25    }<br>26}</pre><p>Frontend (React):</p><pre>1import React, { useState } from &#39;react&#39;;<br>2import axios from &#39;axios&#39;;<br>3<br>4function Login() {<br>5    const [username, setUsername] = useState(&#39;&#39;);<br>6    const [password, setPassword] = useState(&#39;&#39;);<br>7<br>8    const handleSubmit = async (e) =&gt; {<br>9        e.preventDefault();<br>10        try {<br>11            const response = await axios.post(&#39;http://localhost:3000/api/v1/login&#39;, { username, password });<br>12            localStorage.setItem(&#39;token&#39;, response.data.token);<br>13            // Redirect or update state to show logged-in status<br>14        } catch (error) {<br>15            console.error(&#39;Login failed:&#39;, error);<br>16        }<br>17    };<br>18<br>19    return (<br>20        &lt;form onSubmit={handleSubmit}&gt;<br>21            &lt;input type=&quot;text&quot; value={username} onChange={(e) =&gt; setUsername(e.target.value)} placeholder=&quot;Username&quot; /&gt;<br>22            &lt;input type=&quot;password&quot; value={password} onChange={(e) =&gt; setPassword(e.target.value)} placeholder=&quot;Password&quot; /&gt;<br>23            &lt;button type=&quot;submit&quot;&gt;Login&lt;/button&gt;<br>24        &lt;/form&gt;<br>25    );<br>26}<br>27<br>28export default Login;</pre><h3>5. Error Handling and State Management</h3><ul><li>Error Handling: Both frontend and backend should handle errors gracefully. On the backend, use try-catch blocks and appropriate HTTP status codes. On the frontend, manage errors with state or context to display user-friendly messages.</li><li>State Management: For complex applications, consider using state management libraries like Redux or Context API in React to manage data fetched from the API across components.</li></ul><h3>6. Testing and Deployment</h3><ul><li>Testing: Use tools like Postman for API testing, and Jest or Mocha for unit testing both frontend and backend. Integration tests can ensure the API integration works as expected.</li><li>Deployment: Deploy your backend on platforms like Heroku, AWS, or DigitalOcean. For the frontend, use services like Netlify, Vercel, or GitHub Pages. Ensure your frontend can reach your backend API, possibly through environment variables or CORS settings.</li></ul><h3>Visual Representation of API Integration</h3><p>To better understand the flow of data and the interaction between frontend and backend through an API, consider the following diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*5d15vdGEahXimJyD-PhVqg.jpeg" /><figcaption>API Integration Diagram Description</figcaption></figure><p>Description of the Visual:</p><p>The diagram illustrates the process of API integration between a frontend application and a backend server:</p><ul><li><strong>Frontend (Client)</strong>: On the left side, we see a representation of a web browser or a mobile app, symbolizing the frontend. This part includes UI elements like forms, buttons, and lists where users interact.</li><li><strong>API Request:</strong> An arrow from the frontend points towards the backend, labeled “API Request”. This represents the HTTP requests (GET, POST, etc.) sent from the frontend to fetch or send data. For instance, when a user logs in, a POST request is sent to the <strong>/api/v1/login</strong> endpoint.</li><li><strong>Backend (Server):</strong> The middle section shows the backend server, which could be a Node.js server in our example. It includes the API endpoints like <strong>/api/v1/users</strong> and <strong>/api/v1/login</strong>.</li><li><strong>Database:</strong> Connected to the backend, there’s a depiction of a database, indicating where the backend might store or retrieve data.</li><li><strong>API Response:</strong> An arrow from the backend back to the frontend, labeled “API Response”, shows the flow of data back to the client. This could be user data in JSON format or a JWT token upon successful login.</li><li><strong>Authentication Layer: </strong>A shield icon or a lock might be shown around the backend to signify the authentication layer, where JWT tokens are verified before allowing access to protected routes.</li></ul><p>This visual helps in conceptualizing how data flows from the user interface through the API to the server, gets processed, and then returns to update the UI, providing a clear picture of the integration process.</p><h3>Conclusion</h3><p>Integrating frontend and backend with APIs is a fundamental skill in modern web development. This guide has walked through the process from designing the API, implementing both ends, handling authentication, to deployment considerations. Remember, the key to successful integration lies in clear communication between frontend and backend, robust error handling, and maintaining a clean, scalable architecture. As you continue to develop, keep exploring advanced topics like GraphQL, WebSocket for real-time communication, and micro services architecture for even more sophisticated applications.</p><p>If you wan to learn more about API check this link please <a href="https://www.w3schools.com/js/js_api_intro.asp">https://www.w3schools.com/js/js_api_intro.asp</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d296eef2e33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to set up Tailwind 3 in Django with Vite and django-vite]]></title>
            <link>https://kapucuonur.medium.com/how-to-set-up-tailwind-3-in-django-with-vite-and-django-vite-36a3ce3b9a88?source=rss-2e90bd1a7f31------2</link>
            <guid isPermaLink="false">https://medium.com/p/36a3ce3b9a88</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[vitejs]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <dc:creator><![CDATA[Onur Kapucu]]></dc:creator>
            <pubDate>Sat, 15 Mar 2025 07:08:30 GMT</pubDate>
            <atom:updated>2025-03-15T07:12:24.478Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article we are going to set up Vite for a Django application and use it to install and use Tailwind. You will be able to use this for any other npm packages in the future, too!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kMQdrqBmvl4PMR4w.png" /></figure><p>This guide assumes you already have a Django application up and running. If you don’t, you can check diffirent articles on setting up Django using Python with pyenv and Poetry</p><h3>Creating a Vite project</h3><p>Vite is a blazing fast frontend build tool powering the next generation of web applications. We will be using it simply as a bundler. In the root of your Django application, we will create a new Vite project named <strong>webapp</strong>.</p><p>You might want to call it <strong>frontend</strong>, but I personally dislike that name. When incorporating Django templates there isn’t a classic “frontend/backend” split.</p><p>I personally use pnpm but for the sake of this tutorial I will use npm as that is what most people use, see Vite&#39;s <a href="https://vite.dev/guide/?ref=jilles.me">Getting Started page</a> if you&#39;re using yarn or anther package manager.</p><pre>$ npm create vite@latest webapp -- --template vanilla</pre><p>This will have created a folder named webapp.</p><h3>Adding Tailwind</h3><p>Now that we have our Vite project, we can add Tailwind by simply following their <a href="https://tailwindcss.com/docs/guides/vite?ref=jilles.me">guide</a>.</p><pre>$ npm install -D tailwindcss@3 postcss autoprefixer<br>$ npx tailwindcss init -p</pre><p>This creates the necessary files:</p><ul><li>tailwind.config.js</li><li>postcss.config.js</li></ul><p>We only need to update the tailwind config to point to our Django templates. You can write an intelligent script for this (e.g. by using fs to scan directories with a templates folder), but we will just add our django template folders manually. Open tailwind.config.js and add your templates folder(s):</p><pre>/** @type {import(&#39;tailwindcss&#39;).Config} */<br>export default {<br>  content: [<br>    &quot;../homepage/templates/**/*.html&quot;,<br>  ],<br>  theme: {<br>    extend: {},<br>  },<br>  plugins: [],<br>}</pre><p>This configration will look one folder above the webapp for the homepage application. This is a Django app which I created simply with python manage.py startapp homepage – You will likely have different apps.</p><p>The create-vite-app tool already created a style.css file for us in webapp/src/style.css. You can remove the existing content and replace it with:</p><pre>@tailwind base;<br>@tailwind components;<br>@tailwind utilities;</pre><h3>Creating a django-vite compatible vite.config.js</h3><p>Finally we need to create a Vite config file. We will point it to our ‘src/style.css’ and set up the required Vite properties for django-vite to work correctly.</p><p>import { defineConfig } from &#39;vite&#39; import { resolve } from &#39;path&#39; export default defineConfig((mode) =&gt; { return { plugins: [], base: &#39;/static/&#39;, // Important later! build: { manifest: true, emptyOutDir: true, outDir: resolve(&#39;./dist&#39;), // Important later! rollupOptions: { input: { tailwind: resolve(&#39;./src/style.css&#39;), }, }, }, }; });</p><p>webapp/vite.config.js</p><p>Now that we have our config, it’s time to run our Vite development server:</p><pre>$ npm run dev</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*ZY7tTRTvWqoZixli.png" /></figure><p>You can open this URL and see a working vanilla JavaScript application with a counter, but you can ignore this for now.</p><h3>Installing django-vite</h3><p>Now that we have a Vite project with Tailwind set up, we need to link it to our assets in our Django templates. Let’s add django-vite and set it up!</p><pre>$ poetry add django-vite</pre><p>Next we need to configure it in our settings.py file:</p><pre>INSTALLED_APPS = [<br>    &#39;django.contrib.admin&#39;,<br>    ...<br>    &#39;django_vite&#39;,<br>]</pre><pre>...</pre><pre># Static files (CSS, JavaScript, Images)<br># <a href="https://docs.djangoproject.com/en/5.1/howto/static-files/">https://docs.djangoproject.com/en/5.1/howto/static-files/</a></pre><pre>STATIC_URL = &#39;static/&#39;<br>STATIC_ROOT = BASE_DIR / &#39;staticfiles&#39;<br>STATICFILES_DIRS = [<br>    BASE_DIR / &quot;webapp/dist&quot; # Matches vite config!<br>]</pre><pre>DJANGO_VITE = {<br>    &quot;default&quot;: {<br>        &quot;dev_mode&quot;: DEBUG,<br>    }<br>}</pre><p>Now we just need a Django template that uses Tailwind utility classes. The ones we pointed to earlier in the tailwind.config.js file.</p><p>It will have 3 important parts</p><ol><li>The {% load django_vite %} tag</li><li>The {% vite_hmr_client %} tag to enable hot module reloading</li><li>The {% vite_asset_url &#39;src/style.css&#39; %} tag to point to our stylesheet</li></ol><pre>{% load django_vite %}<br>&lt;!doctype html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br>    &lt;title&gt;Tailwind 🤝🏻 Django&lt;/title&gt;<br>    {% vite_hmr_client %}<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;{% vite_asset_url &#39;src/style.css&#39; %}&quot; /&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1 class=&quot;p-8 text-6xl inline-block font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-blue-500  to-red-500&quot;&gt;<br>    Tailwind and Django!<br>&lt;/h1&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Now when we run our server we should see the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oIWsxNBs4H5jwnP2.png" /></figure><h3>Bonus: Adding npm packages</h3><p>I know you came here just for Tailwind, but since we added Vite I would be remiss not to show you how to add JavaScript packages.</p><pre>$ npm install --save canvas-confetti</pre><p>Then let’s open main.js (created by our create-vite-project) and replace the contents with:</p><pre>import &#39;vite/modulepreload-polyfill&#39;;<br>import confetti from &#39;canvas-confetti&#39;;</pre><pre>document.querySelector(&#39;h1&#39;).addEventListener(&#39;mouseenter&#39;, () =&gt; {<br>    confetti({<br>        particleCount: 100,<br>        startVelocity: 30,<br>        spread: 360,<br>        origin: {<br>            x: Math.random(),<br>            y: Math.random() - 0.2<br>        }<br>    });<br>});</pre><p>This will trigger some confetti when the mouse enters our h1. Note that this code is just for demonstration purposes because we know there is a single h1 in our template.</p><p>Now we need to update our vite.config.js include main.js:</p><pre>...<br>export default defineConfig((mode) =&gt; {<br>    return {<br>        ...<br>        build: {<br>            ...<br>            rollupOptions: {<br>                input: {<br>                    main: resolve(&#39;./src/main.js&#39;), // New!<br>                    tailwind: resolve(&#39;./src/style.css&#39;),<br>                },<br>            },<br>        },<br>    };<br>});</pre><p>And load it in our Django template.</p><p>... &lt;body&gt; &lt;h1 class=&quot;p-8 text-6xl inline-block font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-blue-500 to-red-500&quot;&gt; Tailwind and Django! &lt;/h1&gt; {% vite_asset &#39;src/main.js&#39; %} &lt;/body&gt;</p><p>Added main.js</p><p>And our final result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*apC2PAnkNbu3avPL.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36a3ce3b9a88" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>