<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Parth Arsid</title>
    <description>The latest articles on DEV Community by Parth Arsid (@partharsid).</description>
    <link>https://dev.to/partharsid</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4264841%2F7f29ccf3-df31-40aa-acdf-5c504fda98c2.png</url>
      <title>DEV Community: Parth Arsid</title>
      <link>https://dev.to/partharsid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/partharsid"/>
    <language>en</language>
    <item>
      <title>Running production apps on two free-tier ARM servers</title>
      <dc:creator>Parth Arsid</dc:creator>
      <pubDate>Wed, 25 Nov 2026 13:40:16 +0000</pubDate>
      <link>https://dev.to/partharsid/running-production-apps-on-two-free-tier-arm-servers-3ll</link>
      <guid>https://dev.to/partharsid/running-production-apps-on-two-free-tier-arm-servers-3ll</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update, November 2026:&lt;/strong&gt; this setup has since grown up. Coolify, Traefik and Pangolin are gone; everything now runs on a six-VM k3s cluster across two Oracle free accounts, with two copies of every site and database, automatic failover and nightly tested backups. See the interactive version at &lt;a href="https://partharsid.dev/architecture" rel="noopener noreferrer"&gt;partharsid.dev/architecture&lt;/a&gt;. The notes below describe the first version.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most of what I build runs for real businesses: a rental company, a sports venue, a university club. For a while that meant a Vercel project here, a Railway service there, and a growing list of monthly bills. This year I moved almost all of it onto two Oracle Cloud ARM virtual machines that I run myself.&lt;/p&gt;

&lt;p&gt;Here's the setup and what I learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  The machines
&lt;/h2&gt;

&lt;p&gt;Both are Ampere A1 instances running Ubuntu on ARM. The first one, which I call main-server, has 2 OCPUs and 12 GB of RAM. Oracle's Always Free allowance covers 4 OCPUs and 24 GB of RAM across all A1 instances, plus 200 GB of block storage, which is a lot of computer for zero rupees.&lt;/p&gt;

&lt;p&gt;One warning before anyone copies this: if your account is Pay-As-You-Go, nothing stops you going over the free limits. Add a third VM or an extra block volume and you're billed. I keep a note of exactly where the free ceiling sits and stay under it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nothing inbound except SSH
&lt;/h2&gt;

&lt;p&gt;The cloud firewall on main-server allows port 22 and nothing else. There's no port 80 or 443 open to the internet at all.&lt;/p&gt;

&lt;p&gt;Web traffic arrives through a &lt;strong&gt;Cloudflare Tunnel&lt;/strong&gt; instead. A &lt;code&gt;cloudflared&lt;/code&gt; container on the server opens an outbound connection to Cloudflare, and Cloudflare sends requests for my domains down that tunnel. TLS terminates at Cloudflare's edge, which also gives me DNS, a WAF and caching.&lt;/p&gt;

&lt;p&gt;On the server, the tunnel hands everything to &lt;strong&gt;Traefik&lt;/strong&gt;, which routes by hostname to the right container.&lt;/p&gt;

&lt;p&gt;The second server uses a different path, Pangolin with a WireGuard tunnel in front of Traefik, because it predates this setup and works. Both approaches share the same idea: the origin is never directly reachable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coolify as the control panel
&lt;/h2&gt;

&lt;p&gt;I deploy through &lt;strong&gt;Coolify&lt;/strong&gt;, a self-hosted alternative to Heroku or Vercel. It builds from a Git repo using a Dockerfile, Nixpacks or plain static files, manages environment variables, and wires each app into Traefik with the right domain.&lt;/p&gt;

&lt;p&gt;My portfolio site was a Coolify app too: a Next.js build in a small Docker image, rebuilt from GitHub.&lt;/p&gt;

&lt;p&gt;A gotcha that cost me an evening: for Coolify &lt;em&gt;services&lt;/em&gt; (multi-container templates like Supabase), setting the &lt;code&gt;SERVICE_FQDN&lt;/code&gt; environment variable doesn't move the router. You have to update the application's URL itself and restart the service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three Supabase instances
&lt;/h2&gt;

&lt;p&gt;Supabase is Postgres plus auth, storage and an API, and several of my projects depend on it. I now run three copies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one for the Team Next Nexus club platform,&lt;/li&gt;
&lt;li&gt;one for RR Downtown Arcade, migrated off the hosted service,&lt;/li&gt;
&lt;li&gt;and one I set up and handed to a friend who needed a database for their own project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running your own Supabase is mostly Docker Compose and patience. The part people underestimate is ownership: backups, upgrades and disk space are now your problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Watching all of it
&lt;/h2&gt;

&lt;p&gt;Two more self-hosted tools close the loop:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Uptime Kuma&lt;/strong&gt; checks every site and API every few minutes and messages me on Telegram when something goes down.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Umami&lt;/strong&gt; gives me privacy-friendly analytics without a cookie banner.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Was it worth it?
&lt;/h2&gt;

&lt;p&gt;For me, yes. The monthly bill went to zero, everything deploys the same way, and I understand every layer between a visitor's browser and the database. The cost is that when something breaks at 2 a.m., there's no support ticket to file. It's me and an SSH session.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://partharsid.dev/notes/self-hosting-on-oracle-arm" rel="noopener noreferrer"&gt;partharsid.dev&lt;/a&gt;. More of my work: &lt;a href="https://partharsid.dev" rel="noopener noreferrer"&gt;partharsid.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>selfhosted</category>
      <category>devops</category>
      <category>cloudflare</category>
      <category>oracle</category>
    </item>
    <item>
      <title>The security checklist I use on every Next.js app</title>
      <dc:creator>Parth Arsid</dc:creator>
      <pubDate>Wed, 25 Nov 2026 13:32:47 +0000</pubDate>
      <link>https://dev.to/partharsid/the-security-checklist-i-use-on-every-nextjs-app-5o</link>
      <guid>https://dev.to/partharsid/the-security-checklist-i-use-on-every-nextjs-app-5o</guid>
      <description>&lt;p&gt;Residency Kondapur's platform stores tenants' names, phone numbers, rent bills and payment screenshots. That's the kind of data you can't treat as a side project. These are the protections I built into it, and now start every Next.js app with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Passwords
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hash user passwords with bcrypt at cost 12.&lt;/strong&gt; Never store them, never log them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare secrets in constant time.&lt;/strong&gt; For the admin password I hash both the input and the stored value with SHA-256, then compare with &lt;code&gt;crypto.timingSafeEqual&lt;/code&gt;. A plain &lt;code&gt;===&lt;/code&gt; leaks timing information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One error message for every failure.&lt;/strong&gt; "Authentication failed", never "wrong password" or "no such user". Don't tell an attacker which half they got right.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sessions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sign session tokens with HMAC-SHA256&lt;/strong&gt; so they can't be forged or edited. My format is a timestamp, some randomness, and a signature over both.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Short lifetimes.&lt;/strong&gt; Eight hours for admins, 24 for tenants.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cookies: &lt;code&gt;httpOnly&lt;/code&gt;, &lt;code&gt;SameSite=Strict&lt;/code&gt;, and &lt;code&gt;Secure&lt;/code&gt; in production.&lt;/strong&gt; JavaScript on the page can't read them, and other sites can't make the browser send them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Requests
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Validate every body with Zod&lt;/strong&gt; before it gets anywhere near the database. Types in TypeScript disappear at runtime; a schema doesn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the Origin header on every write&lt;/strong&gt; to private APIs, in middleware, so a form on another site can't post to yours. Handle both &lt;code&gt;www&lt;/code&gt; and the bare domain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate-limit per IP on anything sensitive.&lt;/strong&gt; A simple in-memory map of counters and reset times is enough for a single server:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Endpoint&lt;/th&gt;
&lt;th&gt;Limit&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Admin login&lt;/td&gt;
&lt;td&gt;5 per 15 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tenant login&lt;/td&gt;
&lt;td&gt;5 per 15 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Signup&lt;/td&gt;
&lt;td&gt;3 per hour&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Public forms&lt;/td&gt;
&lt;td&gt;3 per hour&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Responses
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security headers on every response:&lt;/strong&gt; &lt;code&gt;X-Content-Type-Options: nosniff&lt;/code&gt;, &lt;code&gt;X-Frame-Options: DENY&lt;/code&gt;, a strict &lt;code&gt;Referrer-Policy&lt;/code&gt;, a &lt;code&gt;Permissions-Policy&lt;/code&gt; that turns off camera, microphone and geolocation, and HSTS in production.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Cache-Control: no-store&lt;/code&gt; on private API routes,&lt;/strong&gt; so no proxy ever caches one tenant's bills and serves them to another.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Block files that should never be served.&lt;/strong&gt; My middleware returns 404 for any &lt;code&gt;.sql&lt;/code&gt; path, so a migration file that ends up in the wrong folder can't be downloaded.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;p&gt;Small caps prevent a whole class of abuse. Tenants can have at most ten open support tickets. Uploads are typed (a bill screenshot is a different upload kind from a ticket photo). Every form has a maximum length.&lt;/p&gt;

&lt;p&gt;None of this is exotic. That's the point: it's a checklist, and the value is in doing all of it every time rather than the clever parts some of the time.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://partharsid.dev/notes/nextjs-security-checklist" rel="noopener noreferrer"&gt;partharsid.dev&lt;/a&gt;. More of my work: &lt;a href="https://partharsid.dev" rel="noopener noreferrer"&gt;partharsid.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>nextjs</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How EdgeWake sleeps at 115 µA</title>
      <dc:creator>Parth Arsid</dc:creator>
      <pubDate>Wed, 25 Nov 2026 13:32:17 +0000</pubDate>
      <link>https://dev.to/partharsid/how-edgewake-sleeps-at-115-ua-1f9g</link>
      <guid>https://dev.to/partharsid/how-edgewake-sleeps-at-115-ua-1f9g</guid>
      <description>&lt;p&gt;EdgeWake is the forest-threat detector my team built for Smart India Hackathon 2026. It listens for chainsaws and watches for fire, and it has to do that somewhere nobody will ever come to change a battery.&lt;/p&gt;

&lt;p&gt;That constraint shaped everything. The interesting engineering isn't the classifier. It's the decision about when the classifier is allowed to run at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why always-on doesn't work
&lt;/h2&gt;

&lt;p&gt;The obvious design is an ESP32-CAM with the camera, microphone and WiFi running continuously, streaming whatever it sees. It works on a desk. In a forest it's dead in days, because a camera and a radio are the two most expensive things you can leave switched on.&lt;/p&gt;

&lt;p&gt;Satellites and drones don't fix it either. Satellite imagery arrives hours late and clouds block it. Drones fly for 20 to 40 minutes and need a person holding the controller.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five tiers, each one earning the next
&lt;/h2&gt;

&lt;p&gt;EdgeWake stacks its hardware from cheapest to most expensive and only climbs a step when the step below says yes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tier&lt;/th&gt;
&lt;th&gt;What runs&lt;/th&gt;
&lt;th&gt;Current&lt;/th&gt;
&lt;th&gt;For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Deep sleep&lt;/td&gt;
&lt;td&gt;Flame + vibration sensors only&lt;/td&gt;
&lt;td&gt;~115 µA&lt;/td&gt;
&lt;td&gt;almost always&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Interrupt&lt;/td&gt;
&lt;td&gt;ESP32 wakes, checks the trigger&lt;/td&gt;
&lt;td&gt;&amp;lt; 5 mA&lt;/td&gt;
&lt;td&gt;&amp;lt; 100 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Listen&lt;/td&gt;
&lt;td&gt;INMP441 mic, audio features&lt;/td&gt;
&lt;td&gt;~40 mA&lt;/td&gt;
&lt;td&gt;~2 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Look&lt;/td&gt;
&lt;td&gt;OV2640 captures a JPEG&lt;/td&gt;
&lt;td&gt;~120 mA&lt;/td&gt;
&lt;td&gt;~1 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5. Send&lt;/td&gt;
&lt;td&gt;WiFi posts the alert&lt;/td&gt;
&lt;td&gt;~160 mA&lt;/td&gt;
&lt;td&gt;~3 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Any tier can decide it was a false alarm and put the node straight back to sleep. A falling branch trips the vibration sensor, the ESP32 wakes for a fraction of a second, decides it's noise, and never touches the mic or the camera.&lt;/p&gt;

&lt;h2&gt;
  
  
  Classifying sound without a big model
&lt;/h2&gt;

&lt;p&gt;Tier 3 records two seconds of audio and computes two cheap features: the zero-crossing rate (how often the waveform changes sign) and the RMS loudness.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High zero-crossing rate and high loudness looks like a chainsaw.&lt;/li&gt;
&lt;li&gt;Low zero-crossing rate at medium loudness looks like fire.&lt;/li&gt;
&lt;li&gt;Anything else is a false alarm, and the node goes back to sleep.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's deliberately simple. Two arithmetic passes over a buffer cost almost nothing, and the camera in tier 4 exists precisely so a human can confirm what the audio thought it heard. The beginner edition of the firmware swaps in a small 1D CNN trained with Edge Impulse for people who want to experiment with a real model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware details that matter more than they look
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The microphone is power-gated.&lt;/strong&gt; The INMP441 sits behind a MOSFET, so in tiers 1 and 2 it draws nothing, not "a little".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Only interrupt-capable pins wake the chip.&lt;/strong&gt; The KY-026 flame sensor and SW-420 vibration sensor are wired to GPIOs that can pull the ESP32 out of deep sleep.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One 18650 cell and a TP4056 charger.&lt;/strong&gt; No exotic power parts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The numbers
&lt;/h2&gt;

&lt;p&gt;In deep sleep the node averages roughly 1 mAh a day, which is where the two-year battery estimate comes from. A complete node costs ₹1,140, about $15. For comparison, Dryad's gas-sensing nodes are around $500 and Pyronear's camera setup around $200, and EdgeWake still keeps a photo of every confirmed event.&lt;/p&gt;

&lt;p&gt;The firmware is on &lt;a href="https://github.com/Partharsid/EdgeWake-SIH2026" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, and there's a &lt;a href="https://github.com/Partharsid/EdgeWake" rel="noopener noreferrer"&gt;beginner edition&lt;/a&gt; that replaces the cloud pipeline with a single Telegram bot, so you can build one with a board and a phone.&lt;/p&gt;

&lt;p&gt;The smartest sensor is the one that knows when not to work.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://partharsid.dev/notes/edgewake-115-microamps" rel="noopener noreferrer"&gt;partharsid.dev&lt;/a&gt;. More of my work: &lt;a href="https://partharsid.dev" rel="noopener noreferrer"&gt;partharsid.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>esp32</category>
      <category>iot</category>
      <category>embedded</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
