Manages resources, local or remote, for your app or server-side framework.

What's New

Renamed to Configure



Slack Jenkins Platforms Swift Package Manager Swift 4 Vapor 3

What is this even good for?!

Have you ever had an issue with SPM not supporting resources? How do you get your templates, demo files and I don't know what else from your submodules into your app?

Well, I hope Configure will make your experience with resource files a tiny bit easier.


  • Install resources from a string
  • Install resources from a repo (un-authenticated)
  • Install resources from a repo (authenticated)
  • Install resources from anywhere in the inter-the-web
  • Override existing files on each run if needed
  • Run your install script synchronously (good when you need stuff in before your app fully starts)
  • Run your install script asynchronously

Note System is mainly designed for server-side-swift but will compile fine on any iOS/tvOS or macOS!


Just add following line package to your Package.swift file.

.package(url: "", .branch("master"))


Remote resources

let resource = BasicWebResource(
                    resourceUrl: "", 
                    destinationPath: "Resources/email-template.leaf" // Where to install the file to
try ResourcesManager.default.add(resource)

Github resources

let resource = BasicGithubResource(
                    organization: "LiveUI", 
                    repository: "YourRepo", 
                    branch: "master", 
                    path: "Resources/email-template.leaf", 
                    destinationPath: "Resources/email-template.leaf" // Where to install the file to
try ResourcesManager.default.add(resource)

String resource

import Configure

// Create a string resource
let template = """
Hi #(user.firstname) #(user.lastname)

This is an email template for you


LiveUI team!
let resource = template.asResource(destination: "Resources/email-template.leaf")
try ResourcesManager.default.add(resource)

Run the installer

And when you are ready, run the installer


Further convenience methods

There is a plenty convenience methods to help you create your templates like the one previously mentioned asResource on a string. There is one for a URL, an array or URL's and strings.

Custom resource installers

You can also create your own completely custom installers very easily by using one of the premade protocols, imagine something like this:

public struct ModelResource<T>: Resource where T: Codable {

    /// Your model which conforms to Codable
    public let model: T

    /// Where the final file will be saved
    public let destinationPath: String

    /// Make the resource to be rewritten every time it runs
    public var alwaysOverride: Bool {
        return true

    /// Converting to data
    public func data() throws -> Data {
        let data = try JSONEncoder().encode(model)
        return data

    /// Intializer
    public init(model: T, destinationPath: String) {
        self.model = model
        self.destinationPath = destinationPath


Use with Vapor 3

This package has no dependencies on purpose so a little trick to get into your Resources folder on Vapor 3 just give the Resource a destination that could be made somehow like this:

extension Request {
    /// Gives absolute path URL for the Resources folder
    var resourcesUrl: URL {
        let config = DirectoryConfig.detect()
        var url: URL = URL(fileURLWithPath: config.workDir).appendingPathComponent("Resources")
        return url


Join our Slack, channel #help-boost to ... well, get help :)

Boost AppStore

Core package for Boost, a completely open source enterprise AppStore written in Swift!

Other core packages

  • BoostCore - AppStore core module
  • ApiCore - API core module with users and team management
  • MailCore - Mailing wrapper for multiple mailing services like MailGun, SendGrig or SMTP (coming)
  • DBCore - Set of tools for work with PostgreSQL database
  • VaporTestTools - Test tools and helpers for Vapor 3

Code contributions

We love PR’s, we can’t get enough of them ... so if you have an interesting improvement, bug-fix or a new feature please don’t hesitate to get in touch. If you are not sure about something before you start the development you can always contact our dev and product team through our Slack.


Ondrej Rafaj (@rafiki270 on Github, Twitter, LiveUI Slack and Vapor Slack)


See the LICENSE file for more info.


  • Swift Tools 4.0.0
View More Packages from this Author


  • None
Last updated: Wed Mar 15 2023 06:00:48 GMT-0500 (GMT-05:00)