A cross-platform notepad built with SwiftUI, Convex, and Better Auth.
The Convex Swift SDK does not yet natively support BetterAuth, so this project shows how to integrate the two.
A full writeup of how this works is available here:
https://bbauman.com/posts/convex-better-auth-swiftui
notepad-demo.mp4
git clone https://github.com/bbauman1/notepad.git
cd notepad# Install dependencies
npm install
# Set up Convex (follow the prompts to create/link a project)
npx convex devThis will create a .env.local file with your Convex deployment credentials.
Copy the example environment file and fill in your values:
cp .env.example .env.localEdit .env.local with your Convex deployment information:
CONVEX_DEPLOYMENT=dev:your-deployment-name
CONVEX_URL=https://your-deployment-name.convex.cloudI have a separate repo for the auth server, located here:
Notepad/Config/Config.swift- UpdateauthServerURLconvex/auth.config.ts- Updatedomain
open Notepad.xcodeprojIf you want to use your own bundle identifier:
- Open the project in Xcode
- Select the Notepad target
- Update the Bundle Identifier in the "Signing & Capabilities" tab
- Update the URL scheme in
Info.plistif needed
- Start the Convex backend:
npx convex dev- In Xcode, select your target device (iOS Simulator or Mac)
- Press
Cmd+Rto build and run
This project is licensed under the MIT License - see the LICENSE file for details.
- Thank you to BetterAuthSwift for making the basic BetterAuth connection much simpler.