with one click
vapor
// Expert guidance for Vapor 4+ development, focusing on async/await, Fluent, and content negotiation.
// Expert guidance for Vapor 4+ development, focusing on async/await, Fluent, and content negotiation.
Patterns for Playwright E2E testing with custom fixtures, role-based selectors, and assertion patterns.
Build, archive, export, and upload the try! Swift Tokyo app to App Store Connect for iOS, macOS, and visionOS using ASC CLI.
Guidelines for building static sites using the Ignite Swift framework.
Guidelines for Android development using the Skip framework (Swift to Kotlin transpilation).
Expert guidance on The Composable Architecture (TCA) for Swift, focusing on ReducerProtocol, macros, and testability.
Definitive guide for Swift 6+ Concurrency, strictly enforcing Sendable, Actors, and Structured Concurrency.
| name | vapor |
| description | Expert guidance for Vapor 4+ development, focusing on async/await, Fluent, and content negotiation. |
async/await) over EventLoopFuture.@Sendable.RouteCollection conformances.routes.swift; delegate immediately to a Controller.UsersController, AuthController).app.register(collection: MyController()).app.grouped("api", "v1").AsyncMiddleware for custom middleware:struct AuthMiddleware: AsyncMiddleware {
func respond(to request: Request, chainingTo next: AsyncResponder) async throws -> Response {
let payload = try await request.jwt.verify(as: UserJWTPayload.self)
request.auth.login(payload)
return try await next.respond(to: request)
}
}
routes.grouped(AuthMiddleware()).@Parent and @Children property wrappers correctly.Content for API requests/responses. NEVER return a Fluent Model directly to the client.app.migrations.add(...).$ syntax: .filter(\.$deviceID == id).Direct SQL Access (for complex queries not expressible via Fluent):
guard let sql = req.db as? any SQLDatabase else {
throw Abort(.internalServerError)
}
let rows = try await sql.raw("SELECT ... FROM \(raw: Model.schema)").all(decoding: SomeRow.self)
Environment.get("KEY") for configuration.Production vs Development modes explicitly in configure.swift.struct UsersController: RouteCollection {
func boot(routes: RoutesBuilder) throws {
let users = routes.grouped("users")
users.get(use: index)
}
@Sendable
func index(req: Request) async throws -> [UserDTO] {
let users = try await User.query(on: req.db).all()
return users.map { $0.toDTO() }
}
}