Part - 1 : Why I Used Supabase for Image Uploads in My iOS App Instead of Firebase

LeftOverLink is an iOS community app I built to help reduce food waste by connecting people who have leftover food with those who need it. Users can create profiles, post available food donations, and see posts from other users nearby. The goal is to make food sharing simple, safe, and accessible.

Feature Overview: Profile & Donation Posts

  • User Profiles: Every user can create a profile with a name, photo, and contact info.

  • Donation Posts: Users can create posts about leftover food they want to share. Each post includes:

    • Food photo

    • Dietary tag (vegan, meat, other)

    • Portion info (for how many people)

    • Pickup location

    • User info (who made the post)

Both profiles and donation posts require storing user information along with images, which brought up a tricky challenge: where and how to store images efficiently.

The Problem with Firebase (Spark Plan)

  • Firebase Spark (free) plan doesn’t allow storing image files beyond very limited free storage, so I couldn’t store profile photos or donation post images directly.

  • Storing just the image URLs is possible, but the app needed a reliable way to upload and host the actual image files.

  • Needed a solution that:

    1. Uploads and hosts images reliably

    2. Works seamlessly with SwiftUI

    3. Integrates smoothly with Firestore for storing post and user metadata

  • This sets up Supabase perfectly as the solution, since it allows hosting the image files while Firestore keeps the URLs and post info.

    Procedure: Uploading Images with Supabase & Saving URL in Firestore

    1. User selects an image

      • Via SwiftUI’s ImagePicker, the user chooses a profile photo or donation post image.
    2. Upload the image to Supabase

      • The selected image is uploaded to a Supabase storage bucket (e.g., "profile-images" or "post-images").
    3. Get the URL after successful upload

      • Supabase returns a public URL for the uploaded image.
    4. Save the profile or post in Firestore

      • Store the user or donation post data in Firestore along with the Supabase image URL, instead of the image itself.

Result:

  • Images are hosted on Supabase reliably.

  • Firestore holds only the URL and metadata, keeping the app lightweight.

  • SwiftUI views can display the images easily via the URL.

1
Subscribe to my newsletter

Read articles from Tabassum Akter Nusrat directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Tabassum Akter Nusrat
Tabassum Akter Nusrat

Former Android dev at Samsung R&D, now diving deep into iOS development. Writing daily about Swift Concurrency, SwiftUI, and the journey of building real-world apps. Passionate about clean architecture, mental health tech, and learning in public.