<?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: Andrii Skumin</title>
    <description>The latest articles on DEV Community by Andrii Skumin (@andrii_skumin_dbec8040d33).</description>
    <link>https://dev.to/andrii_skumin_dbec8040d33</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%2F1656510%2Fed934248-3701-4659-a99f-ab973bfc34d5.JPG</url>
      <title>DEV Community: Andrii Skumin</title>
      <link>https://dev.to/andrii_skumin_dbec8040d33</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andrii_skumin_dbec8040d33"/>
    <language>en</language>
    <item>
      <title>Live riders on a map: Supabase Realtime + Mapbox in React Native (and the bill nobody warns you about)</title>
      <dc:creator>Andrii Skumin</dc:creator>
      <pubDate>Tue, 17 Nov 2026 18:00:29 +0000</pubDate>
      <link>https://dev.to/andrii_skumin_dbec8040d33/live-riders-on-a-map-supabase-realtime-mapbox-in-react-native-and-the-bill-nobody-warns-you-37gl</link>
      <guid>https://dev.to/andrii_skumin_dbec8040d33/live-riders-on-a-map-supabase-realtime-mapbox-in-react-native-and-the-bill-nobody-warns-you-37gl</guid>
      <description>&lt;p&gt;In my &lt;a href="https://dev.to/andrii_skumin_dbec8040d33/from-jquery-to-vibe-coding-15-years-in-it-and-my-first-app-131h"&gt;previous post&lt;/a&gt; I said I'm building a motorcycle app. The feature people ask about most is the &lt;strong&gt;live map&lt;/strong&gt;: open it, see riders who are on the road right now, moving in real time.&lt;/p&gt;

&lt;p&gt;With ten users it's easy. With real users it gets interesting. Here is how it works in &lt;a href="https://brap-app.com/?utm_source=devto&amp;amp;utm_campaign=realtime-map" rel="noopener noreferrer"&gt;BRAP&lt;/a&gt; (Expo + Supabase + Mapbox), and what production taught me.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz7jm34hqfo1ks73efqr4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz7jm34hqfo1ks73efqr4.jpg" alt=" " width="589" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea: one row per ride
&lt;/h2&gt;

&lt;p&gt;A ride in progress is a single row with a user id, lat, lng and a timestamp. Row exists = riding. Ride ends = row deleted. Everything else follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;who is riding? a &lt;code&gt;select&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;someone moved? an &lt;code&gt;UPDATE&lt;/code&gt; event&lt;/li&gt;
&lt;li&gt;someone stopped? a &lt;code&gt;DELETE&lt;/code&gt; event&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The phone writes its position from a background task (&lt;code&gt;expo-location&lt;/code&gt;). Two details that cost me days:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;iOS only honours &lt;code&gt;distanceInterval&lt;/code&gt;.&lt;/strong&gt; &lt;code&gt;timeInterval&lt;/code&gt; is ignored by the native code. A tick every 25 m means the update rate follows the speed, which is what you want anyway.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android needs &lt;code&gt;foregroundService&lt;/code&gt;.&lt;/strong&gt; Without that option there is no background tracking at all, and the system cuts location to a few updates per hour.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The client: events patch the cache
&lt;/h2&gt;

&lt;p&gt;I don't keep riders in &lt;code&gt;useState&lt;/code&gt;. The first snapshot is a normal React Query &lt;code&gt;useQuery&lt;/code&gt;, and every realtime event patches that cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="n"&gt;queryClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setQueryData&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Rider&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;queryKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prev&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prev&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lat&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lng&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lng&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One source of truth, and a refetch on resume simply works. One catch: the event payload has no username or avatar, so for a &lt;em&gt;new&lt;/em&gt; rider I refetch the snapshot instead of patching.&lt;/p&gt;

&lt;p&gt;Markers are real React views (&lt;code&gt;MarkerView&lt;/code&gt; from &lt;code&gt;@rnmapbox/maps&lt;/code&gt;) with avatars. Mapbox's built-in clustering only works with GeoJSON layers, so I group overlapping markers myself.&lt;/p&gt;

&lt;p&gt;A small trap: give every channel a random suffix. &lt;code&gt;removeChannel&lt;/code&gt; is async and React doesn't wait for it, so &lt;code&gt;supabase.channel('same-name')&lt;/code&gt; can return the old, already subscribed instance and &lt;code&gt;.on()&lt;/code&gt; throws &lt;em&gt;"cannot add callbacks after subscribe()"&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three lessons that cost real CPU
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Subscribe only while someone is looking.&lt;/strong&gt;&lt;br&gt;
In Expo Router a tab is not unmounted when you leave it. My subscription lived until the app was closed, so people browsing the feed still received every rider's every move. Now it is active only when the screen is focused &lt;strong&gt;and&lt;/strong&gt; the app is in the foreground. Both are needed: focus knows nothing about minimising, &lt;code&gt;AppState&lt;/code&gt; knows nothing about tabs. I release it with a 30 second delay so quick tab switching doesn't resubscribe constantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Postgres Changes scales with subscribers, not just writes.&lt;/strong&gt;&lt;br&gt;
Every change is checked against your row-level security policy &lt;em&gt;separately for each subscriber&lt;/em&gt;. Position updates are the most frequent writes in a tracking app, so this quickly became the single biggest CPU item in my database, bigger than all my own queries together. Make the policy cheap (no extra lookups on the hot path), and look at your stats before launch, not after.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Realtime is a hint, not a log.&lt;/strong&gt;&lt;br&gt;
If the socket sleeps (background, tunnel, no network), the events that happened meanwhile are never replayed. Result: a rider finished, but their marker hung on my map forever. The fix is boring: refetch on resume and on reconnect. On React Native you must wire both bridges by hand, otherwise React Query's &lt;code&gt;refetchOnWindowFocus&lt;/code&gt; and &lt;code&gt;refetchOnReconnect&lt;/code&gt; silently do nothing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nc"&gt;AppState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'change'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;focusManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFocused&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'active'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;onlineManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;setOnline&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="nc"&gt;NetInfo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="nf"&gt;setOnline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!!&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isConnected&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isInternetReachable&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bonus: I also drop on the client any ride whose last update is very old. One user revoked location permission and stayed on the map as "riding" for 24 hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  If I started again
&lt;/h2&gt;

&lt;p&gt;I would look at &lt;strong&gt;Broadcast&lt;/strong&gt; for the high-frequency positions and keep Postgres Changes for rare events (joined, left, finished). I haven't migrated yet, so I can't give you numbers, only the direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;One row per ride keeps client and policies simple.&lt;/li&gt;
&lt;li&gt;Subscribe only while the screen is focused and the app is foreground.&lt;/li&gt;
&lt;li&gt;Realtime never catches up: always have a refetch path.&lt;/li&gt;
&lt;li&gt;Postgres Changes cost grows with subscribers. Keep the policy cheap.&lt;/li&gt;
&lt;li&gt;On mobile, wire up &lt;code&gt;focusManager&lt;/code&gt; and &lt;code&gt;onlineManager&lt;/code&gt; yourself.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can see it working on a real road in BRAP: &lt;a href="https://brap-app.com/?utm_source=devto&amp;amp;utm_campaign=realtime-map" rel="noopener noreferrer"&gt;brap-app.com&lt;/a&gt;. If you solved live location on Supabase another way (Broadcast? Presence? your own socket?), tell me in the comments.&lt;/p&gt;

&lt;p&gt;Peace!&lt;/p&gt;

</description>
      <category>supabase</category>
      <category>reactnative</category>
      <category>mapbox</category>
      <category>typescript</category>
    </item>
    <item>
      <title>From jQuery to Vibe Coding: 15 Years in IT and My First App</title>
      <dc:creator>Andrii Skumin</dc:creator>
      <pubDate>Mon, 26 Oct 2026 21:35:18 +0000</pubDate>
      <link>https://dev.to/andrii_skumin_dbec8040d33/from-jquery-to-vibe-coding-15-years-in-it-and-my-first-app-131h</link>
      <guid>https://dev.to/andrii_skumin_dbec8040d33/from-jquery-to-vibe-coding-15-years-in-it-and-my-first-app-131h</guid>
      <description>&lt;p&gt;I've been in IT since 2009.&lt;/p&gt;

&lt;p&gt;I started as a part-time computer lab administrator while at university. Then I read a book about HTML and CSS. Two weeks later, I was working on my first paid project.&lt;/p&gt;

&lt;p&gt;That's how my 15-year journey at the same IT company began.&lt;/p&gt;

&lt;p&gt;Then came JavaScript. &lt;strong&gt;jQuery was my first love.&lt;/strong&gt; We built hundreds of carousels, date pickers, and form validators. Good times.&lt;/p&gt;

&lt;p&gt;Then Angular arrived. Suddenly, I wasn't just building forms anymore. I was thinking about architecture. That was exciting.&lt;/p&gt;

&lt;p&gt;Eventually, I moved from development into management and stopped writing code. Turns out, working with people can be even more interesting than working with computers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then AI happened
&lt;/h2&gt;

&lt;p&gt;Everyone is vibe coding. Someone who has never written a line of code can now build an app for finding mushrooms in the forest.&lt;/p&gt;

&lt;p&gt;And vibe coding is addictive. Like smoking, except instead of cigarette breaks, you take breaks to ship another feature.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I got hooked too.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I still have a good position at a large IT company. But in the evenings, I'm building my own product.&lt;/p&gt;

&lt;p&gt;It's called &lt;strong&gt;BRAP&lt;/strong&gt;, a motorcycle app I'm building to solve problems I face as a rider: finding people to ride with, tracking trips, and discovering local motorcycle events.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frhffjmi5h2a5vbuw6jzv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frhffjmi5h2a5vbuw6jzv.jpg" alt=" " width="623" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm a rider myself, so I'm building something that solves problems I actually experience.&lt;/p&gt;

&lt;p&gt;I don't want to ask strangers whether they need another finance assistant or habit tracker.&lt;/p&gt;

&lt;p&gt;I want to solve real problems for real people.&lt;/p&gt;

&lt;h2&gt;
  
  
  One question worth asking
&lt;/h2&gt;

&lt;p&gt;If you're building an app, ask yourself one simple question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What problem am I actually solving?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Keep asking it. Especially when AI makes building things easier than ever.&lt;/p&gt;

&lt;p&gt;Peace to everyone! ✌️&lt;/p&gt;

&lt;p&gt;My motorcycle app: &lt;a href="https://brap-app.com/" rel="noopener noreferrer"&gt;BRAP — Motorcycle Community&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>career</category>
      <category>javascript</category>
      <category>vibecoding</category>
    </item>
  </channel>
</rss>
