Native macOS chat application built with SwiftUI and Firebase.
- Real-time messaging with text, GIFs, stickers, and emoji
- User authentication with invitation system
- Dark/Light mode with Messenger-inspired design
- Admin controls for user management
- Typing indicators and online status
- Auto-updates via Sparkle
- macOS 15.0+ (Sequoia)
- Xcode 16.0+
- Swift 5.9+
- Firebase account
- Giphy API key
git clone https://github.com/dembsky/XDchat.git
cd XDchatCopy the example config and fill in your values:
cp Config.xcconfig.example Config.xcconfigEdit Config.xcconfig and set your Giphy API key:
GIPHY_API_KEY = your_giphy_api_key_here
Get a free API key at developers.giphy.com.
- Go to Firebase Console
- Create a new project
- Add a macOS app with your bundle identifier
- Download
GoogleService-Info.plist - Place it in
XDchat/Resources/
In Firebase Console:
Authentication:
- Go to Authentication > Sign-in method
- Enable Email/Password
Firestore Database:
- Go to Firestore Database > Create Database
- Start in production mode
Firestore Security Rules:
Deploy the included rules:
npm install -g firebase-tools
firebase login
firebase init firestore # select your project
firebase deploy --only firestore:rulesOr copy the rules from firestore.rules into the Firebase Console manually.
open XDchat.xcodeprojXcode will automatically resolve Swift Package dependencies (Firebase, SDWebImageSwiftUI, Sparkle).
- Select your Mac as the run destination
- Press Cmd+R
- First user = Admin: The first user to register becomes the admin
- Register without an invitation code (only for the first user)
- As admin, you can generate invitation codes for other users
XDchat/
├── XDchatApp.swift # App entry point
├── Models/ # Data models
│ ├── User.swift
│ ├── Message.swift
│ ├── Conversation.swift
│ └── Invitation.swift
├── Views/ # SwiftUI views
│ ├── MainView.swift
│ ├── Auth/
│ ├── Conversations/
│ ├── Chat/
│ └── Admin/
├── ViewModels/ # View models (MVVM)
│ ├── AuthViewModel.swift
│ ├── ConversationsViewModel.swift
│ ├── ChatViewModel.swift
│ └── InvitationViewModel.swift
├── Services/ # Backend services
│ ├── AuthService.swift
│ ├── FirestoreService.swift
│ ├── GiphyService.swift
│ └── InvitationService.swift
├── Utilities/ # Helpers
│ ├── Theme.swift
│ ├── Extensions.swift
│ └── Constants.swift
└── Resources/
├── Assets.xcassets/
├── Info.plist
└── Entitlements.entitlements
- MVVM Pattern - ViewModels manage state and business logic
- Services Layer - Singleton services handle Firebase and API communication
- Real-time Updates - Firestore listeners for live data sync
- Theme System - Adaptive colors for Dark/Light mode
XDchat uses Sparkle for auto-updates outside the App Store.
If you fork this project for your own distribution:
- Generate your own Sparkle EdDSA key pair:
./build/SourcePackages/artifacts/sparkle/Sparkle/bin/generate_keys
- Update
SUPublicEDKeyinInfo.plistwith your public key - Update
SUFeedURLinInfo.plistto point to your own appcast - Update
PRODUCT_BUNDLE_IDENTIFIERto your own bundle ID - Sign with your own Developer ID for notarized distribution
To build a signed and notarized release:
export TEAM_ID="your_team_id"
export DEVELOPER_ID="Developer ID Application: Your Name (TEAM_ID)"
export APPLE_ID="your_apple_id@example.com"
export APP_SPECIFIC_PASSWORD="your_app_specific_password"
./scripts/build-release.shSee CONTRIBUTING.md for guidelines.
Make sure GoogleService-Info.plist is in XDchat/Resources/ and contains valid credentials.
Check that your Giphy API key is set in Config.xcconfig.
Verify that Email/Password authentication is enabled in Firebase Console.
Try: File > Packages > Reset Package Caches in Xcode.
This project is licensed under the MIT License - see LICENSE for details.
