Back to OSS
swift-app-template
iOS + Swift Backend fullstack template with Clean Architecture, Firebase Auth, and Firestore
Swift
templateclean-architecturefullstack
Swift App Template
iOS + Swift Backend のフルスタックテンプレート。Clean Architecture、Firebase認証、Firestoreを使用。
必要環境
- Xcode 16+
- Swift 6.0+
- XcodeGen (
brew install xcodegen) - Firebase CLI (
npm install -g firebase-tools)
セットアップ
1. テンプレートからリポジトリ作成
gh repo create my-app --template no-problem-dev/swift-app-template --clone
cd my-app
2. 設定ファイルの生成
make setup
Note:
make setupは状態に応じて動作が変わります。初回は設定ファイルを生成し、設定完了後は Xcode プロジェクトを生成します。
setup.config を編集:
APP_NAME=MyApp
APP_DISPLAY_NAME="My App"
BUNDLE_ID_PREFIX=com.mycompany
BUNDLE_ID=com.mycompany.myapp
DEVELOPMENT_TEAM=XXXXXXXXXX
.env を編集:
FIREBASE_PROJECT_ID=your-project-id
3. Firebase 設定
- Firebase Console でプロジェクト作成
- iOS アプリを追加(Bundle ID は setup.config の BUNDLE_ID と一致させる)
GoogleService-Info.plistをiOS/App/に配置
4. プロジェクト生成
make setup
open MyApp.xcworkspace # APP_NAMEで指定した名前
開発
Firebase Emulator
make emulator # 起動
make emulator-status # 状態確認
make emulator-stop # 停止
Swift Server
make server-run # 起動(Emulator使用)
make server-build # ビルド
make server-test # テスト
iOS アプリ
Xcode でシミュレータまたは実機で実行。
プロジェクト構造
├── iOS/
│ ├── App/ # iOS アプリ
│ └── Packages/
│ ├── Presentation/ # UI層
│ └── UseCases/ # ビジネスロジック層
├── Backend/
│ └── Sources/
│ ├── Server/ # サーバーエントリポイント
│ └── Services/ # バックエンドサービス
├── Shared/ # 共有モデル・API定義
├── firebase/ # Firebase設定
└── Makefile # 開発コマンド
カスタマイズ
エンティティの追加
Shared/Sources/Shared/Entities/- エンティティShared/Sources/Shared/API/Contracts/- API コントラクトiOS/Packages/UseCases/- UseCaseiOS/Packages/Presentation/Stores/- StoreBackend/Sources/Services/- リポジトリ・サービス
ライセンス
MIT