https://github.com/cashoefman/fuap
FUAP ("Firebase User Authentication Project") is an iOS application demonstrating robust and privacy-compliant user authentication using Firebase.
https://github.com/cashoefman/fuap
apple authentication firebase ios iphone login swift swiftui xcode
Last synced: 8 months ago
JSON representation
FUAP ("Firebase User Authentication Project") is an iOS application demonstrating robust and privacy-compliant user authentication using Firebase.
- Host: GitHub
- URL: https://github.com/cashoefman/fuap
- Owner: cashoefman
- License: mit
- Created: 2025-05-22T00:32:28.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-05-22T00:33:50.000Z (10 months ago)
- Last Synced: 2025-06-22T19:40:22.941Z (9 months ago)
- Topics: apple, authentication, firebase, ios, iphone, login, swift, swiftui, xcode
- Language: Swift
- Homepage:
- Size: 227 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Support: docs/support/Support_and_Troubleshooting_Guides.md
Awesome Lists containing this project
README
# FUAP iOS App
FUAP ("Firebase User Authentication Project") is an iOS application demonstrating robust and privacy-compliant user authentication using Firebase. The project leverages Swift, SwiftUI, Combine, and Firebase Authentication (Magic Links and Password Authentication), along with Firestore for user profile management.
**Note:** An Android version of FUAP is currently under active development.
## 🚀 Key Features
- **Magic Link Authentication:** Users can sign in seamlessly via email without needing a password.
- **Email/Password Authentication:** Optional traditional authentication with password management.
- **Dynamic User Onboarding:** Automatically detects new users, prompting them for name details and creating a profile dynamically.
- **Firebase Firestore Integration:** User profiles are securely managed using Firestore.
- **Clean Architecture (MVVM):** Clearly separated ViewModels and Views with Combine for reactive event handling.
## 📱 App Flow Overview
1. **Welcome Screen:**
- Users enter their email.
- App checks Firestore for existing user status:
- Existing user with password: prompted to enter password.
- Existing user without password: magic link sent automatically.
- New users: prompted for name entry, then sent a magic link.
2. **Magic Link Authentication:**
- Users click on a magic link sent via email.
- App handles deep link to authenticate and signs in the user.
- New user profiles are created on-the-fly in Firestore.
3. **User Profile:**
- Displays user details (name, email, bio).
- Allows profile editing and optional password setting.
- Users can securely log out at any time.
## 🛠️ Technical Stack
- **Swift & SwiftUI:** Modern declarative UI development.
- **Firebase Authentication:** Magic link (email link) and password sign-in support.
- **Firestore:** Persistent storage of user profiles.
- **Combine:** Reactive programming for state management.
- **Swift Concurrency:** Async/Await for clear asynchronous operations.
## 📁 Project Structure
```
src/ios/fuap/
├── AppCoordinator.swift # Handles app-wide routing and deep link management.
├── FUAPApp.swift # Entry point, Firebase setup, root view injection.
├── RootView.swift # Main navigation container.
├── ViewModels/ # MVVM ViewModels handling logic and Firebase interactions.
│ ├── WelcomeViewModel.swift
│ ├── PasswordEntryViewModel.swift
│ ├── NameEntryViewModel.swift
│ └── ProfileViewModel.swift
├── Views/ # SwiftUI Views representing UI screens.
│ ├── WelcomeView.swift
│ ├── PasswordEntryView.swift
│ ├── NameEntryView.swift
│ ├── MagicLinkSentView.swift
│ ├── ProfileView.swift
│ └── ProfileEditView.swift
└── Assets.xcassets # App icons and color assets
```
## 🧑💻 Getting Started
1. **Clone the repository:**
```bash
git clone
cd src/ios/fuap
```
2. **Install dependencies:**
- Configure your Firebase project.
- Replace `GoogleService-Info.plist` with your own Firebase configuration file.
3. **Open & Run Project:**
- Open `fuap.xcodeproj` with Xcode 16.3+.
- Build and run the app on an iOS 18+ device or simulator.
## 🔗 Firebase Configuration
- Ensure Firebase Authentication has Email/Password and Email Link sign-in enabled.
- Set Firestore security rules to protect user data appropriately.
Example rules for Firestore security:
```javascript
match /users/{uid} {
allow read, write: if request.auth.uid == uid;
}
```
## 📌 Important Notes
- **Privacy Compliance:** Uses Firestore explicitly for user identification, avoiding deprecated Firebase methods affected by Email Enumeration Protection.
- **Debugging:** Comprehensive logging statements are included to ease debugging and provide clarity during development.
## 📃 License
This project is available under the MIT License.