{"id":13995743,"url":"https://github.com/a2/passcards-swift","last_synced_at":"2025-08-01T11:32:40.645Z","repository":{"id":60569583,"uuid":"91326847","full_name":"a2/passcards-swift","owner":"a2","description":"A simple Apple Wallet server.","archived":false,"fork":false,"pushed_at":"2017-05-17T08:35:41.000Z","size":167,"stargazers_count":91,"open_issues_count":3,"forks_count":14,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-29T18:41:10.172Z","etag":null,"topics":["apple-wallet","passbook","passkit","swift","vapor","vapor-swift","wallet"],"latest_commit_sha":null,"homepage":"https://pass.a2.io","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-15T10:46:26.000Z","updated_at":"2024-06-21T20:54:19.000Z","dependencies_parsed_at":"2022-11-29T13:20:48.139Z","dependency_job_id":null,"html_url":"https://github.com/a2/passcards-swift","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2%2Fpasscards-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2%2Fpasscards-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2%2Fpasscards-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a2%2Fpasscards-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a2","download_url":"https://codeload.github.com/a2/passcards-swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228370977,"owners_count":17909389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-wallet","passbook","passkit","swift","vapor","vapor-swift","wallet"],"created_at":"2024-08-09T14:03:34.198Z","updated_at":"2024-12-05T21:11:04.321Z","avatar_url":"https://github.com/a2.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Passcards\n\nA simple [Wallet](https://developer.apple.com/wallet/) server that implements the [PassKit Web Service](https://developer.apple.com/library/content/documentation/PassKit/Reference/PassKit_WebService/WebService.html) requirements. (This is a Swift re-implementation of the original [Parse-backed version](https://github.com/a2/passcards-parse).)\n\n## Building\n\n```sh\n$ swift build -c release\n$ .build/release/App\n```\n\n## Required Environment\n\n| Key | Description |\n| --- | ----------- |\n| APNS_KEY_ID | APNS key ID |\n| APNS_PRIVATE_KEY | APNS private key content |\n| APNS_TEAM_ID | APNS team ID |\n| APNS_TOPIC | APNS (certificate) topic |\n| PG_DBNAME | Postgres database name |\n| PG_HOST | Postgres host |\n| PG_PASSWORD | Postgres password |\n| PG_PORT | Postgres port |\n| PG_USER | Postgres user |\n| S3_ACCESS_KEY | S3 access key |\n| S3_BUCKET | S3 bucket name |\n| S3_REGION | S3 bucket region |\n| S3_SECRET_KEY | S3 access secret key |\n| UPDATE_PASSWORD | Update password *(unset == unlimited access)* |\n\n## Deployment\n\n1. Create an app on Heroku\n\n    ```sh\n    $ heroku apps:create [NAME]\n    ```\n\n2. Set the environment variables (as described above)\n\n    ```sh\n    $ heroku config:set X=abc Y=def Z=ghi ...\n    ```\n\n    If you use the [Heroku PostgreSQL](https://devcenter.heroku.com/articles/heroku-postgresql) plugin, you will need to add the plugin (which sets the `DATABASE_URL` environment variable) and then set the required `PG_*` variables.\n\n3. Install the [Container Registry Plugin](https://devcenter.heroku.com/articles/container-registry-and-runtime)\n\n    ```sh\n    $ heroku plugins:install heroku-container-registry\n    ```\n\n4. Build and deploy Docker image to Heroku\n\n    ```sh\n    $ heroku container:push web\n    ```\n\n5. Open the website (a static single-page site)\n\n    ```sh\n    $ heroku open\n    ```\n\n## Usage\n\n### Creating a Pass\n\nThis is beyond the scope of the project, but recommended reading includes:\n\n- Wallet Developer Guide: [Building Your First Pass](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/PassKit_PG/YourFirst.html#//apple_ref/doc/uid/TP40012195-CH2-SW1), [Pass Design and Creation](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/PassKit_PG/Creating.html#//apple_ref/doc/uid/TP40012195-CH4-SW1)\n- [PassKit Package Format Reference](https://developer.apple.com/library/content/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/Introduction.html)\n\nYou will want to set _https://my-heroku-app.herokuapp.com/_ as the `webServiceURL` root key in your _pass.json_.\n\nExample passes, as well as the source of a command-line tool for signing Pass bundles (_signpass_), can be found [here](https://developer.apple.com/services-account/download?path=/iOS/Wallet_Support_Materials/WalletCompanionFiles.zip).\n\n### Uploading a Pass\n\n```sh\n$ curl -X POST \\\n    -H \"Authorization: Bearer MY_UPDATE_PASSWORD\" \\\n    -F \"pass=@a_local_file.pkpass\" \\\n    -F \"authentication_token=AUTHENTICATION_TOKEN\" \\\n    -F \"pass_type_identifier=PASS_TYPE_IDENTIFIER\" \\\n    -F \"serial_number=SERIAL_NUMBER\" \\\n    https://my-heroku-app.herokuapp.com/VANITY_URL.pkpass\n```\n\nIn the above cURL command, _a_local_file.pkpass_ is a file in the current working directory. Set the `authentication_token`, `pass_type_identifier`, and `serial_number` fields to their corresponding values from the pass's _pass.json_. _MY_UPDATE_PASSWORD_ is the `UPDATE_PASSWORD` environment variable set in your app.\n\n### Updating a Pass\n\n```sh\n$ curl -X PUT \\\n    -H \"Authorization: Bearer MY_UPDATE_PASSWORD\" \\\n    -F \"pass=@a_local_file.pkpass\" \\\n    https://my-heroku-app.herokuapp.com/VANITY_URL.pkpass\n```\n\n_a_local_file.pkpass_ is the new local file to replace on the server. _MY_UPDATE_PASSWORD_ is the same `UPDATE_PASSWORD` as above.\n\n### Sharing a Pass\n\nA Pass recipient can go to *https://my-heroku-app.herokuapp.com/VANITY_URL.pkpass* to receive your pass.\n\n## Author\n\nAlexsander Akers, me@a2.io\n\n### My Personal Set-up\n\nOn my personal website (*https://pass.a2.io*), I use [CloudFlare](https://www.cloudflare.com) to secure the website subdomain that points to Heroku because then I get TLS / HTTPS (which is required for PassKit in production) for free, because I'm cheap. To that extent, I also use Heroku's free PostgreSQL plan and the [free dyno hours](https://devcenter.heroku.com/articles/free-dyno-hours).\n\nA sleeping-when-idle Heroku app is *perfect* for Wallet services because an iOS device will call your service endpoints in the background and retry upon timeout.\n\nYour app service service is only woken...\n\n1. when someone adds a pass (triggering a pass registration).\n2. when someone deletes a pass (triggering pass de-registration).\n3. when someone triggers a manual refresh of a pass.\n4. when someone toggles \"Automatic Updates\" on the backside of a pass (shown with the ⓘ button).\n\n## License\n\nPasscards is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa2%2Fpasscards-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa2%2Fpasscards-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa2%2Fpasscards-swift/lists"}