walternate / Instagram_Clone_SwiftUI

Build Instagram by using SwiftUI and Firebase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Instagram_Clone_SwiftUI

Build Instagram by using SwiftUI and Firebase

TODO

  • Reel
  • Story
  • Chat
  • Video recording and photo capture function
  • Improve upload UI

Requirements

  • iOS 17+
  • Xcode 15.0.0+
  • Swift 5+
  • Firebase (Authentication, Firestore, Storage)

Usage

  1. Clone the project to your local directory
  2. Setup firebase (follow the steps to setup your firebase)

Test on Live Server / Emulators

If you want to test it on live server, please change the Build Configuration to Debug.

Otherwise, keep the Build Configuration to Emulators 截圖 2023-12-04 下午4 32 02

Setup Emulators

If you test it on emulators. Please follow the guide to Setup the emulator

Firebase configuration

  1. Firestore rules
rules_version = '2';

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth != null;
    }
    match /users/{user} {
      allow read, write: if request.auth != null;
    }
    match /usernames/{username} {
      allow read: if true;
      allow write: if request.auth != null;
    }
  }
}
  1. Storage rules
rules_version = '2';

// Craft rules based on data in your Firestore database
// allow write: if firestore.get(
//    /databases/(default)/documents/users/$(request.auth.uid)).data.isAdmin;
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}

About

Build Instagram by using SwiftUI and Firebase


Languages

Language:Swift 100.0%