joshriang
← Back to portfolio

Mobile & Flutter apps·Python·Published

Vector Suite

This is the backend and schema behind three Flutter apps that answer one question each (what to start now, how today is going, how much runway is left), sharing one private database because a task created in one app has to appear in the others. The important behaviour is in SQL, not in the UI: startable_tasks only returns rows whose blocker is done or absent, so a blocked task never reaches the phone and the user sees exactly one thing to do. It is FastAPI over a stdlib-only SQLite store by default, switching to Postgres/Supabase when DATABASE_URL is set, with no handler changes between the two. A narrow sqlite3-compatible shim over psycopg2 keeps the query builder and blocking logic shared and tested once, including emulating SQLite's per-statement error semantics, because Postgres aborts the whole transaction on a failed statement and would otherwise poison a per-thread connection into permanent 500s. Timestamps stay ISO text on purpose: timestamptz normalises to UTC and would push tasks finished between 00:00 and 07:00 WIB into the previous day. /health reports which backend is live so a silent fallback to SQLite is visible, and the test suite clears DATABASE_URL so it can never write to production.

Date
2026
Main stack
Python
Code
github ↗
01
02
  • A fallback that is invisible is worse than no fallback: without /health reporting the active engine, the system can look healthy while writing to the wrong database.
  • Postgres kills the entire transaction on one failed statement, so a compatibility shim has to emulate SQLite's per-statement semantics or every later request on that connection returns 500.
  • Storing timestamps as timestamptz silently shifts WIB evening work into the previous day; keeping ISO text and comparing against a local date is the correct choice for a per-user day boundary.
03

Scale 0–100: how much this project relied on each skill.