NewAppLander — App landing pages in 60s$69$39
The Swift Kit logoThe Swift Kit
HomeDocumentation

Documentation

Everything you need to go from clone to App Store. Follow the quick start to ship your first build in under 5 minutes.

Quick Start

Get your first build running in under 5 minutes. TheSwiftKit is designed to work out of the box — clone, configure a few values, and hit Run.

5-minute setup. Most developers ship their first build in a single coffee break.

Prerequisites

Xcode 15+

Latest stable recommended

iOS 16+

Deployment target

Swift 5.9+

Ships with Xcode 15

Setup Steps

1

Clone the repository

Clone the repo and open TheSwiftKit.xcodeproj in Xcode.

Terminalbash
git clone https://github.com/your-username/TheSwiftKit.git
cd TheSwiftKit
open TheSwiftKit.xcodeproj
2

Run the setup script

The setup script creates your Secrets.swift file from the sample and installs any dependencies.

Terminalbash
./setup.sh
3

Add your API keys

Open Config/Secrets.swift and paste your keys. You only need Supabase credentials to start — everything else is optional.

Config/Secrets.swiftswift
enum Secrets {
    static let supabaseURL       = "https://your-project.supabase.co"
    static let supabaseAnonKey   = "eyJ..."
    static let revenueCatAPIKey  = "appl_..."       // optional
    static let telemetryDeckID   = "..."            // optional
}
4

Build and run

Select your simulator or device in Xcode and press Cmd + R. The app adapts automatically based on which keys you provide — missing services fall back to safe no-op implementations.


Project Structure

TheSwiftKit follows MVVM with dependency injection. Every module is self-contained so you can add, remove, or swap features without touching unrelated code.

Folder Layouttext
TheSwiftKit/
├── Config/             # AppConfig, Secrets, FeatureFlags
├── Core/
│   ├── DI/             # Dependency injection container
│   ├── Root/           # App entry point, RootView
│   ├── Routing/        # AppRouter with typed routes
│   ├── Theme/          # DesignTokens, AppTheme
│   ├── Services/       # PurchasesService, AIApiClient
│   ├── Analytics/      # AnalyticsService (TelemetryDeck)
│   ├── Notifications/  # NotificationService
│   ├── Logging/        # AppLogger
│   └── Utils/          # AppEvents, extensions
├── Modules/
│   ├── Onboarding/     # 3 onboarding templates
│   ├── Auth/           # SignInView, auth flows
│   ├── Profile/        # ProfileSetupView, avatar upload
│   ├── Paywall/        # PaywallView, subscription UI
│   ├── Demo/           # TestDrive, LocalDataDemo
│   └── Notifications/  # NotificationsDebugView
├── Backend/
│   ├── Protocols/      # Repository protocols
│   ├── Supabase/       # Supabase implementations + SQL
│   └── Python/         # Flask AI backend
└── Resources/          # Assets, Localizable.strings
Config/App-wide settings, API keys, and feature toggles. The single source of truth for branding and behavior.
Core/Shared infrastructure: DI container, routing, theming, services, analytics, and utilities.
Modules/Feature modules (onboarding, auth, paywall, etc.). Each module owns its views and view models.
Backend/Repository implementations for Supabase, local fallbacks, and the optional Flask AI server.
Resources/Asset catalogs, app icons, and localized strings.

Configuration

Three files control your entire app. Change a value, rebuild, and see the result immediately — no code rewrites required.

AppConfig.swift

The central configuration hub. Set your app name, backend mode, onboarding style, and feature flags in one place.

Config/AppConfig.swiftswift
struct AppConfig {
    static let appName         = "MyApp"
    static let backend: Backend = .supabase   // .supabase or .local
    static let onboardingStyle = .carousel    // .carousel, .highlights, .minimal
    static let layout: HomeLayout = .grid     // .grid or .list

    struct FeatureFlags {
        static let onboarding     = true
        static let authentication = true
        static let paywall        = true
        static let notifications  = true
    }

    struct Legal {
        static let privacyURL = "https://yourapp.com/privacy"
        static let termsURL   = "https://yourapp.com/terms"
    }
}

FeatureFlags

Toggle entire modules on or off. Disabled features are completely excluded from the app flow — no leftover screens or broken navigation.

Just flip a boolean. Set FeatureFlags.paywall = false and the paywall screen disappears from the entire app flow. No other changes needed.

Secrets.swift

Your API keys live here. This file is gitignored by default — duplicate from Secrets.sample.swift and fill in your values.

Config/Secrets.swiftswift
enum Secrets {
    static let supabaseURL            = "https://xxxxx.supabase.co"
    static let supabaseAnonKey        = "eyJ..."
    static let revenueCatAPIKey       = "appl_..."
    static let telemetryDeckAppID     = "..."
    static let aiBackendBaseURLString = "http://127.0.0.1:5001"
}
Missing keys are handled gracefully. The DI container automatically falls back to no-op service implementations, so the app never crashes from a missing API key.

Authentication

Pre-built authentication powered by Supabase with email/password and Sign in with Apple. Session management, profile setup, and avatar uploads are all included.

Email / Password with Supabase

Auth is handled through the AuthRepository protocol. The DI container selects the Supabase implementation when AppConfig.backend == .supabase.

Backend/Supabase/SupabaseAuthRepository.swiftswift
// Sign up and sign in are one-liners:
let session = try await supabase.auth.signUp(
    email: email,
    password: password
)

// Session is persisted automatically.
// Profile setup sheet appears after first sign-in.

Sign in with Apple

The Sign in with Apple button is included in SignInView and ready to enable. Follow these steps:

1

Enable the capability

In Xcode, go to Signing & Capabilities and add Sign in with Apple.
2

Configure Supabase

Enable Apple as a provider in your Supabase dashboard under Authentication > Providers.
3

Remove the disabled flag

In Modules/Auth/SignInView.swift, remove the .disabled(true) modifier from the Apple button.

Customizing the Auth Flow

The auth flow is driven by feature flags. If FeatureFlags.authentication is false, the sign-in screen is skipped entirely and the app launches directly into the main experience.

Core/Root/RootView.swiftswift
// Auth flow is automatic:
// 1. Onboarding (if enabled & not completed)
// 2. Sign In (if enabled & not authenticated)
// 3. Profile Setup (if profile is incomplete)
// 4. Main App

Onboarding Templates

Three production-ready onboarding styles. Switch between them with a single config change.

Carousel

.carousel

Swipeable pages with smooth transitions. Best for visual storytelling.

Highlights

.highlights

Feature-focused cards with bold typography. Great for listing key benefits.

Minimal

.minimal

Single-screen with a CTA. Fastest path to your app for returning users.

Switching Styles

Config/AppConfig.swiftswift
// Change this one line to switch onboarding:
static let onboardingStyle = .highlights  // .carousel, .highlights, .minimal

Customizing Content

Edit the onboarding pages in Modules/Onboarding/OnboardingModels.swift. The __APP_NAME__ token is automatically replaced with your app name at runtime.

Modules/Onboarding/OnboardingModels.swiftswift
static let defaultPages: [OnboardingPage] = [
    .init(
        title: "Welcome to __APP_NAME__",
        subtitle: "Your personal AI assistant",
        systemImage: "sparkles"
    ),
    .init(
        title: "Smart & Private",
        subtitle: "Your data stays on your device",
        systemImage: "lock.shield"
    ),
    .init(
        title: "Ready to Go",
        subtitle: "Set up in seconds",
        systemImage: "rocket"
    )
]

Paywalls & Subscriptions

RevenueCat-powered subscriptions with a beautiful paywall template. StoreKit 2 integration is handled automatically.

RevenueCat Setup

1

Create products in App Store Connect

Set up your subscription products and add them to a subscription group.
2

Configure RevenueCat

Create products and offerings in the RevenueCat dashboard. Align package identifiers to your App Store products.
3

Add your API key

Paste your RevenueCat public API key in Secrets.swift:

Config/Secrets.swiftswift
static let revenueCatAPIKey = "appl_YourKeyHere"

Paywall Customization

The paywall UI lives in Modules/Paywall/PaywallView.swift. Modify the layout, copy, and styling to match your brand. The subscription logic is completely separate in PurchasesService.

Modules/Paywall/PaywallView.swiftswift
// The paywall shows automatically when no active entitlement
// is detected. Customize the UI here — the business logic
// is handled by PurchasesService.

struct PaywallView: View {
    @StateObject private var vm = PaywallViewModel()

    var body: some View {
        VStack(spacing: 24) {
            // Hero section
            // Package options (monthly, yearly)
            // Purchase button
            // Restore purchases link
        }
    }
}

Subscription Management

The Settings screen includes restore purchases, manage subscriptions (deep links to App Store), and displays the current plan and expiry date. All powered by RevenueCat's customer info.


AI Features

Three AI capabilities are built in: text chat, image generation, and vision analysis. All powered by a lightweight Flask backend that proxies OpenAI.

Chat

Conversational AI with streaming responses. Uses GPT-4 via your backend.

Image Generation

Generate images from text prompts using DALL-E. Results displayed inline.

Vision

Analyze images with GPT-4 Vision. Upload or capture photos for AI analysis.

Backend Setup (Flask)

The iOS app communicates with a Python Flask server that wraps the OpenAI API. This keeps your API key off the device.

Terminalbash
# Install dependencies
pip install -r Backend/Python/requirements.txt

# Set your OpenAI key
export OPENAI_API_KEY="sk-..."

# Start the server
python Backend/Python/app.py

# Verify it's running
curl http://127.0.0.1:5001/health
# => { "ok": true }
Config/Secrets.swiftswift
// Point the iOS app to your backend:
static let aiBackendBaseURLString = "http://127.0.0.1:5001"

// Info.plist includes ATS exceptions for localhost during dev.
// For production, use an HTTPS URL.
The AI features are fully optional. If aiBackendBaseURLString is empty or unreachable, the AI tabs gracefully show an unavailable state.

Analytics & Notifications

TelemetryDeck Setup

Privacy-first analytics powered by TelemetryDeck. Just add your App ID and events are tracked automatically.

Config/Secrets.swiftswift
static let telemetryDeckAppID = "YOUR_APP_ID"

// That's it. The AnalyticsService initializes automatically
// when this key is present.
Core/Analytics/AnalyticsService.swiftswift
// Track custom events anywhere in your app:
AnalyticsService.shared.track("subscription_started", properties: [
    "plan": "yearly",
    "source": "paywall"
])

Push Notifications

Request permissions, register for remote notifications, and schedule local notifications — all pre-wired through NotificationService.

Core/Notifications/NotificationService.swiftswift
// Request push notification permissions:
NotificationService.shared.requestPermission()

// Schedule a local notification:
NotificationService.shared.scheduleLocal(
    title: "Time to check in!",
    body: "Open the app to see what's new.",
    delay: 3600  // 1 hour from now
)

Debug View

NotificationsDebugView gives you a test harness for permissions, local scheduling, remote registration, and viewing your APNs token — all accessible in DEBUG builds.


Theming & Design Tokens

Customize your entire app's look with two hex values. The design token system propagates your brand colors to every screen.

Color Customization

Core/Theme/DesignTokens.swiftswift
struct DesignTokens {
    // Change these two values to re-brand the entire app:
    static let primaryHex = "#8A2BE2"   // Purple
    static let accentHex  = "#FF8A00"   // Orange

    // Computed colors used throughout the app:
    static var primaryColor: Color { Color(hex: primaryHex) }
    static var accentColor: Color  { Color(hex: accentHex) }
}
Two hex values. Change primaryHex and accentHex and the entire app updates — buttons, accents, gradients, tints, everything.

Custom Fonts

Add your custom fonts to Resources/ and register them in Info.plist. Then reference them in Theme.swift to apply globally via the environment.

App Theme System

AppTheme is injected via the SwiftUI environment. It supports standard and glass styles, letting you switch the entire visual language of your app.

Core/Theme/Theme.swiftswift
// Access the theme anywhere in your views:
@Environment(\.appTheme) var theme

// The theme provides consistent styling:
Text("Hello")
    .foregroundColor(theme.primaryColor)
    .font(theme.headlineFont)

// Toggle glass style for a frosted-glass aesthetic:
AppTheme(style: .glass)

Deployment

When you're ready to ship, follow this checklist to go from development build to the App Store.

TestFlight Setup

1

Archive your build

In Xcode, select Product > Archive. Make sure you are building for Any iOS Device (not a simulator).
2

Upload to App Store Connect

In the Organizer, click Distribute App and follow the prompts to upload to App Store Connect.
3

Add testers

In App Store Connect, go to your app's TestFlight tab and add internal or external testers.

App Store Submission Checklist

1
Bundle identifier matches App Store Connect
2
App icons are set for all sizes
3
Privacy Policy and Terms URLs are live
4
Remove or guard debug/test screens (TestDrive is DEBUG-only by default)
5
RevenueCat products are in "Ready to Submit" status
6
Push notification entitlement matches your provisioning profile
7
Screenshots and metadata are uploaded in App Store Connect

Production Hardening

Before submitting, ensure these production-specific items are handled:

  • Replace placeholder legal URLs with your real Privacy Policy and Terms of Service.
  • Confirm Secrets.swift is gitignored and not included in your repository.
  • Switch AI backend URL from localhost to your production HTTPS endpoint.
  • Tighten Supabase RLS policies and consider using signed URLs for storage buckets.
  • Set up CI/CD with secure environment variables for API keys.
From clone to App Store. TheSwiftKit is built to get you from first build to App Store submission in days, not months.

That's it — clone, configure, and ship. TheSwiftKit adapts based on the SDKs and keys you provide, so you can start simple and layer on services when you're ready.