Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slashmo/swift-fruitstore-example
Server-Side Swift example application
https://github.com/slashmo/swift-fruitstore-example
async-await logging metrics microservices server-side-swift swift-nio tracing
Last synced: about 2 months ago
JSON representation
Server-Side Swift example application
- Host: GitHub
- URL: https://github.com/slashmo/swift-fruitstore-example
- Owner: slashmo
- Created: 2021-04-19T13:39:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-19T18:15:43.000Z (almost 4 years ago)
- Last Synced: 2024-12-08T19:49:22.507Z (about 2 months ago)
- Topics: async-await, logging, metrics, microservices, server-side-swift, swift-nio, tracing
- Language: Swift
- Homepage:
- Size: 17.6 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Server-Side Swift Example: FruitStore
This repo contains an example that showcases various aspects of the Server-Side Swift ecosystem.
It's a microservices-oriented set of APIs, instrumented using [Logging](https://github.com/apple/swift-log),
[Metrics](https://github.com/apple/swift-metrics),
and [Distributed Tracing](https://github.com/apple/swift-distributed-tracing).## Running locally
Each service is contained in its own Swift package, located under `/services/`.
### Docker 🐳
Traces are exported to an OpenTelemetry Collector running in a Docker container, and visualized via Jaeger.
Both of these containers may be started through [`docker-compose.yaml`](docker-compose.yaml):```bash
docker-compose up -d
```### ⚠️ Latest Swift Toolchain
This example makes use of yet to be release Swift features such as async/await and task locals.
Therefore you'll need to have the latest development snapshot of Swift installed on a Mac.You also need to specify the `DYLD_LIBRARY_PATH` to be able to run the executables:
```bash
export DYLD_LIBRARY_PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/lib/swift/macosx
```To run the `Storage` service, build and execute `storagectl`:
```bash
cd services/storage
swift build && ./.build/debug/storagectl serve --log-level trace
```