edit

Vapor Documentation

This is the documentation for Vapor, a Web Framework for Swift that works on iOS, macOS, and Ubuntu; and all of the packages that Vapor offers.

Vapor is the most used web framework for Swift. It provides a beautifully expressive and easy to use foundation for your next website or API.

Getting Started

If this is your first time using Vapor, head to the Getting Started section to install Swift and create your first app.

Like Vapor?

Our small team works hard to make Vapor awesome (and free). Support the framework by starring Vapor on GitHub or donating $1 monthly--it helps us a lot. Thanks!

Other Sources

Here are some other great places to find information about Vapor.

API

Auto-generated API documentation is located at api.vapor.codes.

Stack Overflow

View or ask questions related to Vapor on Stack Overflow using the vapor tag.

GitHub

Source Code

To view the framework's source code and code documentation, visit Vapor's GitHub.

Issues

To view open bug reports and feature requests, or to create one, visit the issues tab on Vapor's GitHub.

Packages

Vapor is a modular framework built for a modular language. Code is split up into modules which are grouped to form packages. Packages can be added to your project by adding the package's Git url to your Package.swift file. Once a package is included, all of its modules will be available to import. You can read more about packages and modules in the Swift Package Manager conceptual overview.

Below is a list of packages and modules that come with or can be used by Vapor projects. Packages will have a link to their respective GitHub page.

Core

Core packages are maintained by the Vapor team.

Included

The following packages are included with Vapor by default.

Tip

These packages can also be used individually

  • Vapor: Swift's most used web framework.
    • Auth: User authentication and persistance.
    • Sessions: Secure, ephemeral cookie based data storage.
    • Cookies: HTTP cookies.
    • Routing: Advanced router with type-safe parameterization.
  • Engine: Core transport layers.
    • HTTP: HTTP client and server.
    • URI: URI parsing and serializing.
    • WebSockets: Full-duplex communication channels over a single TCP connection.
    • SMTP: Send email using Sendgrid and Gmail.
  • Multipart: Fast, streaming, non-blocking multipart parser and serializer.
    • Multipart: Parses and serializes multipart/mixed.
    • FormData: Parses and serializes multipart/form-data.
  • JSON: Conveniences for working with JSON in Swift.
  • Console: Swift wrapper for console IO and commands.
  • TLS: Swift wrapper for CLibreSSL's new TLS.
  • Crypto: Cryptography from LibreSSL and Swift.
    • Digests: Hashing with and without authentication.
    • Ciphers: Encryption and decryption
    • Random: Pseudo and cryptographically secure randomness.
    • BCrypt: Pure Swift implementation.
  • Node: Data structure for easy type conversions.
    • Polymorphic: Syntax for easily accessing values from common types like JSON.
    • Path Indexable: A protocol for powerful subscript access of common types like JSON.
  • Core: Core extensions, type-aliases, and functions that facilitate common tasks.
  • Socks: Swift C Socket API wrapper.
  • Bits: Low level byte manipulation helpers

Providers

These are officially supported packages for Vapor that are not included by default.

  • Fluent: Models, relationships, and querying for NoSQL and SQL databases.
  • MySQL: Robust MySQL interface for Swift.
  • Leaf: An extensible templating language.
  • Redis: Pure-Swift Redis client implemented from the original protocol spec.
  • JWT: JSON Web Tokens in Swift.

Community

These are packages maintained by community members that work great with Vapor.

Providers

Vapor providers are a convenient way to add functionality to your Vapor projects. For a full list of providers, check out the vapor-provider tag on GitHub.

Authors

Tanner Nelson, Logan Wright, and the hundreds of members of Vapor.