Building an Uber Clone with Flutter and Supabase
An Uber-style consumer ride app can be built with Flutter on top of Supabase, using PostGIS geography columns to store driver locations and Supabase Realtime to stream the driver's position onto a Google Map. The tutorial walks through the drivers and rides schema, with generated latitude/longitude columns and row-level security policies. A trigger keeps driver availability in sync with ride status, and a security-definer find_driver function uses ST_DWithin and KNN ordering to pick the nearest available driver within 3,000 m and create the ride. On the client, a five-state Flutter UI calls an Edge Function wrapping Google's Routes API to draw the route polyline, compute a fare and subscribe to ride and driver updates.
Related posts
- Postgres Realtime location sharing with MapLibre
Supabase mediumAdeptLive location sharing is built by having a Telegram bot running in a Supabase Edge Function (grammY on Deno) capture edited-location updates and write them to Postgres through a PL/pgSQL RPC. The RPC looks up the user's active session and stores the coordinates as a PostGIS point. A React/Next.js client subscribes to Supabase Realtime postgres_changes INSERT events, filtered by event_id, and renders markers with react-map-gl and MapLibre GL JS over a Protomaps basemap served from Supabase Storage.
- Geo Queries with PostGIS in Ionic Angular
Supabase mediumAdeptPostGIS on Supabase handles geo data for an Ionic Angular app with a Capacitor Google Map. A stores table holds geography(POINT) locations behind a GIST spatial index. Two SQL functions do the geo queries: nearby_stores orders stores by the <-> distance operator and returns st_distance in meters, and stores_in_view filters with && against an ST_MakeBox2D bounding box. The app calls them via Supabase RPC, inserts locations as WKT POINT(long lat) strings, uploads store images to Supabase Storage, and covers the native location permissions and API keys needed for iOS and Android.
- Flutter Tutorial: building a Flutter chat app
Supabase mediumAdeptA real-time single-room chat app can be built with Flutter on the frontend and Supabase as the entire backend, using the supabase_flutter SDK instead of a custom API. The walkthrough creates profiles and messages tables in Postgres with username validation constraints, adds the messages table to the supabase_realtime publication for live updates, initializes the Supabase client, routes users via a splash page based on auth session, and defines Dart data models plus a registration page. Authentication and row-level security are deferred to a second part.
- Flutter Authorization with RLS
Supabase mediumAdeptExtends a basic Flutter real-time chat app into a 1-on-1 chat with authorization enforced by PostgreSQL Row Level Security on Supabase. The schema adds rooms and room_participants tables, a room_id foreign key on messages, and a security-definer plpgsql function create_new_room that returns an existing room for two users or creates one. The client side uses flutter_bloc cubits to stream room participants and each room's latest message via Supabase realtime. Email confirmation is handled through deep links configured in iOS Info.plist, AndroidManifest.xml and the Supabase redirect URL settings.
- Making a Real-Time Chat App with Supabase on Replit
Replit mediumAdeptA real-time public chat app can be built with a Vue 3 and Tailwind CSS frontend on Replit backed by Supabase's hosted Postgres. The walkthrough creates a messages table via SQL, enables replication-based real-time events, and wraps the supabase-js client in a Vue composable. That composable handles paginated message loading by range, INSERT subscriptions for live updates, and inserts for sending. Users are identified only by a random username stored in localStorage, and older messages load when the list is scrolled to the top.