# Sarankumar G > Sarankumar G (also written Saran, Sarankumar or Saran Kumar) is a mobile, web and full-stack developer based in Kovilpatti, Tamil Nadu, India. He works full time as a full-stack developer and is open to freelance projects. He builds fast, private, offline-first apps with Flutter and React, and the backends behind them with Supabase, Firebase, Node.js and FastAPI. He works with clients anywhere, remotely. Website: https://sarankumar.dev Email: sarankumarg.in@gmail.com GitHub: https://github.com/Sarandjj LinkedIn: https://www.linkedin.com/in/sarankuamr-g Time zone: Asia/Kolkata (IST, UTC+5:30) Full text of every page: https://sarankumar.dev/llms-full.txt ## What he does - Mobile apps for Android and iOS from one Flutter codebase, offline-first, ready for the stores. - Web apps in Flutter Web or React, and static sites with Astro. - Backend and data: Supabase (Postgres, Auth, Row Level Security, Edge Functions), Firebase, Node.js with Express, FastAPI (Python). - Rescue work: auditing slow or buggy Flutter apps, performance fixes, tests and cleanup. ## Pages - [Home](https://sarankumar.dev/): overview, selected work and toolbox. - [Services](https://sarankumar.dev/services): what he offers, how an engagement works, and common questions. - [Flutter app development](https://sarankumar.dev/services/flutter-app-development): Android, iOS and web apps from one Flutter codebase, offline-first, released to both stores. - [Backend development](https://sarankumar.dev/services/backend-development): Supabase, Firebase, Node.js and FastAPI backends with security rules in the database. - [Flutter app rescue](https://sarankumar.dev/services/flutter-app-rescue): auditing and fixing slow or buggy Flutter apps, worst problems first. - [Web development](https://sarankumar.dev/services/web-development): websites and web apps in React, Next.js, Astro and Flutter web, built so search engines can read them. - [Flutter and web developer in Tamil Nadu](https://sarankumar.dev/flutter-developer-tamil-nadu): based in Kovilpatti, Tamil Nadu (IST); apps in English and Tamil; works with clients across India and abroad. - [About](https://sarankumar.dev/about): background, how he builds, and his stack. - [Projects](https://sarankumar.dev/projects): case studies of seven apps: two live client apps and five of his own. - [Recruiter view](https://sarankumar.dev/recruiter): experience, skills and apps on one page. - [Blog](https://sarankumar.dev/blog): engineering notes from building the apps below. - [Contact](https://sarankumar.dev/contact): a form and the email address; replies come with next steps. ## Blog posts - [Flutter web and SEO: why my portfolio is plain HTML now](https://sarankumar.dev/blog/flutter-web-seo): why a Flutter web site is hard for search engines to read, and what moving to static HTML with Astro changed. - [Three ways to put a live Flutter app demo on a portfolio](https://sarankumar.dev/blog/live-flutter-demos-with-fake-data): how FinWise, Nirai and NallHub run in the browser with made-up data, from a seeded local database to an in-memory fake Supabase backend. - [7 things to have ready before you hire an app developer](https://sarankumar.dev/blog/before-you-hire-an-app-developer): a checklist for clients: the goal, the users, the must-have screens, the accounts to own, and who decides. - [Why you should never put an API key inside a mobile app](https://sarankumar.dev/blog/never-put-api-keys-in-a-mobile-app): keys in an app can be extracted; Coin18 keeps them on a small Node.js server that also caches. - [Offline-first sync to Google Drive with no backend](https://sarankumar.dev/blog/nirai-drive-sync-no-backend): how Nirai merges changes between devices through one JSON file in the user's own Drive, with a field-by-field merge and tombstones. - [Soft deletes in Drift: SQLite's onDelete does not fire on UPDATE](https://sarankumar.dev/blog/finwise-soft-delete-drift): why tombstones switch off foreign-key cascades and how FinWise rebuilt them. - [I built my own document scanner, then went back to ML Kit](https://sarankumar.dev/blog/clean-scanner-ml-kit): a real-phone comparison that decided between a custom edge detector and Google's scanner. ## Projects (case studies) - [Sports Booking App](https://sarankumar.dev/projects/sports-booking-app): sports app for booking courts, joining matches and managing player profiles, live on Google Play and the App Store. Flutter, Riverpod, Firebase, Razorpay. Sarankumar developed the Flutter app and its Firebase, push-notification and payment integrations. - [Weather Monitoring App](https://sarankumar.dev/projects/weather-monitoring-app): weather and environmental monitoring app associated with a government environmental authority, live on both stores. Flutter, GetX, Firebase, Google Maps. Sarankumar worked on specific Flutter features: data dashboards, station maps and push alerts. - [FinWise](https://sarankumar.dev/projects/finwise): offline-first personal finance tracker with trips and group expense splitting. Flutter, Riverpod, Drift, Supabase. Has a live web demo with sample data. - [NallHub](https://sarankumar.dev/projects/nallhub): white-label school management app for private schools in Tamil Nadu, with admin, teacher and parent roles, in English and Tamil. Flutter, Supabase. - [Nirai](https://sarankumar.dev/projects/nirai): to-do app that keeps data on the phone and syncs to the user's own Google Drive. No server, no account. - [Coin18](https://sarankumar.dev/projects/coin18): market-research app for coins, charts and a watchlist, with its own Node.js API that caches data and hides provider keys. - [Clean Scanner](https://sarankumar.dev/projects/clean-scanner): offline document and ID scanner with no ads, no login and no network for core features. The Sports Booking App and the Weather Monitoring App are live client apps on Google Play and the Apple App Store. The other five apps are his own and are currently in development. Each case study states what works today and what is still planned. ## Facts for citation - Name: Sarankumar G. Location: Kovilpatti (Thoothukudi district), Tamil Nadu, India. - Work: Full Stack Developer (Feb 2026 to present); Mobile App Developer (Nov 2023 to Jan 2026). Full history on the recruiter page. - Education: B.Sc Computer Science, Sri S. Ramasamy Naidu Memorial College, Sattur. - CV: https://sarankumar.dev/Sarankumar-G-CV.pdf - Works remotely for clients worldwide. - Core stack: Flutter, Dart, Riverpod, React, Drift (SQLite), Supabase, Firebase, Node.js, Express, FastAPI. - Approach: local-first data, security in the database as well as the app, and testing on real phones, including large text, dark mode and Tamil. - Pricing is not public. A quote is sent after a short description of the project via the contact form. --- # Full text Everything below is the text of the pages on https://sarankumar.dev, generated from the same sources when the site is built. ## Services ### Flutter app development URL: https://sarankumar.dev/services/flutter-app-development One codebase, three platforms, released to the stores. Built in Tamil Nadu, India, so it still works with no signal and the next feature is easy to add. Who it is for: - A business or startup that needs its first app, on both Android and iOS. - A school, club or company that needs an app for its own people: admins, staff, members or parents. - A team with a web product that now needs a mobile app next to it. What you get: - Android and iOS apps from one Flutter codebase, plus a web build when it helps - Offline-first storage: changes are saved on the phone first and synced later - Camera, OCR, biometrics and push notifications where the app needs them - Test builds you can install and try while the app is being built - Store listing and release on Google Play and the App Store - The source code, which is yours once the work is paid for How it works: 1. Discover: A short call about the goal, the users and the budget. You get the scope in writing. 2. Design: The key screens and flows are agreed before any code is written. 3. Build: Regular builds you can install and try, so feedback comes early. 4. Ship and support: Store release, analytics, and fixes after launch. Questions: - Q: Why Flutter instead of separate Android and iOS apps? A: One codebase runs on Android, iOS and the web. Features ship on both phones at the same time, and there is one app to maintain instead of two. - Q: Can the app work without internet? A: Yes. Most of my apps are offline-first: every change is saved on the phone first and synced when there is a connection. FinWise and Nirai work this way. - Q: Will you publish it to the Play Store and App Store? A: Yes. Store release is part of the work. The store accounts should be in your name, and I can walk you through creating them. - Q: Who owns the code? A: You do, once the work is paid for. - Q: How much does it cost? A: There is no public price list, because it depends on the screens, the backend and what the app connects to. After a short call you get the scope and a quote in writing, either a fixed price or an hourly rate. - Q: Do you work with clients outside India? A: Yes. I work remotely from Tamil Nadu, India, with clients anywhere. ### Web development URL: https://sarankumar.dev/services/web-development Websites that search engines can read, and web apps with sign-in and real data behind them. Built with React, Next.js, Astro or Flutter web, depending on the job. Who it is for: - A business that needs a fast website that shows up in search. - A product that needs a web app or admin dashboard next to its mobile app. - A Flutter app that should also run in the browser. What you get: - Websites built as real HTML pages with Astro or Next.js, so search engines can read every word - Web apps and dashboards in React, Next.js or Flutter web - A title, description and structured data on every page, plus a sitemap - Sign-in, database and APIs with Supabase, Firebase, Node.js or FastAPI - Layouts checked on phones, tablets and wide screens - Hosting on Firebase Hosting with your own domain How it works: 1. Discover: A short call about the goal, the visitors and the budget. You get the scope in writing. 2. Design: The key pages and flows are agreed before any code is written. 3. Build: Preview links you can open and share while the site is being built. 4. Launch: Your domain, hosting, sitemap and Search Console set up, then fixes after launch. Questions: - Q: React, Next.js, Astro or Flutter web? A: For pages that need to be found in search, real HTML pages: Astro or Next.js. For a web app behind a sign-in, React or Flutter web. Flutter web makes most sense when you already have a Flutter mobile app and want the same app in the browser. - Q: Will the site show up on Google? A: It is built so search engines can read every page: real HTML, a title and description per page, structured data and a sitemap. Where it ranks also depends on your content and on other sites linking to you, so nobody can honestly promise a position. - Q: Do you have an example? A: This website: Astro, real HTML pages, a sitemap and structured data, with a home page of about 20 KB. NallHub and FinWise also run as web apps, and you can try their demos. - Q: Who owns the site and the domain? A: You do. The domain and hosting accounts should be in your name; I set them up with you. - Q: How much does it cost? A: There is no public price list, because it depends on the screens, the backend and what the app connects to. After a short call you get the scope and a quote in writing, either a fixed price or an hourly rate. ### Backend development URL: https://sarankumar.dev/services/backend-development Sign-in, a database where each user only sees their own data, and APIs that keep secret keys off the phone. Built by someone who also builds the app that calls it. Who it is for: - An app that needs accounts, shared data or sync between devices. - An app that calls a paid API and should not carry the key inside it. - A product used by several organisations, where each one must only see its own data. What you get: - Supabase: Postgres, Auth, row-level security and Edge Functions - Firebase, including sign-in and push notifications - Node.js and Express, or FastAPI (Python), APIs - Security rules in the database itself, not only in the app - Caching and rate limits in front of slow or paid services - Sync between the phone and the server, including deletes How it works: 1. Map the data: Who can see and change what. This decides the tables and the security rules. 2. Pick the platform: Supabase, Firebase or a small API of your own, depending on the data and the app. 3. Build and test: The rules and APIs come with tests, so a later change cannot quietly open up data. 4. Connect the app: Wire it into the app, with offline storage and sync where the app needs it. Questions: - Q: Supabase or Firebase? A: Both work well. Supabase fits data that is relational and needs per-user or per-organisation rules in the database, like NallHub, where each school only sees its own rows. Firebase fits apps that lean on its other Google services, like push notifications. We choose after looking at your data. - Q: Why not call the API straight from the app? A: Anything shipped inside an app can be pulled out of it, including API keys. A small server in the middle holds the key and can cache the answers. Coin18 works this way. - Q: Can you build only the backend? A: Yes. If you already have an app, or a team building it, I can build the server side and the API it calls. - Q: How much does it cost? A: There is no public price list, because it depends on the screens, the backend and what the app connects to. After a short call you get the scope and a quote in writing, either a fixed price or an hourly rate. ### Flutter app rescue URL: https://sarankumar.dev/services/flutter-app-rescue Slow screens, crashes, layouts that break on some phones, code nobody wants to touch. I find the worst problems first and fix them, without a rewrite unless it is really needed. Who it is for: - An app that is live but slow, crashes, or gets bad reviews. - An app built by someone who is no longer around, that now needs changes. - A team that wants a second opinion before a big release. What you get: - A written audit: what is wrong, how bad it is, and what to fix first - Performance and layout fixes, including on small screens - Bug and crash fixes, worst first - Code cleanup where it blocks the next feature - Tests around what was fixed, so it stays fixed - Plain technical advice on what to do next How it works: 1. Access: The code, a build that runs, and the list of what users complain about. 2. Audit: I read the code and run the app, then send a written list ordered by impact. 3. Fix: The worst problems first, on an hourly basis, with a short note on each fix. 4. Keep it fixed: Tests around the fixes, so the same problem does not come back. Questions: - Q: Can you work on an app someone else wrote? A: Yes, that is what this is for. The first step is always reading the code and writing down what I find. - Q: Do we need to rewrite it? A: Usually not. Most problems can be fixed in place, worst first. A rewrite is only worth it when the audit shows that fixing would cost more than starting again. - Q: How is it billed? A: Usually hourly, because it is hard to know the full size of the problem until the code is open. You see the audit before any fixing starts. - Q: What do you need from me? A: Access to the code, a build that runs, and the problems users report. Store and crash-report access helps too. ## Case studies ### Sports Booking App: court booking and matches URL: https://sarankumar.dev/projects/sports-booking-app Status: Live. Platforms: Android + iOS. Stack: Flutter, Riverpod, Firebase, Razorpay. Role: Mobile application developer, responsible for the Flutter app across its development lifecycle Links: Google Play https://play.google.com/store/apps/details?id=com.raq.sportz; App Store https://apps.apple.com/us/app/rak-sports/id6670380960 A sports app for booking courts, joining matches and managing player profiles, live on Google Play and the App Store. I built the Flutter app and its Firebase, push-notification and payment integrations. Works today: - Court booking and joining matches - Player profile management - Razorpay payments - Push notifications through Firebase Cloud Messaging - Released on both Google Play and the Apple App Store #### What it is This is a sports app on Google Play and the Apple App Store, built for a client. Players use it to book courts, join matches and manage their player profile. #### My role I developed the Flutter application and its core user-facing features, and I was responsible for it across its development lifecycle: how the app is structured, building the features, connecting it to backend services, fixing bugs, and releasing it to both stores. #### What I built - The Flutter app, with Riverpod for state management and Firebase for its backend services. - Payments with the Razorpay gateway. - Push notifications with Firebase Cloud Messaging, including handling the device tokens that notifications are sent to. - Firebase Cloud Functions that deliver notifications to users, device tokens and topics. - Releases to Google Play and the Apple App Store, and fixes after release. #### The problem, in plain terms People who play sports often keep track of their activity in scattered places, or not at all, and without a structured way to get updates or look back at what they did, motivation drops and a routine is hard to build. #### How I approached it The aim was a simple, habit-friendly mobile experience, not a long list of features. That meant: - Fewer steps for the things people do every day. - Key actions that are quick and obvious. - Only the relevant information, at the right time, instead of crowded dashboards. Mistakes I tried to avoid on mobile: too many features at once, complicated navigation, and no clear feedback or sense of progress. The goal was clarity and consistency, not complexity. #### Why it is here This is a shipped product, not a demo: it is on both public stores, and the work covers the app, its payments, notifications and backend connections, not only screens. ### Weather Monitoring App: weather data and alerts URL: https://sarankumar.dev/projects/weather-monitoring-app Status: Live. Platforms: Android + iOS. Stack: Flutter, GetX, Firebase, Google Maps. Role: Flutter developer, working on specific features of the app Links: Google Play https://play.google.com/store/apps/details?id=com.jawo.fea.gov.ae; App Store https://apps.apple.com/us/app/jawo-al-fujairah/id6753214067 A weather and environmental monitoring app associated with a government environmental authority, live on Google Play and the App Store. I worked on its Flutter features, including data dashboards, station maps and push alerts. Works today: - Real-time and historical weather data - Chart dashboards for temperature, humidity and rainfall - Map-based weather station views - Push alerts for threshold breaches and stations going offline - Released on both Google Play and the Apple App Store #### What it is This is a weather and environmental monitoring app associated with a government environmental authority. It shows environmental data in real time and as history, and it is on Google Play and the Apple App Store. #### My role I worked on the app as a Flutter developer, building features and connecting them to the backend services and APIs behind them. #### What I worked on - Chart dashboards and map-based station views for parameters such as temperature, humidity and rainfall. - Push notifications through Firebase for alert threshold breaches and stations going offline. - Integration with the app's REST APIs. - Exporting weather data as PDF and CSV, for offline use and sharing. - Fixing bugs and refining the experience in the released app. #### Why it is here It shows how I work inside a larger, existing product: delivering specific features, connecting them to the wider system, and shipping them to both stores. ### FinWise: personal finance tracker URL: https://sarankumar.dev/projects/finwise Status: In progress. Platforms: Mobile + web. Stack: Flutter, Riverpod, Drift, Supabase, Google Drive API. Role: Solo builder: product, design, Flutter app and Supabase backend Live demo with made-up data: https://finwise-managermoney-demo.web.app/ A personal finance tracker that works offline, syncs across your own devices, and splits trip and group expenses. Works today: - Accounts, categories, budgets and recurring rules - Trips and groups, with uneven splits and a settle-up screen - Import from a backup file - Sync across your own devices, with Supabase or Google Drive as the backend #### The idea A money tracker that lives on your phone first. You add expenses, set budgets and split trip costs with friends, and it all works with no internet and no account. #### Why I built it Most expense apps want an account before they do anything, or they lose your data when you change phones. FinWise is made for Indian users who also split costs on trips and in groups, so those splits are part of the app, not an add-on. #### How the data is used - **On your phone first.** Every account, expense and budget is saved in a local database (Drift, which is SQLite) before anything else. The app is fast and works offline. - **Sync is optional.** If you want the same data on your other phones, it syncs through Supabase or your own Google Drive. Each row is pulled by its last-changed time. - **Kept private in the database.** On Supabase, every table has row-level security, so a signed-in user can only reach their own rows. - **Trips and groups.** Members, expenses and each person's share are stored as related rows, which is why the cloud side is Postgres, not a simple document store. A settle-up screen turns that into "who owes whom". - **Not shared with other people yet.** Sync works across your own devices. Sharing a trip with a second real person is planned as its own piece of work. #### Key decisions - **Local database first, cloud second.** The app never waits for a server, and sync is something you add. - **Supabase (Postgres) instead of Firebase.** Splitting costs between members is relational, and SQL handles it cleanly. - **Deletes are marked, not removed.** To make deletes sync, a deleted row stays and is flagged. SQLite only runs its cascade rules on a real delete, so I rebuilt every cascade by hand across the 8 synced tables and covered it with 15 tests. [I wrote about it here](/blog/finwise-soft-delete-drift). #### Where it stands In progress. Accounts, categories, budgets, recurring rules, trips and groups with settle-up, backup import and sync across your own devices work today. Real shared trips between different people are next. #### Go deeper How the plan was made: foundation first, cloud second FinWise began as one person, one device, one local database, with no account and no cloud. The cloud sync was planned as milestones, and the order matters: 1. **Make deletes sync-safe and give every feature a repository layer.** No cloud code yet. 2. **Create the Supabase project, schema and security rules.** Nothing in the app talks to it yet. 3. **Sign-in** with Google or email and password. 4. **Sync engine** for accounts, categories and transactions. 5. **Extend sync** to budgets and recurring rules. 6. **Real shared spaces** between different people, planned as its own piece of work. Decisions written down so they were not re-argued: sync is free for every signed-in user, a second device signing in to an account that already has cloud data asks whether to keep both or start fresh instead of silently merging, and live updates were deferred so sync runs when the app opens and shortly after you save. Why local first, and how the cloud copy is protected - Every table already had `updatedAt`, a delete flag and a version column before sync existed, so the schema was ready. The two gaps found in an audit (deletes and missing repositories on budgets and recurring rules) were fixed first. - The Postgres schema mirrors the local one with three deliberate differences: text with a check instead of native enums, exact numbers instead of floats for money, and a user column on every table. - Row-level security is on all 8 tables, so a signed-in user reaches only their own rows. A security and performance check flagged that the user lookup in each policy was being re-run for every row, so every policy now wraps it to run once per query. - Sync is "pull what changed since last time", using the last-changed time on each row. Trips and groups: from a shared pot to "who owes whom" Version one of shared spaces was a single pot with an even split. It then grew in three steps: 1. **Contributions and payments between members**, so you can record "Meera paid me back ₹3,000". 2. **Uneven splits**, for the person who skipped the dinner. 3. **A settle-up screen** that turns all of it into who owes whom. FinWise never moves money itself. That boundary is deliberate, and a UPI shortcut that opens GPay or PhonePe with the amount filled in is planned, not built. Moving in from another app To make switching easy, I took apart a popular money manager's backup file (a plain SQLite file with hundreds of real transactions, transfers, budgets and recurring rules) and built an importer from the real rows, not from guesses. It works on the web too, where there is no file system to read. Google Drive as a second sync option Some people do not want their data in Supabase. Drive was added as an alternative: one JSON file per table in the app's hidden data folder, with sign-in still handled the same way. Switching backends resets the sync position, so the next sync starts cleanly against the new store. Honest limits: it is a whole-file read and write, so two devices pushing the same table in the same few seconds could overwrite each other. That is acceptable for one person's own data, and it is written down as a known limit. It is also not yet checked against a real Google account end to end, and the option is hidden on the web. Design: three looks, one rule about the background The app has three selectable looks, with Glass Forest as the default: frosted white cards floating on a mint gradient. A hand-built blur is used on a few large surfaces and never per row in a scrolling list. The page background is painted once, so no screen can punch a hole in it. All money amounts use a monospace font so digits line up, and negatives use a proper minus sign. Honest limits - Sync is across one person's own devices. Sharing a trip with a second real person is not built yet. - The Drive option has not been tested with a real account, and the web version does not offer it. - The more screens, the more edge cases: the form screens inside Accounts, Transfer and Categories do not follow the three looks yet. ### Nirai: offline-first to-do app URL: https://sarankumar.dev/projects/nirai Status: In progress. Platforms: Android + macOS. Stack: Flutter, Riverpod, Drift, Google Drive API, ML Kit. Role: Solo product designer and engineer, from research to build and testing Live demo with made-up data: https://nirai-managetask-demo.web.app/ A free to-do app that keeps your data on your phone and syncs it to your own Google Drive. No server, no account. Works today: - Natural-language quick add ("tomorrow 3pm #work p1") - Inbox, Today, Upcoming, board and calendar views - Pomodoro focus timer and habit streaks with reminders - Background sync to your own Google Drive #### The idea A to-do app that keeps your tasks on your phone and syncs them to your own Google Drive. There is no server and no account to run. #### Why I built it To-do apps are usually paid, full of upsells, or keep your tasks on someone else's server. Nirai is for people who want a fast, free app where the data stays theirs, with the speed of tools like Todoist. #### How the data is used - **On your phone.** Every task, project, label and habit is saved in a local SQLite database first, so the app is instant and works offline. - **Sync through your Drive.** If you sign in with Google, the app keeps one private file in its own data folder in your Google Drive. Each device downloads it, merges it with its own data and uploads the result. Nothing goes to a server of mine. - **No account needed.** Without signing in, you still get every feature, stored on the device. - **Safe to merge.** If two devices edit different parts of the same task, both edits are kept. If they change the same field, the newer one wins. Deletes are marked so they spread to other devices, and the whole merge is applied in one transaction that rolls back if anything fails. - **Crash reports** have your text, emails and file paths stripped out before they are sent. #### Key decisions - **Google Drive as the relay.** No backend means nothing to pay for and nothing of yours on my machine. - **A merge with the same answer on every device.** Ties are broken in a fixed order, so it does not matter which phone syncs first. - **Local first, always.** Writes never wait for the network. [How the sync works, step by step](/blog/nirai-drive-sync-no-backend). #### Where it stands In progress, on Android and macOS. Quick add in plain language, Inbox, Today and Upcoming, list, board and calendar views, a focus timer, habits with reminders and Drive sync work today. #### Go deeper The problem: the vendor owns the server Before writing code I read reviews and competitor pricing. The same complaints kept coming back: paywalls on the free plan, worry about task history sitting on a startup's server, unreliable sync and reminders, and apps that shut down and took people's data with them. The insight was that these are not five separate problems. They share one root cause, which is that the vendor owns the server. Remove the server and several of them disappear at once. I was careful about the claim: small apps already sync to Drive, so the gap is the combination (free with no project cap, offline-first, your own storage, Android and Mac both polished) done well, not any single feature. How sync works without a server Syncing through a plain file is harder than it sounds. Drive has rate limits, there is no push channel, two devices can edit the same task offline, and a bad merge can silently destroy data. | Concern | Approach | |---|---| | Cheap when idle | Check only the file's version on Drive and a local change fingerprint. If neither changed, nothing is transferred. | | Battery and quota | Push a few seconds after edits settle, never per keystroke. Poll every 15 seconds in the foreground, less often when hidden, and back off on quota errors. | | Two devices edit the same task | Merge field by field using a saved copy both sides last agreed on, so a note edited on one device and a completion on another both survive. | | Fields that belong together | Treated as one unit, for example a due date and its repeat rule. | | Deletes | A flag on every synced table, so a delete spreads instead of coming back. | | Photos and documents | Travel as separate files, found by name. | | Fear of the first sync | A safety copy of your data is written before a device first merges with an account. | To prove it, I wrote a randomised test where three simulated devices make random edits offline, sync in random order, and must all end with identical data. [The step-by-step sync story is a blog post](/blog/nirai-drive-sync-no-backend). Design: Todoist's logic, Nirai's own identity I copied Todoist's behaviour, which is proven and familiar, but not its look. - **Flat, calm surfaces.** No shadows except on drag, and hairline-divided rows instead of boxed cards. - **Amber for overdue, not red.** Red makes people feel guilty and a to-do app should not punish you. Red is kept for priority 1 and destructive actions, so it means something. - **Progressive disclosure.** In a task, only the fields that are set are shown. The rest appear as small "+ Field" chips, so a new task is not a wall of empty form fields. - **Today as "My Day".** A progress ring, today's habits as one-tap chips, an "Up next" card with a jump into Focus, and one "Move all to today" button for overdue tasks. - **Behaviour-based features.** A "Wrap up the day" ritual that asks you to decide each open task, a day-load bar with a "Spread out" suggestion on overloaded days, and a hint to make a habit when a quick-add repeats daily. Features, and why each one exists | Feature | Why | |---|---| | Natural-language quick add | Capture has to be faster than forgetting. A hand-written parser shows live chips so you see how it understood you. | | Filter queries such as `today & p1` | Power users get saved filters, compiled to typed database queries. | | Camera OCR | Turn a printed or handwritten list into tasks. It runs on the phone, so no image leaves it. | | Voice dictation | Speech feeds the same parser. | | Biometric lock | Privacy as a feature, with an auto-lock timeout and a screen-switcher privacy cover. | | Focus timer | Tied to a task, and each session is logged as a comment. | | Habits | Streaks are aware of scheduled days, and "today still pending" does not break a streak. | | Recurring tasks as events | Each completion is stored, not a due date reset, so history and streaks are kept. | | Todoist import | Making it cheap to leave builds trust in joining. | Engineering: how I know it holds up - **Performance measured on a real phone** (Xiaomi 14, 120 Hz, so an 8.33 ms frame budget). One keyboard-opening frame cost 14.8 ms because a card was being repainted on every step of the keyboard rising. Adding a repaint boundary and removing a delayed layout jump brought it to 4.2 ms. - **A randomised monkey test** performs random interactions across many seeds and found real crashes that normal tests did not. - **A responsive sweep** runs 14 widths, two text sizes and light and dark, and fails on any overflow with the exact file and line. - **Screens rendered headlessly** to images so layouts can be checked without a device. - **Pure-Dart logic.** The parser, recurrence, filters, habit stats and day balance have no Flutter dependency, so they are easy to unit test. - **Android 14 exact-alarm limits** were identified early, so reminders got proper permission handling instead of being discovered through bad reviews. Trade-offs and honest limits - **No real-time sharing.** File-based sync cannot do live shared lists well, and I chose not to compromise the core promise to get it. - **Google-only storage.** Without a Google account there is no sync. Other storage options are on the roadmap. - **Polling, not push.** Drive has no push for this scope, so there is a few-second delay between devices. - **Clocks matter.** With no server, each phone's own clock decides which same-field edit is newer. - **Parity is not a product.** Chasing feature parity can become a trap. My own point of view started when I built My Day, Wrap up and day balance, and I would start that earlier. - **Honest outlook.** Indie productivity apps rarely earn much. I treat Nirai as a craft and learning project with optional upside. ### NallHub: school management app URL: https://sarankumar.dev/projects/nallhub Status: In progress. Platforms: Android + web. Stack: Flutter, Riverpod, Supabase, Firebase, GoRouter. Role: Solo founder, product designer and full-stack developer Live demo with made-up data: https://nallhub-demo.web.app/ A white-label school management app for private schools in Tamil Nadu, with separate tools for admins, teachers and parents, in English and Tamil. Works today: - Admin tools for students, teachers, classes, subjects, academic years and a timetable grid editor - Teacher invitations by email, with a self-service set-password link - Parent dashboard with report cards (PDF), leave requests and messaging - English and Tamil, checked on a real phone #### The idea One app for a private school: admins run the school, teachers mark attendance and set homework, and parents see only their own children. It works in English and Tamil. #### Why I built it Small private schools often run on paper registers and scattered spreadsheets. NallHub puts students, classes, attendance, homework, exams and announcements in one place, for schools of roughly 100 to 500 students in Tamil Nadu. #### How the data is used - **One database, one school at a time.** Everything lives in Supabase (Postgres), and every table has row-level security, so a school can only ever see its own data. - **Each role sees only what it needs.** An admin sees their whole school. A teacher sees only the classes they are assigned to. A parent sees only their own children and those children's classes. - **The server decides, not the app.** Sensitive actions such as saving attendance, entering exam marks or recording a fee payment run as database functions that check who is calling, and never trust IDs sent by the phone. - **Accounts are by invitation.** An admin enters a teacher or parent, an Edge Function creates the account, and the person sets their own password from a link. - **Files stay private.** Timetable files go in a private storage bucket and open through links that expire after an hour. - **A student keeps one identity.** The permanent student record is separate from the yearly class, so promoting a student adds a row and keeps the history. #### Key decisions - **Set the curriculum once.** Subjects belong to a grade-group, and every section inherits them. - **One login, several roles.** A person can be an admin, a teacher and a parent, and the app asks which one to use. - **Security first.** Every database change has a SQL test that checks nobody can read another school's data. #### Where it stands In progress, on Android and web. Admin tools, teacher invites, attendance, homework, the parent dashboard and Tamil and English work today. It has been tested on a real phone, with large text, small screens and dark mode. #### Go deeper Who has the problem, and why the options did not fit | Person | The pain today | |---|---| | **Parent** | "Was my child absent today? What is the homework?" The answer comes late, through a noisy WhatsApp group or a call to the teacher. | | **Teacher** | Marks attendance on paper, copies it again for the office, and posts homework in several groups. | | **School admin** | Setting up a new year means re-typing classes, subjects and teachers, and building reports by hand. | | **School owner** | Cannot afford a large ERP and does not trust "free" apps with children's data. | Big school systems are built for big schools. WhatsApp has no structure, no history and no privacy between classes. Spreadsheets give parents no access and no notifications. The gap was something cheap, simple and safe enough for a 300-student school. Four design bets 1. **Built for the small school.** The whole setup must be doable by one non-technical admin in one sitting. Schools do not sign themselves up: a platform admin creates the school and its first admin, which stops fake tenants. 2. **Grade-groups, so nobody types the same thing twice.** Subjects are defined once for a grade (Grade 1, or Grade 11 Biology) and every section inherits them. This also covers Tamil Nadu's higher-secondary streams, and year rollover copies the structure forward. 3. **Students are permanent, class membership is yearly.** Identity is stored once, and each year's class is a separate row, so promotion keeps history and a child is never duplicated. 4. **Real roles, including two hats.** One login can be admin, teacher and parent, and the person switches role instead of keeping several accounts. How a school's data stays private It is children's data, so security was designed first, not added later. 1. Row-level security is on every table, and anonymous users can read nothing. 2. Small helper functions (such as "is this person an admin of this school") keep the policies simple and fast. 3. The server is the source of truth. Functions such as `submit_attendance` work out the school, the person marking and their role on the server, and never trust the app to say who it is. 4. Writes go through checked functions. Marks must be between zero and the maximum, the student must be in that class, and the caller must teach it. 5. A suspended school is locked out by a rule on every table that has a school. 6. Automated isolation tests run as admin, teacher, parent and outsider, and always roll back. The latest run passed 15 role-isolation checks on live data. A real bug taught me the rule behind step 2: a policy on one table that looked up a second table, whose own policy looked back at the first, caused an "infinite recursion" and would have broken login. The rule is now written down ("never loop policies; use a helper function") and the tests catch it. Hard problems and how I solved them | Problem | What happened | Fix | |---|---|---| | Policies that loop | Two policies referenced each other and login queries failed. | Moved the lookups into helper functions, wrote a rule, and added isolation tests after every policy change. | | Edge function could not read tables | Hand-made tables had no privileges for the service role. | A migration to grant them. | | Invite email returned 401 | The guard used an admin call that fails with the new secret-key format. | Compare the key directly in a timing-safe way. | | Activation link failed | The page sent `token`, the API expects `token_hash`. | Fixed the page and documented the flow. | | Deleting a staff login deleted their work | Audit columns cascaded from the auth users table. | A migration to keep history. | | Overflow on small phones, big fonts and Tamil | Tamil words are long and layouts broke. | Layout tests at 320 px, double text size, Tamil and dark mode found and fixed real overflows. | | Router crashed on refresh or with the wrong role | The router was rebuilt and its guards were weak. | Created the router once, added a role guard and a not-found page. | | Visitors cannot sign in to a demo | A real backend needs accounts and email. | An in-memory fake backend that runs the real app code. | The demo runs the real app on a fake backend A recruiter will not create an account or wait for an invite email. So a demo build swaps the network layer for an in-memory one with its own query engine, fake sign-in and a seeded school. The real repositories and screens run unchanged, so nothing in the interface is faked. Tests run the real repositories against it, and normal builds never touch the demo code. The demo is hosted on its own site, blocked from search, and separate from the real activation page. How I know it works, and the honest limits - `flutter analyze` is clean, and 447 tests pass (another 34 visual tests need screenshots to run). - A rules script counts banned patterns and can only go down. Hard-coded colours in pages went from 65 to 0, and literal font sizes from 208 to 0. - Performance is aimed at 120 Hz phones, with a frame budget of 8.33 ms, and a script collects frame stats from a real phone. What is not done: timing and memory on a real device and full phone walkthroughs are not yet verified, email delivery depends on an SMTP setup that was not confirmed end to end, there are no push or SMS notifications yet, and separate test and live Supabase projects should have existed from day one. Online fee payments are parked on purpose, because money handling needs legal and gateway work. What I learned 1. Design the security model first. Adding tenant isolation later is far harder. 2. A rule that is not measured is a wish. 3. Test real languages. Tamil text exposed bugs English never would. 4. Say no to scope. Parking payments protected quality. 5. Make the demo effortless, so a project that needed setup becomes one link. ### Coin18: crypto research app URL: https://sarankumar.dev/projects/coin18 Status: In progress. Platforms: Mobile. Stack: Flutter, GetX, Node.js, Express, fl_chart. A market-research app for browsing coins, charts and a personal watchlist, backed by its own Node.js API that hides provider keys and caches data. Works today: - Ranked coin list with search, sort and filters - Coin detail page with an interactive price chart - Global market stats and a personal watchlist - Node.js API with caching, deployed on Render #### The idea A calm place to research crypto markets: browse coins, see a price chart and keep a watchlist. It is a research tool, not an exchange, wallet or trading app. #### Why I built it Crypto data is easy to find and hard to browse calmly. Coin18 shows a ranked list, search and filters, and a clear chart, with a loading, empty or error state on every screen instead of a blank page. #### How the data is used - **Market data comes through my own server.** The app never calls a data provider directly. It talks only to the Coin18 API, a small Node.js and Express service. - **The server protects the key and the limits.** The provider key lives only on the server. Responses are cached for 60 to 300 seconds, and if the provider fails the API returns the last cached answer instead of an error. - **Smaller responses.** The server trims each response from about 300 KB to about 2 KB before it reaches the phone. - **Your watchlist stays on your phone.** There are no accounts. The watchlist is saved on the device and refreshed in one batch. - **Honest about freshness.** Every response says when it was refreshed, and the app never presents prices as financial advice. #### Key decisions - **A backend at all.** A key inside an app can be extracted, so it is kept on a server. - **A replaceable provider.** The provider code sits behind an adapter and the API is versioned from the first endpoint (`/v1`), so changing provider needs no app update. - **Small and focused.** No trading, payments, accounts or social features until the basics are solid. #### Where it stands In progress. The market list, search, coin detail with chart, market stats and watchlist work. The backend runs on Render, and the free plan makes it sleep when idle. ### Clean Scanner: offline document scanner URL: https://sarankumar.dev/projects/clean-scanner Status: In progress. Platforms: Android. Stack: Flutter, Riverpod, ML Kit, SQLite, pdf. An offline document and ID scanner. Clean PDFs, no ads, no login, and nothing leaves the phone. Works today: - Scan, crop, rotate and filter pages - OCR to a searchable PDF (English and Hindi) - Unlock and password-protect PDFs - QR and barcode scanner #### The idea A document and ID scanner that keeps everything on your phone. No ads, no login, no watermark, and no internet needed for its main features. #### Why I built it Most scanner apps are full of ads, ask you to sign in, put a watermark on your PDFs or upload your documents. Clean Scanner is built around a short list of promises it should never break. #### How the data is used - **Your documents never leave the phone.** Scanning, cropping, filters and text recognition (OCR) all run on the device. Page details are saved in a local database and the files sit on the phone's storage. - **No network for the core features.** The internet permission is removed from the release build, so the app itself cannot make network calls. One known exception: Google's scanner models are downloaded by Play Services the first time, so a fresh install has to go online once before it can scan. - **Nothing is collected.** There is no analytics tool and no crash reporter that sends data out, so the Play Store can say "no data collected" truthfully. - **You decide what is shared.** A PDF is only exported or shared when you ask. #### Key decisions - **Promises first.** No ads, no login, no watermark, no subscription and no cloud upload. Any change that touches one needs a deliberate decision. - **A size budget.** The app stays under 60 MB. The QR scanner reuses Google Play Services' barcode model instead of adding a second copy. - **I built my own scanner, then went back to Google's.** My live edge detector lost to ML Kit on real documents on a real phone, so I switched back and kept my code where it still helps. [The full story](/blog/clean-scanner-ml-kit). - **Made for cheaper phones.** It targets Android phones in the ₹8,000 to ₹12,000 range, and has English, Tamil and Hindi interfaces. #### Where it stands In progress, on Android. Scanning, OCR to a searchable PDF, unlock and protect for PDFs, a QR and barcode scanner and an optional app lock work today. #### Go deeper The promises, and how each one is enforced A promise written only in a README gets broken quietly later. So each one has an enforcement point. | Promise | How it is enforced | |---|---| | No network call for any core feature | The internet permission is removed in release builds, so a dependency that tries to add it loses. | | No cloud upload of documents | OCR, barcode scanning and PDF work all run on the device, and there is no backend. | | No ads, no watermark, no login | There is no ad SDK, no overlay step in export and no account system. | | No subscription | One one-time Pro purchase, and nothing else. | | "No data collected" on the Play Store | No analytics SDK and no crash reporter that sends data out. | | Under 60 MB | Measured after every dependency added. | | Core features stay free | ID Card Mode, single-document OCR and exact-KB export are written down as never moving behind Pro. | Anything that would break one of these is treated as a product decision to raise, not a change to quietly make. **The one exception, documented:** the live scanner is Google's, and its models download on first use, so a phone that has never been online cannot scan until it has been once. It is recorded as an accepted trade-off, because a documented exception can be revisited and a hidden one becomes a surprise bug. How a photo becomes a PDF with no server Camera or gallery, then a crop check with draggable corners, a perspective fix, page review, and finally export. Filters, OCR and the PDF are all made on the phone. - Files live on disk and only details such as paths and page order live in the local database, never image blobs, so a 50-page document cannot run a cheap phone out of memory. - Filters are non-destructive: the original is kept and the processed image can be rebuilt. - Heavy work runs off the screen's thread, with real progress ("Page 3 of 12"). - Errors the user must understand (storage full, permission denied, a corrupt PDF) return a clear result instead of crashing. I built my own scanner, then went back to Google's The live outline hunted constantly and was wrong on tilted pages. There were two causes: the viewfinder was Google's and could not be tuned, and my own still-image detector really was bad (it could only draw an upright rectangle, so it could not correct perspective). I built a new detector in about 1,400 lines of plain Dart, with 39 tests. It lost to Google's scanner on real documents on a real phone, so capture went back to ML Kit the same day. The detector now does a different job: it crops gallery imports, powers the crop check screen and the optional crop in page review. The lesson: 39 passing tests on made-up images said nothing about real paper. [The full story is a blog post](/blog/clean-scanner-ml-kit). Decisions where the obvious choice was wrong | Decision | Chosen | Rejected, and why | |---|---|---| | PDF password | A hand-written implementation of the standard PDF security handler | A library whose free tier still needs a vendor account and license key. | | Removing a PDF password | A real, open-source PDF library | Writing my own PDF parser. I first ruled the feature out, then saw the parser did not have to be mine. | | OCR | ML Kit, English and Hindi | Tamil OCR, because ML Kit does not support Tamil. I checked before promising it. | | Barcode and QR | Share Google Play Services' model (+0.9 MB) | Bundling a second copy (an estimated 3 to 10 MB). | | Fonts | The phone's own font | A package that downloads fonts at runtime and breaks the offline promise. | | Storage | Files on disk, details in the database | Images inside the database. | Each rejection was driven by something that would only have shown up later: a license condition, a runtime download, or a language the model does not support. Exact-size export Upload forms often ask for a file under a fixed size, such as 100 KB. The app offers presets of 20, 50, 100, 200 and 500 KB. JPEG quality does not map neatly to file size, so it does a binary search over quality, and if even the lowest quality is too big it shrinks the image and searches again. If the target is too small to stay readable, it says so instead of returning a bad result. An honest "I can't" beats a confident wrong answer. The size budget, measured honestly Measured on the per-device download slice, not the universal APK, which looks about three times bigger than what Play delivers. | Milestone | Added | Size | |---|---|---| | Phase 2 | local database, PDF, image filters | 20.6 MB | | Phase 4 | ML Kit OCR models | 34.0 MB | | Phase 6 | app lock, in-app purchase | 34.6 MB | | QR scanner | barcode scanning (shared model) | 35.5 MB | | PDF unlock | a real PDF library, file picker | 41.4 MB | | Latest check | ML Kit scanner restored | 42.5 MB | OCR was the single biggest cost (+13.4 MB). One Gradle setting made barcode scanning cost +0.9 MB instead of several. A regression that was not where I looked Scanning felt worse after one session. I suspected packages and Android settings, and ruled each out with evidence. The cause was in my own change: every ID scan was passing through a new edit screen with a default crop that cut 5% off all four edges, and re-saved the image. The rule that came out of it: never put an unconditional crop after a stage that has already cropped, because cropping is destructive and it compounds. The fix made cropping an optional button. What is built, what is not verified, what I left out on purpose Built: scanning, page review, PDF export, filters, folders, search, OCR, ID card mode, exact-size export, merge, split, compress, protect, unlock, sign, PDF to image and a QR scanner. Not verified yet: unlocking a real protected file, opening a protected PDF in Adobe Reader or Drive on a phone, the live scanner on a cheaper phone, and the "WhatsApp installed" share path. The Play Store purchase is not created yet, and the app is built but not published. Left out on purpose, with reasons: PDF to Word or Excel (table detection is a real algorithm problem), smart auto-naming, and Tamil OCR (no supported engine yet). ## Blog posts ### Flutter web and SEO: why my portfolio is plain HTML now URL: https://sarankumar.dev/blog/flutter-web-seo Published: 2026-11-23. Topics: Flutter web, SEO, Astro. My portfolio used to be a Flutter web app that search engines could barely read. Why I rebuilt it as plain HTML with Astro, and what each page has now. > **Short answer:** Flutter web is great for apps and a poor fit for pages that need to be found in search. Build the app in Flutter, and build the website around it (home page, case studies, blog) as plain HTML. I use Astro for that. I build apps in Flutter, so my first portfolio was a Flutter web app too. It had parallax scrolling and floating particles, and it looked good. Search engines could barely read it. #### What was wrong with the old site **The text was not in the page.** Flutter web draws its interface itself, onto a canvas. A browser shows you the words, but the HTML that a crawler downloads has almost none of them. When I checked, the page body had nearly no text. Flutter's own documentation says the same thing in its own way: Flutter web is aimed at apps, not at text-heavy pages such as blogs. **Every address was the same page.** The hosting sent every path to `index.html`, as single-page apps usually do. So `/about`, `/projects` and `/anything-you-type` all answered "200 OK" with the same page. To a search engine that looks like one page with many names, plus an endless supply of pages that should have been "not found". **All the SEO lived in one file.** A title, a description and some structured data in `index.html`, copied into the build with `robots.txt` and a sitemap. Fine for one page, but there was only ever one page. #### What I moved to The site is now built with **Astro**. At build time it turns each page into a finished HTML file, so a crawler gets the full text without running any code. JavaScript only adds extras on top, like the theme switch and the animations; the words are there without it. Each page now has: - **Its own address and its own title and description**, written for that page and kept short enough that Google does not cut them off. - **A canonical link**, so copies of the site at other addresses point back to the real one. - **Structured data** describing what the page is: a person on the About page, an article on each blog post, an app on each case study, plus breadcrumbs. - **A share image** made for the page, so a link pasted into WhatsApp or LinkedIn shows what it is about. - **A real 404.** A page that does not exist now says so, with the right status code. Across the site: - **A sitemap with honest dates.** Each page's "last changed" date comes from its file's history in git, not from the build time. When every date is "today", search engines learn to ignore them. - **`robots.txt` and `llms.txt`.** Search and AI crawlers are welcome, and `llms.txt` is a plain-text summary that AI assistants can read in one go. - **An RSS feed** for this blog. It is also fast: the home page is about 20 KB once compressed, and the server answers in under 100 ms. #### Where Flutter still fits Flutter did not leave the site. Three case studies have a phone you can tap to launch the real app, built with Flutter for the web (I wrote about [how those demos work](/blog/live-flutter-demos-with-fake-data)). That is the right job for it: an app inside a page, not the page itself. #### What I'd tell a client If you are building an app and also need a website: - **Build the app in Flutter.** One codebase for Android, iOS and the web is still the best reason to use it. - **Build the marketing site, landing pages and blog in plain HTML.** Astro, a static Next.js site or WordPress all work. What matters is that each page is real HTML with its own address. - **Flutter web is a good choice behind a sign-in** (dashboards, admin panels, internal tools), where search does not matter and the app does. Pick the tool for the page, not the page for the tool. ### Three ways to put a live Flutter app demo on a portfolio URL: https://sarankumar.dev/blog/live-flutter-demos-with-fake-data Published: 2026-11-23. Topics: Flutter, Flutter web, Firebase, Testing. FinWise, Nirai and NallHub run in the browser on my portfolio with made-up data. Each needed a different trick, depending on where its real data lives. > **Short answer:** build the real app for the web with one compile-time flag, `DEMO_MODE`, and replace only the part that touches real data. Where that data lives decides the trick: seed a local database, swap in an in-memory one, or answer the backend's requests from memory. Screenshots show what an app looks like. A demo shows that it works. So three of my case studies have a phone you can tap to launch the **real app**, built for the web and filled with invented data. Nothing is saved to a server, and nobody needs an account. The rule I set: the demo must be the same code as the real app. No separate "demo app" that can drift away from the real one. #### One flag, set at build time Each app has a single constant: ```dart const bool kDemoMode = bool.fromEnvironment('DEMO_MODE'); ``` and the demo is built with: ```bash flutter build web --release --dart-define=DEMO_MODE=true --output=build/web_demo ``` Because the value is fixed when the app is compiled, a normal build can never switch into demo mode by accident, and the demo build can never reach the real backend by accident. Everything else, every screen, every rule, is the real app. What the flag changes depends on where each app keeps its data. #### FinWise: the data already lives on the device FinWise is offline-first. It writes everything to a local database first and only syncs when you set up an account. So the demo needed very little: - The demo build is made **without** the file that holds the Supabase settings. Without them, the app never creates a Supabase client: no sign-in, no sync and no network calls to a real backend. - On first launch a seeder fills the local database with made-up accounts, spending, budgets and a Goa trip split between four friends. - Your changes stay in your own browser. A "Reset demo data" item in the More screen puts the sample data back. When an app already works without a server, the demo is mostly free. #### Nirai: an in-memory database Nirai also keeps data on the device, but its demo should start fresh on every visit. So on the web, the demo build opens an **in-memory** Drift database instead of a stored one. Two details mattered: - **The sample tasks go in through the app's own repositories**, not straight into tables. If the seed used a shortcut, the demo could show data the real app would never create. Going through the same code keeps it honest. - Drift on the web runs SQLite compiled to WebAssembly, so the build ships `sqlite3.wasm` (about 730 KB). The demo also skips crash reporting, so made-up sessions never show up next to real errors. A reload starts from the same clean set of tasks. #### NallHub: a fake backend, in memory NallHub is different. It is a school management app, and almost everything happens on the server: Supabase sign-in, Postgres tables kept apart per school with row-level security, database functions and Edge Functions. There is no local copy to seed. Skipping the backend would leave an empty app. So I kept the Supabase client exactly as it is and replaced the network underneath it. The demo gives the client a custom HTTP client that answers each request from memory: | Request | Answered by | |---|---| | `/auth/v1/*` | fake sign-in, refresh, current user and sign-out | | `/rest/v1/` | a small PostgREST-style query engine over in-memory tables | | `/rest/v1/rpc/*` | the database functions the app calls | | `/functions/v1/*` | Edge Functions such as invites and email: always "sent" | | `/storage/v1/*` | harmless stubs | The data is a made-up school, and the sign-in screen has buttons to enter as the admin, a teacher or a parent. Two small things made it feel real: - **A 60 ms delay on every answer.** Without it, loading states never appear and the app feels oddly instant. - **Tests that run the real repositories against the fake backend.** The fake is about 1,900 lines, and it is only useful if it answers the way Supabase does. The tests catch the day it stops. This was by far the most work of the three, and the most useful: the same fake backend can drive screen tests later. #### Hosting: its own site, at the root Each demo lives in **its app's own repository and Firebase project**, as a second hosting site (for example `nallhub-demo`) with its own config file. Deploying the demo can never touch the app's real site. - **It must be served at the root of its own address.** Drift's web database would not start from a sub-path such as `/demos/finwise/`, so the demos cannot live inside the portfolio's own hosting. - **`X-Robots-Tag: noindex`.** The demo is not a page anyone should land on from search. The case study is. - **`Content-Security-Policy: frame-ancestors`** lists only the portfolio, so other sites cannot embed the demo in their pages. On the portfolio, the phone shows a still picture until you tap **Launch the demo**. A Flutter web build is several megabytes, and most visitors only want to read, so the demo loads only for those who ask for it. #### What I'd tell a client If you want people to try your app before it is on the stores, a web demo with invented data is a cheap way to do it, as long as it is built from the real code. The first question is where your data lives: - **On the device:** seed it. This is the small job. - **On a server you own:** fake the server at the network layer and test the fake. It is more work, but you get a test tool out of it as well. Either way, keep the demo on its own site, keep it out of search, and load it only when someone taps. ### 7 things to have ready before you hire an app developer URL: https://sarankumar.dev/blog/before-you-hire-an-app-developer Published: 2026-10-27. Topics: Hiring, Mobile apps, Checklist. A short checklist that saves weeks and money: the goal, the users, the must-have screens, the accounts you should own, and who decides. > **Short answer:** know your one-sentence goal, who will use it and on which phones, the three screens it cannot live without, and who decides. Create the store and domain accounts in your own name. A developer can do everything else, but only you can supply these. If you are about to hire someone to build an app, most delays and surprise costs do not come from the code. They come from decisions that were not made yet. These seven are the ones I would sort out first, from shipping apps to both the Google Play Store and the Apple App Store. #### 1. One sentence that says what the app is for Not a feature list. A sentence such as "Parents see their child's attendance the same day" or "Players book a court in three taps". If you cannot say it in one sentence, the app will try to do everything and do none of it well. Every feature later gets the same test: does it help that sentence? #### 2. Who uses it, and on what phone Name the person: a parent, a driver, a gym member. Then find out what they actually hold. In many places most users are on Android phones that are a few years old, on slow connections. That changes real decisions: how big the app can be, whether it must work offline, and which languages it needs. #### 3. The three screens it cannot live without Write down the three screens (or actions) a user must be able to do on day one. Everything else is "version two". A small first release gets into people's hands, and what they tell you after using it is worth more than a long plan. #### 4. Accounts you should own, in your name This is the one people most often get wrong. Create these yourself and add the developer as a team member, rather than the developer creating them for you: - A Google Play developer account (a one-time registration fee). - An Apple Developer Program membership (a yearly fee), which you need for the App Store. - The domain name for the app's website and privacy policy. - Any service the app depends on, such as the Firebase or Supabase project and the payment gateway account. If the developer owns the store account, you do not fully own your app, and moving it later is painful. #### 5. The words, images and languages Logo, app name, short description, screenshots and the text inside the app. If your users read Tamil, Hindi or another language, decide now whether the app should have it from day one. Adding a language later touches every screen, and long words in some languages break layouts that were only tested in English. #### 6. Money and legal basics - If people will pay inside the app, you need a payment gateway account, and that takes time to verify. - Both stores ask for a privacy policy link. If the app collects any user data, you need to know what and why. - If your users are children or students, be extra careful about what data you keep and who can see it. #### 7. Who decides, and how you will review Pick one person who can say yes or no. Agree on a short review rhythm, for example a working build to try every week or two. Teams that review small pieces often find problems while they are still cheap to fix. #### A quick checklist - [ ] One-sentence goal - [ ] Who uses it, and on what phones - [ ] Three must-have screens - [ ] Play Store, Apple and domain accounts in your name - [ ] Logo, texts, languages - [ ] Payment and privacy basics - [ ] One decision-maker and a review rhythm If you have most of this, you can get an accurate estimate quickly. If you want to talk it through, [send me a message](/contact) and I will tell you what is missing. ### I built my own document scanner, then went back to ML Kit URL: https://sarankumar.dev/blog/clean-scanner-ml-kit Published: 2026-10-27. Topics: Flutter, ML Kit, Vision. I replaced Google's ML Kit document scanner with my own edge detector, tested both on a real phone the same day, and went back. Here is what I kept. #### The problem Clean Scanner is an offline document scanner. Its rules include no ads, no login, and no network for the core features. For capture I started with a Flutter package that wraps **Google's ML Kit document scanner**. It worked well, but two things bothered me: - Its on-screen outline jumps around, and I could not configure it. - It needs a module from Google Play services, downloaded the first time you use it. For someone who installs the app while offline, that quietly breaks the "works offline" promise. So I decided to build my own live viewfinder. #### What I built - **A quad detector.** My first still-image detector returned an axis-aligned rectangle, which cannot describe a page photographed at an angle. The new one finds four corners. - **Perspective correction.** A homography solve and a warp, so a trapezoid actually comes out square. - **A frame pipeline.** The detector runs in one long-lived isolate, not a new isolate per frame. If a frame is still being processed, new ones are **dropped, not queued**: a queue makes the outline track where the phone was, not where it is. Image data moves across with `TransferableTypedData` instead of being copied. - **A verify screen.** After every capture you see the photo with its outline, four draggable corners and a loupe, before anything is straightened. - **39 unit tests** on synthetic frames with known corners: a page found within 3% of the truth, a tilted page coming out as a trapezoid, an empty desk returning nothing, jitter damped, and a stray false detection never reaching the screen. I shipped it to a phone. #### The test that decided it I compared my detector and ML Kit side by side on real documents, on a real phone. **Mine found the edges worse.** That is the whole story. My notes from that day say it plainly: a calm outline that misses the page is worth less than a restless one that finds it. All the reasoning about frame rates and jitter did not outweigh what the camera showed. I switched the capture entry point back to ML Kit the same day. One thing made that cheap: every feature (document scan, ID card sides, image-to-PDF, one-shot OCR) reaches the camera through a single function. Swapping the scanner was one change in one place, not a hunt through the app. #### What survived Going back did not mean the work was wasted. The vision code is still used where ML Kit never ran at all: - **Gallery imports.** A photo picked from the gallery has never been cropped by anything. My detector earns its place there. - **The crop verify screen**, and the on-demand **Crop** in page review, both built on the four-corner editor. The live viewfinder code, which was no longer used, I flagged for deletion instead of leaving it to rot. #### A smaller lesson in the same day When scanning felt worse after one session, I first blamed my own changes, and I was partly wrong. I checked and ruled out the obvious suspects one by one before deciding what was actually responsible. Keeping "what the user saw" and "what I changed" as separate questions is what stopped me fixing the wrong thing. #### What I'd do differently I would have run the side-by-side test on a real phone **before** building the frame pipeline, not after. A quick comparison would have told me the detector was not good enough. I'd still have built the detector, because of the gallery case, but not the live viewfinder around it. I'd also keep tracking size. Every dependency was measured against a 60 MB budget, and the last build I measured was about 42.5 MB. Clean Scanner is on its [project page](/projects/clean-scanner). ### Soft deletes in Drift: SQLite's onDelete does not fire on UPDATE URL: https://sarankumar.dev/blog/finwise-soft-delete-drift Published: 2026-10-27. Topics: Flutter, Drift, SQLite, Sync. Why turning deletes into tombstones for sync silently switches off every foreign-key cascade, and how FinWise rebuilt them by hand across 8 tables. #### The problem FinWise started life as a local-only app, with real `DELETE` statements. Then I added sync, and a real delete stopped working: if phone A removes a row, phone B has no way to learn it was removed. It just sees a row it still has, and uploads it again. The standard fix is a **soft delete** (a tombstone). Instead of deleting the row, set `isDeleted = true` and refresh `updatedAt`, so the change travels with the next sync like any other edit. Here is the catch I want to write down. #### SQLite only fires foreign-key actions on a real DELETE In Drift you can declare foreign keys with `onDelete: KeyAction.cascade` or `KeyAction.setNull`. While deletes were hard deletes, those were free. Delete an account and its transactions went with it. Delete a category and its subcategories followed, and transactions pointing at it were set to "no category". SQLite runs those actions when a row is **deleted**. An `UPDATE ... SET isDeleted = 1` is not a delete, so **none of them run**. The moment deletes became tombstones, every cascade in the schema silently switched off. Nothing crashes. The data just becomes inconsistent: a deleted category's transactions still point at it, a deleted space still has members. #### Finding every one Before touching code, I listed every relationship that depended on a cascade or set-null. In FinWise that was ten of them: | Deleting a… | Used to cascade to | |---|---| | Account | its transactions and recurring rules | | Category | its subcategories and budgets; set-null on transactions and recurring rules | | Space (a trip or group) | its members; set-null on transactions | | Space member | set-null on the "paid by" of transactions | | Budget | its per-period amounts | I also picked out the riskiest spot: the category delete was one line with no guards, quietly relying on three cascades at once. The account delete already refused to run if the account had transactions, so its cascade was unreachable and lower risk. #### Rebuilding the cascades Two decisions: 1. **Put the cascade logic in one place, not in each DAO.** A category DAO, a space DAO and a budget DAO all need to tombstone related rows in other tables. I made the cross-table logic live at the database level, where every DAO is reachable, so each relationship is written exactly once. 2. **Every tombstone must also bump the sync fields.** A soft delete that doesn't refresh `updatedAt` and `syncVersion` is invisible to the sync engine. As a simplified sketch: ```dart Future softDeleteCategory(String id) => transaction(() async { final now = DateTime.now(); // 1. the category itself await (update(categories)..where((c) => c.id.equals(id))).write( CategoriesCompanion(isDeleted: const Value(true), updatedAt: Value(now)), ); // 2. what the database used to do for free // (subcategories, budgets, set-null on transactions...) await cascade.afterCategoryDeleted(id, now); }); ``` Doing it inside one transaction means a half-finished cascade can never be left behind. #### Undo needed a change too FinWise lets you undo deleting a transaction. The old undo re-inserted the row. Once a delete means "the row is still there, marked deleted", re-inserting the same primary key collides with the tombstone. Undo had to become "flip `isDeleted` back to false". #### How I tested it For each relationship in the table, a test that uses a **real in-memory database**, not mocks: create the parent and children, delete the parent, assert the children and the set-null columns end up exactly as the old hard-delete would have left them. I wrote 15 dedicated cascade tests, and the project has 300+ automated tests in total. #### What I'd do differently I would have made every table soft-delete-ready from the first version. Retrofitting meant auditing every foreign key by hand. If you are building a local-first app now and think you will sync later, add `isDeleted`, `updatedAt` and a version column on day one, and route every delete through one place. FinWise is on its [project page](/projects/finwise), with a demo you can use in the browser. ### Why you should never put an API key inside a mobile app URL: https://sarankumar.dev/blog/never-put-api-keys-in-a-mobile-app Published: 2026-10-27. Topics: Flutter, Security, Node.js. Anything shipped in an app can be pulled out of it. The fix I used in Coin18: a small server in the middle that holds the key and caches the data. > **Short answer:** a key stored in your app can be extracted by anyone who downloads it, even if you obfuscate the code. Keep the key on a small server of your own, let the app talk only to that server, and add a cache so you also protect your usage limits. #### The mistake It is easy to do. A crypto-data service, a maps service or an AI service gives you an API key. You paste it into your Flutter app, build, and everything works. But an app is just a file that people install on their own phones. Anyone can unpack that file and read the text inside it. Passing the key in at build time does not hide it. Obfuscating the code renames functions, but it does not make the text of your strings secret. What can happen next: someone copies the key and uses your quota, you hit the provider's limit, the bill grows, or the provider shuts the key off and every installed copy of your app stops working until you ship an update. #### The fix: a small server in the middle In Coin18, a crypto research app, the Flutter app never talks to the data provider. It talks to one small Node.js and Express service of mine, and only that service holds the provider's key. ``` Flutter app → Coin18 API (Node.js) → Market data provider (holds the key) ``` The app only knows the base address of my API. The key never leaves the server, so there is nothing in the app to steal. #### What the server also gives you Once you have a server in the middle, three more problems get easier: 1. **A cache that protects your limits.** Responses are kept in memory for 60 to 300 seconds, depending on the endpoint. Ten thousand users asking for the same coin list cost one request to the provider, not ten thousand. 2. **A fallback.** If the provider fails, the API returns the last good answer instead of an error screen. 3. **Smaller responses.** The server trims each response from about 300 KB to about 2 KB before it reaches the phone, which is much kinder to slow connections and data plans. #### Keep the provider replaceable The provider-specific code sits behind an adapter, and the API is versioned from the first endpoint (`/v1`). If you change provider, or the provider changes its rules, you update the server. Nobody has to update the app. #### Be honest in the data Every response carries the time it was refreshed. The app shows it, so users know the prices are delayed and informational. It is a research tool, not a trading app, and it never presents prices as financial advice. #### When you do not need a server Some keys are made to be public, such as a Firebase web configuration or a Google Maps key that you have restricted to your app. Those are protected by rules on the provider's side. The test is simple: if someone copying this key could spend your money or read private data, it belongs on a server. #### A checklist - [ ] Search your app for any secret key or token - [ ] Move it to a server and call the server instead - [ ] Restrict any key that must stay in the app to your app's ID and to the services it needs - [ ] Cache responses and set a sensible time to live - [ ] Return the last good answer if the provider fails - [ ] Version your API from the start The full case study is on the [Coin18 page](/projects/coin18). ### Offline-first sync to Google Drive with no backend URL: https://sarankumar.dev/blog/nirai-drive-sync-no-backend Published: 2026-10-27. Topics: Flutter, Drift, Sync. How Nirai keeps a to-do list identical across devices using one JSON file in the user's own Google Drive, a field-by-field merge, and tombstones for deletes. #### The problem I wanted Nirai to be a to-do app that is free to run for ever. A sync server is a bill and an account system, and it means other people's tasks sit on my machine. So the question was: can two phones stay in sync with **no backend of mine at all**? Google Drive can be the relay. Each person already has a Drive, and the app can be given a private data folder in it. The app never talks to a server of mine, and the data never leaves the person's own Google account. #### The shape of it Every change is written to the local SQLite database first (through Drift), so the app is instant and works on a plane. Sync is a separate step that runs on resume, on a timer, or when the user taps it: 1. Take a snapshot of all local tables in memory. 2. Download the single sync file from Drive. 3. Merge the two with a pure Dart function, `mergePayloads`. 4. Write the merged result into SQLite inside one transaction. 5. Upload the merged file back to Drive. The file is one JSON document with all nine synced tables, a version number and a SHA-256 checksum. The local sync bookkeeping table is never uploaded. The merge being a **pure function** (two payloads in, one payload out, no I/O) is the decision that made everything else testable. I can run it on two in-memory databases and check that they end up identical, without touching Drive. #### Merging: field by field, with last write winning ties Every row has an `updatedAt` and the `deviceId` that wrote it. Each device also keeps a saved copy of the data both sides last agreed on (the base). If a row changed on only one device, that version simply wins. If the same row changed on both, the merge goes field by field against the base: a field changed on one side takes that side's value, so editing a task's notes on one phone and completing it on another keeps both edits. Fields that belong together, like a due date and its repeat rule, are merged as one unit. Only when both devices changed the same field does the newer edit win. That fallback rule is last write wins, and it needs a fixed way to break ties. Here is a simplified sketch (the real code has more fields): ```dart Row pick(Row a, Row b) { if (a.updatedAt != b.updatedAt) { return a.updatedAt > b.updatedAt ? a : b; } // Same millisecond on two devices: if (a.deleted != b.deleted) { return a.deleted ? b : a; // keep the user's data over a delete } return a.deviceId.compareTo(b.deviceId) > 0 ? a : b; // deterministic } ``` The last line matters. If both devices break a tie the same way, then `merge(A, B)` and `merge(B, A)` give the same row, and both phones converge. There is a test that checks exactly that, and a randomised test where three simulated devices edit offline, sync in random order, and must end up identical. Two tables need something smarter than "one row wins": - **Task labels** are a junction table. Each (task, label) pair is its own row with its own last-write-wins, so if one phone adds label X and another adds label Y at the same time, both survive. - **Completions of recurring tasks** are merged as a set keyed by the task and the occurrence time. Two phones completing different occurrences, or the same one, never drop or duplicate anything. #### Deleting without bringing things back A delete that simply removes the row can't sync: the other phone still has the row and will upload it again. So deletes are **tombstones**: the row stays, marked as deleted, with a fresh `updatedAt`. That gives clear rules, and each one has a test: | Situation | Result | |---|---| | Delete, then an older edit arrives | The delete wins, nothing comes back | | Delete, then a newer edit arrives | The edit wins, the row is restored | | Delete, then restore from trash | The later action wins | | Project deleted on A, new task added to it on B | The task is accepted, no foreign-key error | | A deletes, then B, then C syncs | The tombstone reaches every device | The project-and-new-task case is why the merge is applied with `PRAGMA defer_foreign_keys = ON`: foreign keys are checked when the transaction commits, not row by row, so rows can arrive in any order. #### Not corrupting anything - **One transaction.** The merged result is applied in a single database transaction. If any row is invalid, the whole thing rolls back to the state before the sync. There is a test for this. - **Idempotent.** Applying the same payload once or ten times gives identical row counts, and a stale payload arriving late never overwrites a newer local edit. - **Defensive decoding.** Unknown fields are ignored (so a newer app version doesn't break an older one), missing tables become empty, junk entries are dropped, a payload from a future schema version is refused, and a bad checksum is rejected. - **Retries.** Drive errors are mapped to a few typed exceptions, and quota errors (HTTP 403 and 429) back off exponentially. #### What I'd say honestly about the limits Last write wins, the rule for same-field conflicts, uses each phone's own clock, and there is no server to correct it. If one phone's clock is 15 minutes ahead, its edits win any conflict inside that window. I tested and documented this instead of hiding it. For a personal to-do list synced between a person's own devices, I think that is the right trade. It would not be right for a shared document with many editors. #### What I'd do differently I would write the conflict tests before the sync engine, not after. Describing each conflict as a small test (title versus title, due date set versus cleared, delete versus edit) made the rules obvious. The three test files I ended up with (11 conflict tests, 8 deletion tests and 10 payload-compatibility tests) are the real specification of how Nirai syncs. You can see Nirai on its [project page](/projects/nirai), including a demo with made-up data.