iOS Development8 min read

Building a Social App with SwiftUI and Firebase

Bahadır Tarcan

Bahadır Tarcan

January 5, 2026

When I first started working on Ramadan Social, I knew I wanted to create something special. Not just another tracking app, but a genuine social experience that would help people connect during the holy month. Here's the story of how it all came together.

The Vision

The idea came to me during Ramadan 2024. I noticed that while there were plenty of apps for tracking prayers and fasting, none of them really captured the communal spirit of the month. People wanted to share their journey, encourage each other, and feel part of something bigger.

I sketched out the core features on a napkin at a coffee shop in Istanbul:

  • Track daily prayers, fasting, and Quran readings
  • Connect with friends and see their progress
  • Earn points and achievements for consistency
  • Real-time iftar and suhoor times based on location

Choosing the Tech Stack

For the frontend, SwiftUI was an obvious choice. I've been working with it for over two years now, and its declarative syntax makes building complex UIs a joy. The learning curve was steep initially, but once you get the hang of state management and data flow, you can move incredibly fast.

For the backend, I chose Firebase. Here's why it was perfect for this project:

  • **Real-time Database**: Firestore provides instant sync across all devices—when a friend completes a prayer, you see it immediately
  • **Authentication**: Firebase Auth handles sign-in with Apple, Google, and email effortlessly
  • **Cloud Functions**: Serverless functions for complex logic without managing servers
  • **Scalability**: Firebase scales automatically as the user base grows
  • **Cost-effective**: Pay only for what you use, perfect for indie developers

Building the SwiftUI Frontend

I structured the app using the MVVM pattern, which pairs beautifully with SwiftUI's reactive nature. Each screen has its own ViewModel that handles business logic and Firebase calls.

One of the best parts of using Firebase with SwiftUI is the real-time listeners. When a friend completes a prayer, Firestore pushes the update instantly:

The UI went through several iterations. Early versions were functional but bland. I spent two weeks just on the color palette and typography, drawing inspiration from traditional Islamic geometric patterns while keeping things modern and accessible.

The Firebase Backend

Setting up Firebase was surprisingly quick. Within an hour, I had authentication, database, and cloud storage ready to go.

For the database structure, I used Firestore collections:

  • **users**: Profile data, settings, friend lists
  • **activities**: Prayer completions, fasting logs, Quran progress
  • **social**: Posts, comments, likes

Security rules were crucial since we're dealing with personal religious data. I wrote comprehensive Firestore rules to ensure users can only read their own data and their friends' public activities.

Cloud Functions handle the heavy lifting:

  • Calculating daily streaks and achievements
  • Sending push notifications for prayer times
  • Aggregating leaderboard data

One optimization I'm particularly proud of is the prayer time calculation. Instead of calling an external API for every request, I use Cloud Functions to pre-calculate times for each user's location and cache them in Firestore.

Lessons Learned

Building Ramadan Social taught me several valuable lessons:

  • **Start with the user experience**: I spent too much time on database structure initially. The app only started feeling real when I focused on making the daily tracking flow smooth and satisfying.
  • **Firebase offline support is amazing**: Users can track prayers even without internet, and everything syncs when they're back online.
  • **Community feedback is gold**: I released a beta to 50 users during the last Ramadan. Their feedback completely changed the direction of several features.
  • **Ship early, iterate fast**: The first version was embarrassingly basic. But getting it into users' hands early meant I could learn what actually mattered to them.

What's Next

The app has grown beyond my initial expectations. We're now working on Android support and planning features for the next Ramadan season. The dream is to create a year-round Islamic lifestyle app that helps people maintain their spiritual practices.

If you're thinking about building your own app, my advice is simple: start today. Firebase makes it incredibly easy to get a backend up and running. The best time to plant a tree was twenty years ago. The second best time is now.

Feel free to reach out if you have questions about SwiftUI, Firebase, or building social features. I'm always happy to chat with fellow developers.