The chat application
The code on the pages of this section comes from the chat at sdk-v0.8.6.
The chat application is an example application on the SCION SDK. It has one server and three clients: a terminal client in Rust, an Android app and an iOS app. Every request between a client and the server is HTTP/3 over SCION.
The pages in this section explain the SDK topics that the chat shows. To build and run the chat, read the README of the chat.
One server, three clients
The parts in the figure:
- chat-server serves the API over HTTP/3 on SCION, built on
scion-stackandscion-h3-axum. - chat-dev starts a SCION network on your machine, built on
pocketscion, with the chat server in it. - Terminal client is the chat client for the terminal, built on
scion-http3. - Android app is the chat client for Android, built on
scion-http3-android. - iOS app is the chat client for iOS, built on
scion-http3-swift.
Where the SDK is
The SDK is in one file for each role. Each row links to the file and to the page that explains it.
| Role | File | Explained on |
|---|---|---|
| The server | chat-server/src/scion.rs | The server |
| A client, in Rust | transport/scion.rs | The client |
| A client, on Android | ScionTransport.kt | The Android client |
| A client, on iOS | ScionTransport.swift | The iOS client |
| A SCION network on your machine | topology.rs | From a local SCION network to a real network |
| All of the above, in one test | tests/scion.rs | Testing against PocketSCION |
One design for three clients
The three clients have the same structure. In each app, one module depends on the SDK, and one file imports the SDK: the transport. The transport has three parts:
- It builds the client.
- It sends a request.
- It maps the errors of the SDK to the errors of the app.
The rest of each app calls the transport through a Transport interface of its own. The SDK renews
the token for the transport. The client shows the three parts in Rust, and
The mobile clients shows them in Kotlin and Swift.
Where to go next
- The server: serve an Axum router over HTTP/3 on SCION.
- The client: the HTTP/3 client in Rust.
- The mobile clients: the Android and iOS clients.
- From a local SCION network to a real network: what changes when the chat moves from PocketSCION to a real SCION network.
- Testing against PocketSCION: a test with the server in one AS and the client in another.