{"id":22737044,"url":"https://github.com/kibotu/khan","last_synced_at":"2026-01-02T14:08:03.256Z","repository":{"id":248878250,"uuid":"822449080","full_name":"kibotu/Khan","owner":"kibotu","description":"Khan is to iOS what androidx.startup is to android.","archived":false,"fork":false,"pushed_at":"2024-07-17T14:03:39.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T21:35:29.007Z","etag":null,"topics":["dependency","initialization","ios","startup","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kibotu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-01T07:13:40.000Z","updated_at":"2024-07-17T14:04:02.000Z","dependencies_parsed_at":"2024-07-17T17:22:44.975Z","dependency_job_id":"6d2d4814-f82c-4bcb-826d-11944952c0df","html_url":"https://github.com/kibotu/Khan","commit_stats":null,"previous_names":["kibotu/khan"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kibotu%2FKhan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kibotu%2FKhan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kibotu%2FKhan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kibotu%2FKhan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kibotu","download_url":"https://codeload.github.com/kibotu/Khan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243692993,"owners_count":20332317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency","initialization","ios","startup","swift"],"created_at":"2024-12-10T22:09:21.794Z","updated_at":"2026-01-02T14:08:03.226Z","avatar_url":"https://github.com/kibotu.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Khan for iOS\n[![Build](https://github.com/kibotu/Khan/actions/workflows/build-swift.yml/badge.svg)](https://github.com/kibotu/Khan/actions/workflows/build-swift.yml) [![GitHub Tag](https://img.shields.io/github/v/tag/kibotu/Khan?include_prereleases\u0026sort=semver)](https://github.com/kibotu/Khan/releases) ![Static Badge](https://img.shields.io/badge/Platform%20-%20iOS%20-%20light_green)\n[![Static Badge](https://img.shields.io/badge/iOS%20-%20%3E%2016.0%20-%20light_green)](https://support.apple.com/en-us/101566)\n[![Static Badge](https://img.shields.io/badge/Swift%205.10%20-%20orange)](https://www.swift.org/blog/swift-5.10-released/)\n\nKhan is a robust dependency management and initialization system for modular app components in Swift.\n\n### Key Features\n\n- Automated dependency resolution and initialization\n- Circular dependency detection\n- Comprehensive logging for debugging\n- Debug mode shuffling to detect order-dependent issues\n\n### Setup\n\n1. Add the Khan framework to your project.\n2. Create initializers for your app components:\n\n```swift\nclass DatabaseInitializer: Initializer {\n    static var dependencies: [Initializer.Type] = []\n    static func embark() async throws {\n        // Initialize database\n    }\n}\n```\n\n### Usage\n\n1. Create a Khan instance with your initializers:\n\n```swift\nlet initializers: [Initializer.Type] = [\n    DatabaseInitializer.self,\n    NetworkingInitializer.self,\n    // Add other initializers\n]\n\ndo {\n    let khan = try Khan(initializers: initializers)\n    try await khan.conquer()\n} catch {\n    print(\"Initialization failed: \\(error)\")\n}\n```\n\n2. Khan will automatically resolve dependencies and initialize components in the correct order.\n   Options\n\n- `enableLogging`: Toggle logging on/off (default: true)\n\n### Advanced Usage\n\nFor complex dependency graphs, use `khan.printDependencyTree()` to visualize the initialization order.\n\n## How to install\n\n### Swift Package Manager\n\nAdd the dependency to your `Package.swift`\n\n```swift\n    products: [\n      ...\n    ]\n    dependencies: [\n        .package(url: \"https://github.com/kibotu/Khan\", from: \"1.0.0\"),\n    ],\n    targets: [\n      ...\n    ]\n```\n\n## Requirements\n\n- iOS 16.0 or later\n- Xcode 15.0 or later\n- Swift 5.10 or later\n\nContributions welcome!\n\n### License\n\u003cpre\u003e\nCopyright 2024 Jan Rabe \u0026 CHECK24\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkibotu%2Fkhan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkibotu%2Fkhan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkibotu%2Fkhan/lists"}