# vapor/vapor

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/vapor-vapor).**

25,976 stars · 1,522 forks · Swift · mit

## Links

- GitHub: https://github.com/vapor/vapor
- Homepage: https://vapor.codes
- awesome-repositories: https://awesome-repositories.com/repository/vapor-vapor.md

## Topics

`framework` `http` `http2` `server` `server-side-swift` `swift` `vapor` `web-framework`

## Description

Vapor is a comprehensive server-side web framework designed for building scalable, high-performance applications and APIs in Swift. It provides a non-blocking, event-loop-based runtime that manages concurrent task processing, background job queues, and asynchronous request handling. The framework is built around a dependency injection container that manages the lifecycle and resolution of services, configurations, and database connections throughout the request pipeline.

The framework distinguishes itself through a protocol-oriented design that emphasizes type safety across all layers of the application. It includes a robust object-relational mapper that abstracts database interactions, allowing developers to define data models and execute complex queries using a chainable, type-safe interface. This is complemented by a modular middleware chain for intercepting requests and a built-in templating engine for server-side HTML rendering.

Beyond core routing and request handling, the project offers an extensive suite of tools for modern web development. This includes comprehensive support for authentication via sessions and industry-standard tokens, real-time bidirectional communication through WebSockets, and automated schema-based database migrations. The framework also provides built-in validation logic, cryptographic utilities, and tools for managing application lifecycles and background processing.

The project is distributed as a Swift package, with documentation and tooling that support standard testing frameworks and containerized deployment workflows.

## Tags

### Web Development

- [Web Frameworks](https://awesome-repositories.com/f/web-development/web-frameworks.md) — Provides a high-performance, type-safe environment for building scalable web applications and APIs.
- [Event Loop Runtimes](https://awesome-repositories.com/f/web-development/event-loop-runtimes.md) — Executes asynchronous tasks on a non-blocking event loop to handle high-concurrency network requests efficiently.
- [Route Registration](https://awesome-repositories.com/f/web-development/route-registration.md) — Registers HTTP route handlers using flexible URI patterns including parameters and wildcards. ([source](https://docs.vapor.codes/4.0/basics/routing/))
- [HTML Rendering](https://awesome-repositories.com/f/web-development/html-rendering.md) — Renders HTML templates within route handlers for web requests. ([source](https://docs.vapor.codes/4.0/leaf/getting-started/))
- [Dynamic Template Rendering](https://awesome-repositories.com/f/web-development/dynamic-template-rendering.md) — Renders dynamic HTML by evaluating templates at runtime. ([source](https://docs.vapor.codes/4.0/leaf/overview/))
- [HTTP Servers](https://awesome-repositories.com/f/web-development/http-servers.md) — Allows replacing the default server with custom implementations conforming to the server protocol. ([source](https://docs.vapor.codes/4.0/advanced/server/))
- [Middleware Chains](https://awesome-repositories.com/f/web-development/middleware-chains.md) — Processes incoming requests and outgoing responses through a series of modular, type-safe interceptors.
- [Request Parsing](https://awesome-repositories.com/f/web-development/request-parsing.md) — Automatically decodes incoming HTTP request bodies into structured data types. ([source](https://docs.vapor.codes/4.0/basics/content/))
- [Route Organization](https://awesome-repositories.com/f/web-development/route-organization.md) — Organizes route handlers into modular, reusable collections. ([source](https://docs.vapor.codes/4.0/basics/controllers/))
- [Error Handling](https://awesome-repositories.com/f/web-development/error-handling.md) — Maps custom error types to specific HTTP status codes and response formats. ([source](https://docs.vapor.codes/4.0/basics/errors/))
- [Global Error Handlers](https://awesome-repositories.com/f/web-development/global-error-handlers.md) — Provides global error handling to convert exceptions into structured HTTP responses. ([source](https://docs.vapor.codes/4.0/basics/errors/))
- [HTTP Request Clients](https://awesome-repositories.com/f/web-development/http-request-clients.md) — Provides a unified interface for performing outbound HTTP requests with full header and content support. ([source](https://docs.vapor.codes/4.0/basics/client/))
- [HTTP Server Configuration](https://awesome-repositories.com/f/web-development/http-server-configuration.md) — Configures HTTP server settings including connection backlog, compression, and TLS security settings. ([source](https://docs.vapor.codes/4.0/advanced/server/))
- [Route Grouping](https://awesome-repositories.com/f/web-development/route-grouping.md) — Organizes related API routes into nested groups with shared path prefixes and middleware. ([source](https://docs.vapor.codes/4.0/basics/routing/))
- [Template Data Binding](https://awesome-repositories.com/f/web-development/template-data-binding.md) — Passes structured data to templates using standard encoding protocols. ([source](https://docs.vapor.codes/4.0/leaf/overview/))
- [Template Engines](https://awesome-repositories.com/f/web-development/template-engines.md) — Configures server-side templating engines for view rendering. ([source](https://docs.vapor.codes/4.0/leaf/getting-started/))
- [Custom Middleware Development](https://awesome-repositories.com/f/web-development/custom-middleware-development.md) — Implements custom middleware by conforming to specific protocols to inspect or modify requests. ([source](https://docs.vapor.codes/4.0/advanced/middleware/))
- [Query Parameter Parsers](https://awesome-repositories.com/f/web-development/query-parameter-parsers.md) — Parses URL query parameters into structured types for efficient access. ([source](https://docs.vapor.codes/4.0/basics/content/))
- [Session Management](https://awesome-repositories.com/f/web-development/session-management.md) — Configures session middleware and cookie settings to manage user state across HTTP requests. ([source](https://docs.vapor.codes/4.0/advanced/sessions/))
- [Template Logic](https://awesome-repositories.com/f/web-development/template-logic.md) — Provides conditional logic and loops for dynamic template layouts. ([source](https://docs.vapor.codes/4.0/leaf/overview/))
- [Content Negotiation Utilities](https://awesome-repositories.com/f/web-development/content-negotiation-utilities.md) — Automatically serializes and deserializes request and response bodies between structured objects and various media formats.
- [HTTP Clients](https://awesome-repositories.com/f/web-development/http-clients.md) — Provides a configurable interface for managing outbound HTTP client behavior. ([source](https://docs.vapor.codes/4.0/basics/client/))
- [HTTP Error Handling](https://awesome-repositories.com/f/web-development/http-error-handling.md) — Aborts HTTP requests by throwing errors to return specific status codes to clients. ([source](https://docs.vapor.codes/4.0/basics/errors/))
- [Middleware Configuration](https://awesome-repositories.com/f/web-development/middleware-configuration.md) — Registers middleware globally or for specific route groups to intercept and process requests in a defined order. ([source](https://docs.vapor.codes/4.0/advanced/middleware/))
- [Request Handling](https://awesome-repositories.com/f/web-development/request-handling.md) — Enables inspection of HTTP headers for authentication and metadata verification. ([source](https://docs.vapor.codes/4.0/advanced/request/))

### Data & Databases

- [Data Modeling Frameworks](https://awesome-repositories.com/f/data-databases/data-modeling-frameworks.md) — Define data models by conforming to a protocol and using property wrappers to map class properties to database table fields and unique identifiers. ([source](https://docs.vapor.codes/4.0/fluent/overview/))
- [Query Builders](https://awesome-repositories.com/f/data-databases/query-builders.md) — Implements a fluent query builder for database record manipulation. ([source](https://docs.vapor.codes/4.0/fluent/overview/))
- [Database ORMs](https://awesome-repositories.com/f/data-databases/database-orms.md) — Manages complex data models and relational schemas with type-safe queries and transactions.
- [Object-Relational Mapping Models](https://awesome-repositories.com/f/data-databases/object-relational-mapping-models.md) — Store model data using typed fields, supporting optional values and custom database keys for mapping properties to storage columns. ([source](https://docs.vapor.codes/4.0/fluent/model/))
- [Database Connection Managers](https://awesome-repositories.com/f/data-databases/database-connection-managers.md) — Configure database connections by adding driver dependencies and registering the database instance within the application configuration lifecycle. ([source](https://docs.vapor.codes/4.0/fluent/overview/))
- [Database Migrations](https://awesome-repositories.com/f/data-databases/database-migrations.md) — Registers and executes ordered database schema migrations. ([source](https://docs.vapor.codes/4.0/fluent/migration/))
- [Database Query Joins](https://awesome-repositories.com/f/data-databases/database-query-joins.md) — Combine data from multiple tables by joining models, including support for aliasing models to join the same table multiple times in one query. ([source](https://docs.vapor.codes/4.0/fluent/query/))
- [Database Relationship Mappings](https://awesome-repositories.com/f/data-databases/database-relationship-mappings.md) — Establish relationships between models using property wrappers to define parent-child associations and perform eager loading to efficiently fetch related data. ([source](https://docs.vapor.codes/4.0/fluent/overview/))
- [Object-Relational Mappers](https://awesome-repositories.com/f/data-databases/object-relational-mappers.md) — Provides a database abstraction layer for mapping code objects to records and managing complex data relationships.
- [Object-Relational Mapping Utilities](https://awesome-repositories.com/f/data-databases/object-relational-mapping-utilities.md) — Preload model relations during database queries to access related data synchronously, including support for nested loading of relations on related models. ([source](https://docs.vapor.codes/4.0/fluent/relations/))
- [Document Database Modeling](https://awesome-repositories.com/f/data-databases/document-database-modeling.md) — Model data for document-based storage using custom identifiers, nested structures, and flexible document fields while maintaining the standard database-agnostic interface. ([source](https://docs.vapor.codes/4.0/fluent/advanced/))
- [Object Relational Mappings](https://awesome-repositories.com/f/data-databases/object-relational-mappings.md) — Create a one-to-many relationship between models by referencing a parent relation, allowing for automatic management of foreign keys when creating new child records. ([source](https://docs.vapor.codes/4.0/fluent/relations/))
- [Schema Migration Utilities](https://awesome-repositories.com/f/data-databases/schema-migration-utilities.md) — Define table fields with specific data types and constraints, including primary identifiers, required values, and custom SQL-level column constraints for database schema migrations. ([source](https://docs.vapor.codes/4.0/fluent/schema/))
- [Transaction Management](https://awesome-repositories.com/f/data-databases/transaction-management.md) — Execute multiple database operations within a single transaction block to ensure data consistency, automatically rolling back all changes if any operation within the block fails. ([source](https://docs.vapor.codes/4.0/fluent/transaction/))
- [Database Schema Management](https://awesome-repositories.com/f/data-databases/database-schema-management.md) — Manage database table or collection lifecycles by creating, updating, or deleting schemas, including support for ignoring existing tables during creation to prevent errors. ([source](https://docs.vapor.codes/4.0/fluent/schema/))
- [Foreign Key Constraints](https://awesome-repositories.com/f/data-databases/foreign-key-constraints.md) — Define a parent-child relationship between models by storing a reference to another model's identifier, supporting both required and optional parent associations. ([source](https://docs.vapor.codes/4.0/fluent/relations/))
- [Query Aggregates](https://awesome-repositories.com/f/data-databases/query-aggregates.md) — Calculates aggregates like counts and sums directly within database queries. ([source](https://docs.vapor.codes/4.0/fluent/query/))
- [Query Filtering](https://awesome-repositories.com/f/data-databases/query-filtering.md) — Constrain query results using value comparisons, field-to-field comparisons, subset membership checks, or string pattern matching to filter data precisely. ([source](https://docs.vapor.codes/4.0/fluent/query/))
- [Redis Clients](https://awesome-repositories.com/f/data-databases/redis-clients.md) — Provides configurable connection pooling and authentication for Redis database instances. ([source](https://docs.vapor.codes/4.0/redis/overview/))
- [Schema Mapping Utilities](https://awesome-repositories.com/f/data-databases/schema-mapping-utilities.md) — Define a model schema by specifying the database table or collection name as a static property on the model class. ([source](https://docs.vapor.codes/4.0/fluent/model/))
- [Session Management](https://awesome-repositories.com/f/data-databases/session-management.md) — Supports configurable storage drivers for persisting session data across instances. ([source](https://docs.vapor.codes/4.0/advanced/sessions/))
- [Database Drivers](https://awesome-repositories.com/f/data-databases/database-drivers.md) — Execute raw SQL queries or access database-specific features by casting the database connection to a generic SQL interface or a specific driver implementation. ([source](https://docs.vapor.codes/4.0/fluent/advanced/))
- [Database Lifecycle Hooks](https://awesome-repositories.com/f/data-databases/database-lifecycle-hooks.md) — Hook into model lifecycle events such as creation, updates, or deletions to execute custom logic before or after database operations. ([source](https://docs.vapor.codes/4.0/fluent/model/))
- [Database Schema Constraints](https://awesome-repositories.com/f/data-databases/database-schema-constraints.md) — Enforces data integrity through multi-field schema constraints. ([source](https://docs.vapor.codes/4.0/fluent/schema/))
- [Many-to-Many Associations](https://awesome-repositories.com/f/data-databases/many-to-many-associations.md) — Establish a many-to-many relationship between models using a pivot model that contains references to both related entities, enabling complex data associations. ([source](https://docs.vapor.codes/4.0/fluent/relations/))
- [Model Identifier Strategies](https://awesome-repositories.com/f/data-databases/model-identifier-strategies.md) — Configure a unique identifier for a model using property wrappers, supporting default UUIDs or custom types and generation strategies. ([source](https://docs.vapor.codes/4.0/fluent/model/))
- [Pagination](https://awesome-repositories.com/f/data-databases/pagination.md) — Provides automatic pagination for database queries with metadata support. ([source](https://docs.vapor.codes/4.0/fluent/query/))

### Programming Languages & Runtimes

- [Asynchronous Runtimes](https://awesome-repositories.com/f/programming-languages-runtimes/asynchronous-runtimes.md) — Manages event loops and concurrent task processing for high-performance, non-blocking applications.
- [Concurrency Patterns](https://awesome-repositories.com/f/programming-languages-runtimes/concurrency-patterns.md) — Implements modern asynchronous concurrency to simplify complex logic and improve maintainability. ([source](https://docs.vapor.codes/4.0/basics/async/))
- [Future Management](https://awesome-repositories.com/f/programming-languages-runtimes/future-management.md) — Manages asynchronous operations using non-blocking future types for result chaining. ([source](https://docs.vapor.codes/4.0/basics/async/))

### Security & Cryptography

- [Authentication Strategies](https://awesome-repositories.com/f/security-cryptography/authentication-strategies.md) — Implements secure user identity management, password hashing, and token-based authentication protocols.
- [Route Protection](https://awesome-repositories.com/f/security-cryptography/route-protection.md) — Guards routes by requiring authentication and enforcing access policies via middleware. ([source](https://docs.vapor.codes/4.0/security/authentication/))
- [Authentication Frameworks](https://awesome-repositories.com/f/security-cryptography/authentication-frameworks.md) — Implements robust identity verification using JWT and session-based authentication.
- [JWT Authentication](https://awesome-repositories.com/f/security-cryptography/jwt-authentication.md) — Authenticates requests by verifying signed JSON Web Tokens for secure communication. ([source](https://docs.vapor.codes/4.0/security/authentication/))
- [JWT Claim Validation](https://awesome-repositories.com/f/security-cryptography/jwt-claim-validation.md) — Verifies standard claims like expiration and issuer to ensure token integrity. ([source](https://docs.vapor.codes/4.0/security/jwt/))
- [Password Verification](https://awesome-repositories.com/f/security-cryptography/password-verification.md) — Hashes and verifies passwords using non-blocking methods to maintain application responsiveness. ([source](https://docs.vapor.codes/4.0/security/crypto/))
- [Bearer Token Authentication](https://awesome-repositories.com/f/security-cryptography/bearer-token-authentication.md) — Supports stateless API authentication using Bearer tokens. ([source](https://docs.vapor.codes/4.0/security/authentication/))
- [Cryptographic Primitives](https://awesome-repositories.com/f/security-cryptography/cryptographic-primitives.md) — Performs standard cryptographic operations including hashing and message authentication using native APIs. ([source](https://docs.vapor.codes/4.0/security/crypto/))
- [External Identity Provider Integration](https://awesome-repositories.com/f/security-cryptography/external-identity-provider-integration.md) — Verifies identity tokens from major providers like Apple, Google, and Microsoft. ([source](https://docs.vapor.codes/4.0/security/jwt/))
- [Session Management](https://awesome-repositories.com/f/security-cryptography/session-management.md) — Persists user authentication across requests using session identifiers stored in cookies. ([source](https://docs.vapor.codes/4.0/security/authentication/))
- [Basic Authentication](https://awesome-repositories.com/f/security-cryptography/basic-authentication.md) — Authenticates requests by verifying credentials against the standard Basic authorization header. ([source](https://docs.vapor.codes/4.0/security/authentication/))
- [CORS Policies](https://awesome-repositories.com/f/security-cryptography/cors-policies.md) — Configures and applies cross-origin resource sharing policies to allow secure resource requests from different domains. ([source](https://docs.vapor.codes/4.0/advanced/middleware/))
- [JWT Cryptographic Algorithms](https://awesome-repositories.com/f/security-cryptography/jwt-cryptographic-algorithms.md) — Supports multiple cryptographic algorithms including HMAC, RSA, and ECDSA for token security. ([source](https://docs.vapor.codes/4.0/security/jwt/))
- [Password Hashing Strategies](https://awesome-repositories.com/f/security-cryptography/password-hashing-strategies.md) — Configures secure password hashing strategies like Bcrypt for credential storage. ([source](https://docs.vapor.codes/4.0/security/passwords/))

### Software Engineering & Architecture

- [Dependency Injection Containers](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection-containers.md) — Manages the lifecycle and resolution of application services and database connections throughout the request pipeline.
- [Asynchronous Programming Patterns](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-programming-patterns.md) — Provides reference types for chaining and transforming asynchronous results without blocking execution threads.
- [Request Validation](https://awesome-repositories.com/f/software-engineering-architecture/request-validation.md) — Validates incoming request data with type-safe error reporting for all failures. ([source](https://docs.vapor.codes/4.0/basics/validation/))
- [Validation Schemas](https://awesome-repositories.com/f/software-engineering-architecture/validation-schemas.md) — Defines validation rules for request content and query parameters using type-safe protocols. ([source](https://docs.vapor.codes/4.0/basics/validation/))
- [Event Logging](https://awesome-repositories.com/f/software-engineering-architecture/event-logging.md) — Provides request-aware logging for tracking application events. ([source](https://docs.vapor.codes/4.0/basics/logging/))
- [Logging Frameworks](https://awesome-repositories.com/f/software-engineering-architecture/logging-frameworks.md) — Enables custom logging system initialization and handler registration during application startup. ([source](https://docs.vapor.codes/4.0/basics/logging/))
- [Application Lifecycle Management](https://awesome-repositories.com/f/software-engineering-architecture/application-lifecycle-management.md) — Provides hooks to execute custom logic during application boot and shutdown events. ([source](https://docs.vapor.codes/4.0/advanced/services/))
- [Validation Libraries](https://awesome-repositories.com/f/software-engineering-architecture/validation-libraries.md) — Provides a library of built-in validators for common data types like emails and URLs. ([source](https://docs.vapor.codes/4.0/basics/validation/))

### Testing & Quality Assurance

- [Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/testing-frameworks.md) — Supports modern testing frameworks for verifying routes and database interactions. ([source](https://docs.vapor.codes/4.0/advanced/testing/))

### Development Tools & Productivity

- [Environment Configuration](https://awesome-repositories.com/f/development-tools-productivity/environment-configuration.md) — Enables runtime switching between development, production, and testing environments. ([source](https://docs.vapor.codes/4.0/basics/environment/))
- [CLI Command Frameworks](https://awesome-repositories.com/f/development-tools-productivity/cli-command-frameworks.md) — Defines custom CLI commands with custom signatures, help text, and console interaction logic. ([source](https://docs.vapor.codes/4.0/advanced/commands/))
- [Configuration Management](https://awesome-repositories.com/f/development-tools-productivity/configuration-management.md) — Provides programmatic access to system environment variables for application configuration. ([source](https://docs.vapor.codes/4.0/basics/environment/))
- [Dotenv Loaders](https://awesome-repositories.com/f/development-tools-productivity/dotenv-loaders.md) — Automatically loads configuration variables from local files into the environment. ([source](https://docs.vapor.codes/4.0/basics/environment/))
- [Task Scheduling](https://awesome-repositories.com/f/development-tools-productivity/task-scheduling.md) — Enables scheduling of recurring tasks via dedicated worker processes. ([source](https://docs.vapor.codes/4.0/advanced/queues/))

### DevOps & Infrastructure

- [Background Job Queues](https://awesome-repositories.com/f/devops-infrastructure/background-job-queues.md) — Manages asynchronous task processing through registered drivers and worker processes. ([source](https://docs.vapor.codes/4.0/advanced/queues/))
- [Containerization](https://awesome-repositories.com/f/devops-infrastructure/containerization.md) — Provides containerization support for consistent multi-service deployment. ([source](https://docs.vapor.codes/4.0/deploy/docker/))
- [Background Job Processing](https://awesome-repositories.com/f/devops-infrastructure/background-job-processing.md) — Offloads time-consuming tasks to background workers to ensure responsive application performance.
- [Reverse Proxies](https://awesome-repositories.com/f/devops-infrastructure/reverse-proxies.md) — Configures reverse proxies for TLS termination and performance optimization. ([source](https://docs.vapor.codes/4.0/deploy/nginx/))
- [Systemd Services](https://awesome-repositories.com/f/devops-infrastructure/systemd-services.md) — Defines systemd service files for production process management. ([source](https://docs.vapor.codes/4.0/deploy/systemd/))
- [Deployment Tools](https://awesome-repositories.com/f/devops-infrastructure/deployment-tools.md) — Supports server startup via CLI with graceful shutdown handling. ([source](https://docs.vapor.codes/4.0/advanced/server/))
- [Edge Computing](https://awesome-repositories.com/f/devops-infrastructure/edge-computing.md) — Enables deployment to global edge computing platforms. ([source](https://docs.vapor.codes/4.0/deploy/fly/))
- [Process Management](https://awesome-repositories.com/f/devops-infrastructure/process-management.md) — Manages application processes with automatic restart and environment handling. ([source](https://docs.vapor.codes/4.0/deploy/supervisor/))

### Networking & Communication

- [WebSocket Servers](https://awesome-repositories.com/f/networking-communication/websocket-servers.md) — Enables low-latency, bidirectional data exchange between clients and servers.
- [WebSockets](https://awesome-repositories.com/f/networking-communication/websockets.md) — Supports bidirectional real-time data exchange over established WebSocket connections. ([source](https://docs.vapor.codes/4.0/advanced/websockets/))

### System Administration & Monitoring

- [Distributed Tracing](https://awesome-repositories.com/f/system-administration-monitoring/distributed-tracing.md) — Automatically generates annotated spans for incoming requests via middleware. ([source](https://docs.vapor.codes/4.0/advanced/tracing/))
