Perfect README

The project's README from github.com/PerfectlySoft/Perfect. As one markdown file: README.md.

Perfect: Server-Side Swift

Swift 6.2+ Platforms macOS 12+ | Linux License Apache 2.0

Perfect is a set of focused Swift packages for building servers and talking to the services behind them: an HTTP(S) server, database drivers, sessions and sign-in, email, push notifications, FileMaker, payments and everyday utilities. Every package is written for Swift 6 and strict concurrency, runs on macOS and Linux, keeps its dependencies to a minimum, and is released and tested on its own.

This repository used to hold PerfectLib, the original all-in-one Perfect framework (Swift 3 to 5). PerfectLib is no longer maintained. Its code is preserved on the legacy branch, and its tags (the last is 4.0.1) still resolve. This repository is now the map to the Perfect packages.

Start here

.package(url: "https://github.com/PerfectlySoft/Perfect-NIO.git", from: "0.2.0"),

Packages

Server and web

Package What it does
Perfect-NIO HTTP(S) server on SwiftNIO: typed routes, async handlers, WebSockets, multi-domain TLS, optional admin console
Perfect-Session Sessions with MySQL, PostgreSQL, SQLite, Redis, MongoDB or in-memory storage, plus CSRF, CORS and cookie helpers
Perfect-Authentication OAuth 2.0 sign-in with PKCE for Google, GitHub, Facebook, Slack, LinkedIn and Salesforce
Perfect-SMTP SMTP client on SwiftNIO: relay or direct-to-MX delivery, DKIM signing, MTA-STS
Perfect-Notifications Apple Push Notification service (APNs) provider client over HTTP/2

Databases

Package What it does
Perfect-CRUD Codable object-relational mapping: create tables, insert, update, select and join with type-safe queries
Perfect-MySQL MySQL client and Perfect-CRUD driver
Perfect-MariaDB MariaDB client and Perfect-CRUD driver
Perfect-PostgreSQL PostgreSQL client (libpq) and Perfect-CRUD driver
Perfect-SQLite SQLite client and Perfect-CRUD driver
Perfect-MongoDB MongoDB client: connection pools, collections, cursors, BSON and GridFS
Perfect-Redis Async Redis client

FileMaker

Package What it does
Perfect-FileMaker Client for FileMaker Server's XML Custom Web Publishing interface
Perfect-FileMaker-DataAPI Client for the FileMaker Data API (REST/JSON)
Perfect-FileMaker-AdminAPI Client for the FileMaker Server Admin API, with a janitor that clears stale web-publishing sessions

Payments

Package What it does
Perfect-AuthNet Authorize.net client: charge, authorize, capture, refund and void, including Accept.js nonces

Utilities

Package What it does
Perfect-Logger File and remote log handlers for swift-log
Perfect-XML XML and HTML parsing with XPath, on libxml2
Perfect-Zip Create and safely extract zip archives
Perfect-INIParser INI configuration file parser

Each package's README lists its requirements, its current release and how to add it to Package.swift. All of them need Swift 6.2 or later and run on macOS 12 or later and Linux. Perfect-CRUD, Perfect-SQLite, Perfect-Redis, Perfect-FileMaker and Perfect-XML also support iOS.

Coming from PerfectLib

The packages that PerfectLib and its companions provided have been replaced like this:

Before Now
Perfect-HTTP, Perfect-HTTPServer, Perfect-Net, Perfect-FastCGI Perfect-NIO
Perfect-WebSockets WebSocket routes in Perfect-NIO
Perfect-Session-MySQL, -PostgreSQL, -SQLite, -Redis Perfect-Session
Perfect-OAuth2, Perfect-Turnstile-*, Perfect-LocalAuthentication-* Perfect-Authentication with Perfect-Session
Perfect-CURL Foundation's URLSession
Perfect-Crypto swift-crypto
Perfect-Thread Swift concurrency (async/await, tasks and actors)
PerfectLib's File and Dir Foundation's FileManager and FileHandle
PerfectLib's JSONConvertible Codable with JSONEncoder and JSONDecoder
PerfectLib's SysProcess Foundation's Process
PerfectLib's Log Perfect-Logger on swift-log

The old repositories are archived: they stay readable and their tags still resolve, but they don't get updates. Every package that existed before Swift 6 keeps its old code on a legacy branch, and its README has a migration section.

Some older packages are still being reviewed before they're brought up to date, including Perfect-Mustache, Perfect-Markdown and Perfect-LDAP. Until then they stay as they are.

Contributing

Issues and pull requests are welcome on each package's own repository. Please follow the Code of Conduct.

License

Apache 2.0. See LICENSE.

Perfect (PerfectlySoft/Perfect)

Searching Database…

What is this?Perfect is a complete toolbox, framework, and application server for server-side Swift: Swift developers use it to build websites, REST services, and mobile back ends entirely in Swift.
So is it a framework, a library, or a whole server?All three at once. This repo holds the core PerfectLib, and separate modules add an HTTP 1.1 server, database connectors, WebSockets, Mustache templating, and more — you assemble the pieces your service needs.
How do I start my first project with it?Clone the Perfect Template starter project and compile it with the Swift Package Manager — it builds into a standalone executable HTTP server. A beginner tutorial and a full API reference are published alongside.
What do I need installed before I can build anything?Only Swift itself: the master branch compiles with Xcode 11 or the Swift 5 toolchain on Ubuntu, so a Mac with Xcode or an Ubuntu box with Swift 5 is enough.
Is this still actively maintained?No. The repo is now labeled Legacy Perfect, so treat it as a mature but frozen project: fine for learning or existing services, but verify compatibility before starting something new on it.
Do I have to be a Swift developer to use it?Yes — Perfect is written for Swift engineers who want one language on both the client and server side, though the guide targets all experience levels.
Where can I deploy the finished service?To any Swift-compatible Linux server. There is also Perfect Assistant, a macOS desktop app that helps with AWS and Google Cloud deployments.
Which databases can it connect to out of the box?Official connectors ship for Redis, SQLite, PostgreSQL, MySQL, MongoDB, and FileMaker Server, plus a FastCGI module for Apache 2.4 if you host through Apache instead of the built-in server.
Why write a web server in Swift?The pitch is one language everywhere: iOS and macOS developers can build their apps and their server-side REST services with the same toolset, which the README says boosts productivity.
Is the networking stack asynchronous?Yes. Perfect runs on a completely asynchronous, high-performance networking engine aimed at scalable internet services, and you can swap in your favourite JSON or templating systems instead of the built-ins.
What sample projects can I learn from?Community examples include a WebSockets server, URL routing, and an upload enumerator, with more in the Perfect Examples repository and a starter tutorial for the first steps.
What are similar projects?drogon, aiohttp, vapor, chat, sails, gin-vue-admin, echo, actix-web
Size
5.3 MB
Stars
13.7K
Age
11y
Commits · 90 Days