# aws-amplify/amplify-swift architecture

> Architecture diagram of the GitHub repository aws-amplify/amplify-swift, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws-amplify/amplify-swift
- Repository: https://github.com/aws-amplify/amplify-swift

## Overview

Amplify Swift is a pluggable client library that exposes cloud capabilities through category APIs and provider plugins. The principal workflow is an app calling a category on Amplify, which delegates work through that category’s plugin behavior and returns results or ongoing tasks. DataStore adds local model persistence and synchronization; other categories cover identity, object storage, APIs, analytics, location, machine-learning tasks, and push notifications. The README documents these capabilities and the plugin model; sampled implementation excerpts are limited, so provider-level wiring is shown only where supported.

Main entry points: [`Amplify/Amplify.swift`](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Amplify.swift) (Amplify Facade), [`Amplify/Categories/DataStore/DataStoreCategory.swift`](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/DataStore/DataStoreCategory.swift) (DataStore), [`Amplify/Categories/Hub/HubCategory.swift`](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Hub/HubCategory.swift) (Hub Events), [`Amplify/Categories/API/APICategory.swift`](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/API/APICategory.swift) (API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core and Events"]
  node_amplify["Amplify Facade<br/>[Amplify.swift]"]
  node_hub["Hub Events<br/>[HubCategory.swift]"]
  node_logging["Logging"]
end

subgraph group_data["Data APIs"]
  node_api["API<br/>[APICategory.swift]"]
  node_datastore["DataStore"]
  node_models["Models and Queries<br/>[Model.swift]"]
  node_localstore[("Local Persistence")]
  node_remotesync["Remote Sync"]
end

subgraph group_identity["Identity and Storage"]
  node_auth["Authentication<br/>[AuthCategory.swift]"]
  node_storage["Object Storage"]
  node_storagebehavior["Storage Operations"]
  node_s3["S3 Provider"]
end

subgraph group_services["App Services"]
  node_analytics["Analytics"]
  node_geo["Geo and Maps<br/>[GeoCategory.swift]"]
  node_push["Push Notifications"]
end

subgraph group_intelligence["Intelligence"]
  node_predictions["Predictions"]
  node_mltasks["ML Requests<br/>[Identify.swift]"]
end

node_app(("Application"))
node_cloud{{"Cloud Providers"}}

node_app -->|"calls"| node_amplify
node_amplify -->|"routes to"| node_api
node_amplify -->|"routes to"| node_datastore
node_amplify -->|"routes to"| node_auth
node_amplify -->|"routes to"| node_storage
node_amplify -->|"routes to"| node_analytics
node_amplify -->|"routes to"| node_geo
node_amplify -->|"routes to"| node_push
node_amplify -->|"routes to"| node_predictions
node_datastore -->|"queries and mutates"| node_models
node_datastore -->|"persists locally"| node_localstore
node_datastore -->|"synchronizes remotely"| node_remotesync
node_remotesync -->|"checks identity"| node_auth
node_storage -->|"exposes operations"| node_storagebehavior
node_storagebehavior -.->|"implemented by"| node_s3
node_s3 -.->|"transfers objects"| node_cloud
node_api -.->|"connects to services"| node_cloud
node_auth -.->|"authenticates with"| node_cloud
node_analytics -.->|"sends events"| node_cloud
node_geo -.->|"queries location"| node_cloud
node_push -.->|"integrates with"| node_cloud
node_predictions -->|"accepts requests"| node_mltasks
node_mltasks -.->|"invokes ML services"| node_cloud
node_api -->|"dispatches events"| node_hub
node_storage -->|"dispatches events"| node_hub
node_analytics -->|"publishes events"| node_hub
node_datastore -->|"publishes events"| node_hub
node_amplify -->|"provides logging"| node_logging

click node_amplify "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Amplify.swift"
click node_hub "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Hub/HubCategory.swift"
click node_logging "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Logging/LoggingCategory.swift"
click node_api "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/API/APICategory.swift"
click node_datastore "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/DataStore/DataStoreCategory.swift"
click node_models "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/DataStore/Model/Model.swift"
click node_localstore "https://github.com/aws-amplify/amplify-swift/blob/main/AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/Storage/StorageEngine.swift"
click node_remotesync "https://github.com/aws-amplify/amplify-swift/blob/main/AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/Sync/RemoteSyncEngine%2BAuthModeStrategyDelegate.swift"
click node_auth "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Auth/AuthCategory.swift"
click node_storage "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Storage/StorageCategory.swift"
click node_storagebehavior "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Storage/StorageCategoryBehavior.swift"
click node_s3 "https://github.com/aws-amplify/amplify-swift/blob/main/AmplifyPlugins/Storage/Sources/AWSS3StoragePlugin/AWSS3StoragePlugin%2BAsyncClientBehavior.swift"
click node_analytics "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Analytics/AnalyticsCategory.swift"
click node_geo "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Geo/GeoCategory.swift"
click node_push "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Notifications/PushNotifications/PushNotificationsCategory.swift"
click node_predictions "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Predictions/PredictionsCategory.swift"
click node_mltasks "https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Predictions/Request/Identify/Identify.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_amplify,node_hub,node_logging toneBlue
class node_api,node_datastore,node_models,node_localstore,node_remotesync toneAmber
class node_auth,node_storage,node_storagebehavior,node_s3 toneMint
class node_analytics,node_geo,node_push toneRose
class node_predictions,node_mltasks,node_app,node_cloud toneIndigo
```

## Components

### Core and Events

- [Amplify Facade](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Amplify.swift): `Amplify/Amplify.swift`
- [Hub Events](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Hub/HubCategory.swift): `Amplify/Categories/Hub/HubCategory.swift`
- [Logging](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Logging/LoggingCategory.swift): `Amplify/Categories/Logging/LoggingCategory.swift`

### Data APIs

- [API](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/API/APICategory.swift): `Amplify/Categories/API/APICategory.swift`
- [DataStore](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/DataStore/DataStoreCategory.swift): `Amplify/Categories/DataStore/DataStoreCategory.swift`
- [Models and Queries](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/DataStore/Model/Model.swift): `Amplify/Categories/DataStore/Model/Model.swift`
- [Local Persistence](https://github.com/aws-amplify/amplify-swift/blob/main/AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/Storage/StorageEngine.swift): `AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/Storage/StorageEngine.swift`
- [Remote Sync](https://github.com/aws-amplify/amplify-swift/blob/main/AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/Sync/RemoteSyncEngine%2BAuthModeStrategyDelegate.swift): `AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/Sync/RemoteSyncEngine+AuthModeStrategyDelegate.swift`

### Identity and Storage

- [Authentication](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Auth/AuthCategory.swift): `Amplify/Categories/Auth/AuthCategory.swift`
- [Object Storage](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Storage/StorageCategory.swift): `Amplify/Categories/Storage/StorageCategory.swift`
- [Storage Operations](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Storage/StorageCategoryBehavior.swift): `Amplify/Categories/Storage/StorageCategoryBehavior.swift`
- [S3 Provider](https://github.com/aws-amplify/amplify-swift/blob/main/AmplifyPlugins/Storage/Sources/AWSS3StoragePlugin/AWSS3StoragePlugin%2BAsyncClientBehavior.swift): `AmplifyPlugins/Storage/Sources/AWSS3StoragePlugin/AWSS3StoragePlugin+AsyncClientBehavior.swift`

### App Services

- [Analytics](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Analytics/AnalyticsCategory.swift): `Amplify/Categories/Analytics/AnalyticsCategory.swift`
- [Geo and Maps](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Geo/GeoCategory.swift): `Amplify/Categories/Geo/GeoCategory.swift`
- [Push Notifications](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Notifications/PushNotifications/PushNotificationsCategory.swift): `Amplify/Categories/Notifications/PushNotifications/PushNotificationsCategory.swift`

### Intelligence

- [Predictions](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Predictions/PredictionsCategory.swift): `Amplify/Categories/Predictions/PredictionsCategory.swift`
- [ML Requests](https://github.com/aws-amplify/amplify-swift/blob/main/Amplify/Categories/Predictions/Request/Identify/Identify.swift): `Amplify/Categories/Predictions/Request/Identify/Identify.swift`

### Other components

- **Application**
- **Cloud Providers**

## Connections

- Application → Amplify Facade: calls
- Amplify Facade → API: routes to
- Amplify Facade → DataStore: routes to
- Amplify Facade → Authentication: routes to
- Amplify Facade → Object Storage: routes to
- Amplify Facade → Analytics: routes to
- Amplify Facade → Geo and Maps: routes to
- Amplify Facade → Push Notifications: routes to
- Amplify Facade → Predictions: routes to
- DataStore → Models and Queries: queries and mutates
- DataStore → Local Persistence: persists locally
- DataStore → Remote Sync: synchronizes remotely
- Remote Sync → Authentication: checks identity
- Object Storage → Storage Operations: exposes operations
- Storage Operations → S3 Provider: implemented by
- S3 Provider → Cloud Providers: transfers objects
- API → Cloud Providers: connects to services
- Authentication → Cloud Providers: authenticates with
- Analytics → Cloud Providers: sends events
- Geo and Maps → Cloud Providers: queries location
- Push Notifications → Cloud Providers: integrates with
- Predictions → ML Requests: accepts requests
- ML Requests → Cloud Providers: invokes ML services
- API → Hub Events: dispatches events
- Object Storage → Hub Events: dispatches events
- Analytics → Hub Events: publishes events
- DataStore → Hub Events: publishes events
- Amplify Facade → Logging: provides logging
