Skip to main content
SmartMove uses Supabase (PostgreSQL) to sync user data across devices when a user is authenticated. All tables are in the public schema and have Row Level Security enabled.
The full migration SQL is in supabase_migration_relational_db.sql at the repository root.

Tables

user_preferences

Stores theme, language, and privacy settings per user.
ColumnTypeDescription
user_iduuidReferences auth.users. Primary key.
theme_modetextlight, dark, or system
languagetextLocale code: de, it, en, or lad
notificationsbooleanPush notification preference
privacy_locationbooleanLocation sharing consent
privacy_analyticsbooleanAnalytics consent
One row per user. Writes use upsert with onConflict: 'user_id'.

user_stops

Recent stops visited by the user, with optional favorite flag.
ColumnTypeDescription
iduuidPrimary key
user_iduuidReferences auth.users
nametextStop display name
gtfs_idtextGTFS stop identifier (nullable)
latfloat8Latitude (nullable)
lonfloat8Longitude (nullable)
is_favoritebooleanWhether this stop is bookmarked
last_visited_attimestamptzWhen the stop was last used
Sync strategy: delete all rows for the user, then insert the current localStorage array.

user_connections

Recent origin–destination pairs searched by the user.
ColumnTypeDescription
iduuidPrimary key
user_iduuidReferences auth.users
from_nametextDeparture stop name
to_nametextDestination stop name
from_gtfs_idtextDeparture stop GTFS ID (nullable)
to_gtfs_idtextDestination stop GTFS ID (nullable)
from_latfloat8Departure latitude (nullable)
from_lonfloat8Departure longitude (nullable)
to_latfloat8Destination latitude (nullable)
to_lonfloat8Destination longitude (nullable)
is_favoritebooleanWhether this connection is bookmarked
last_searched_attimestamptzWhen the connection was last searched

quick_access

Pinned items shown in the quick access widget on the home screen.
ColumnTypeDescription
iduuidPrimary key
user_iduuidReferences auth.users
item_idtextClient-assigned item identifier
nametextDisplay name
typetextstop, line, or route
type_labeltextLocalized type label
positionint4Display order

commuter_routes

Routes saved in Commuter Mode for one-tap access.
ColumnTypeDescription
iduuidPrimary key
user_iduuidReferences auth.users
route_datajsonbFull commuter route object
positionint4Display order

liked_routes

Bookmarked routes saved by the user.
ColumnTypeDescription
iduuidPrimary key
user_iduuidReferences auth.users
route_idtextClient-assigned route identifier
from_nametextDeparture stop name
to_nametextDestination stop name
modetexttrain, bus, or seilbahn
durationtextJourney duration string
trip_datajsonbFull itinerary for reopening the route

active_routes

Routes currently being followed by the user.
ColumnTypeDescription
iduuidPrimary key
user_iduuidReferences auth.users
route_idtextClient-assigned route identifier
from_nametextDeparture stop name
to_nametextDestination stop name
modetextTransport mode
departure_timetextScheduled departure time
arrival_timetextScheduled arrival time
statustexton-time, delayed, or boarding
status_labeltextLocalized status string
delaytextDelay amount (nullable)
next_stoptextName of the next stop
progressfloat8Journey progress 0–1
linetextLine identifier

departure_stations

Stops pinned to the departure board.
ColumnTypeDescription
iduuidPrimary key
user_iduuidReferences auth.users
station_idtextStop identifier from EFA
nametextStop display name
positionint4Display order

route_shares

Short link records created when a user shares a route.
ColumnTypeDescription
iduuidPrimary key
short_idtextShort link identifier (used in /r/:id)
trip_datajsonbFull itinerary payload
created_attimestamptzWhen the share was created
route_shares does not have a user_id column. Rows are readable by anyone, which allows shared links to work without authentication.

Row level security

How RLS policies are configured for each table.

Data persistence

How localStorage maps to these Supabase tables.