An example Arcade game backend using Perfect
Switch branches/tags
Nothing to show
Clone or download
Failed to load latest commit information.
Sources big update to bring into line with latest package versions Apr 12, 2017
.gitignore Initial commit Oct 14, 2016
Dockerfile Initial commit Oct 14, 2016
LICENSE Initial commit Oct 14, 2016
Package.swift Upgrading to Swift 4.1 Apr 30, 2018 header Oct 19, 2016

Arcade API Example

Get Involed with Perfect!

Star Perfect On Github Stack Overflow Follow Perfect on Twitter Join the Perfect Slack

Swift 3.0 Platforms OS X | Linux License Apache PerfectlySoft Twitter Slack Status

Arcade API backend example

Using Perfect, this example demonstrates JSON API interactions with GET and POST methods, storing and retrieving data via the SQLite3 version of StORM (a Swift ORM). HTTP Requests are logged using Perfect-RequestLogger by David Fleming.

###Compatibility with Swift

This project works only with the Swift 3.0 toolchain available with Xcode 8.0+ or on Linux via

Swift version note:

Due to a late-breaking bug in Xcode 8, if you wish to run directly within Xcode, we recommend installing swiftenv and installing the Swift 3.0.1 preview toolchain.

# after installing swiftenv from
swiftenv install

Alternatively, add to the "Library Search Paths" in "Project Settings" $(PROJECT_DIR), recursive.

Building & Running

The following will clone and build an empty starter project and launch the server on port 8181.

git clone
cd PerfectArcade
swift build

If you see a build error concerning OpenSSL, please see the swift version or Library Search Paths recommendations above.

You should see the following output:

Starting HTTP server on with document root ./webroot

This means the server is running and waiting for connections.

Building the Xcode Project

To build the Xcode project, run the following in Terminal with the working directory being PerfectArcade as above.

swift package generate-xcodeproj

The output:

generated: ./PerfectArcade.xcodeproj

Available Routes

POST http://localhost:8181/api/v1/save
	user, ideally 3 letters, i.e. AAA
	score, an integer.

The save method returns a status of the action.

GET http://localhost:8181/api/v1/highscores

The highscores method returns the top 10 high scores, and the associated user.


If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to and raise it.

A comprehensive list of open issues can be found at

Further Information

For more information on the Perfect project, please visit