Local development on Windows, macOS and Linux¶
This guide follows the current repository topology. For normal end-to-end testing use one Control Plane, one or more Community Nodes, and at least two Android app instances.
1. Configure client discovery¶
Repository-root local.properties can provide the build-time signed directory used by common KMP code (debug and release builds respectively). Keep the normal Android SDK entry as well. The value is an HTTPS origin without a path; the app fetches /.well-known/sparrow-directory and /v1/control-planes itself. It is applied only on first start when no directory is configured yet.
CONTROL_PLANE_DIRECTORY_URL=https://<directory-host>
CONTROL_PLANE_RELEASE_DIRECTORY_URL=https://<release-directory-host>
The production discovery model is signed; do not model a new deployment as an unsigned hardcoded list of arbitrary nodes.
Firebase project of the app¶
There is no google-services.json: the app starts Firebase (phone sign-in only) with these three
values from local.properties. Take them from the Firebase console (Project settings → your Android
app com.cbgm.sparrow), or from an old google-services.json: client[0].client_info.mobilesdk_app_id,
client[0].api_key[0].current_key and project_info.project_id. Without them the app builds and runs,
but phone verification reports that it is not set up.
Phone verification in debug builds¶
Sign-up verifies the phone number once by SMS (Firebase). Debug builds show a Skip (debug)
button in the verification dialog. With DEBUG_SMS_CODE set, debug builds use the Firebase test
mode: add the number as a test phone number with this code in the Firebase console (Authentication
→ Sign-in method → Phone); the app check is skipped, the code is filled in automatically and also
shown as a "Sparrow (test SMS)" notification. Release builds ignore both. The resulting one-time
token is sent once to the Directory's phone verifier, and its attestation goes into the alias claims (see
Transport).
2. Build the Android client¶
Windows:
macOS/Linux:
Android Studio can run the androidApp target directly.
3. Preferred server path: unified installer¶
The active release/runtime tooling is server/installer. The installer window (Tk) is the same on
Windows, macOS and Linux and needs Python 3.9+ (most Linux desktops also need python3-tk).
Without a desktop, for example over SSH, the same options appear as a text menu.
Start the installer directly from source¶
From the repository, start server/installer/Start-SparrowServer.cmd (Windows),
Start-SparrowServer.command (macOS) or ./Start-SparrowServer.sh (Linux). In the source tree the
window first asks for a server folder (default ~/Sparrow Server), creates it with
build.py --install (using the published server images) and opens the installer there. The
server's data lives in that folder. When a Sparrow server is already running from another folder,
the installer offers to move it (data, identities and settings are kept).
Build a local unified bundle¶
From the repository root (Windows, macOS or Linux):
This builds:
Extract that ZIP into a dedicated runtime directory and start Start-SparrowServer.cmd,
Start-SparrowServer.command or Start-SparrowServer.sh there.
The installer can manage:
- Control Plane only;
- Community Node only (including multiple independent node instances);
- Combined Control Plane + Community Node.
The default fresh operator setup is Combined + LAN. Install / Start creates the normal generated runtime configuration, secrets, identities and named Docker volumes. On an existing intact runtime it validates ownership and updates selected backend images without intentionally rebuilding persistent identities/state.
Command line¶
Every action can also be run from the command line with Start-SparrowServer.sh (Linux/macOS). Use the CLI help for exact commands; install is the equivalent of Install / Start, while start is the no-pull lifecycle command. Node-only multi-instance management is available through the nodes command group.
4. Development directly from Compose¶
For source-level server work it is often faster to run the two production-shaped Compose projects directly.
Control Plane¶
docker compose -f server/control-plane/docker-compose.yml up -d --build
docker compose -f server/control-plane/docker-compose.yml ps
The default LAN edge is normally reachable at:
Phone numbers are bound only with an attestation of a Directory that runs phone verification (or as test phone numbers in PRESENCE_TEST_PHONE_ALIASES).
Community Node¶
A node must advertise addresses reachable by the app and other nodes. For a LAN source run, provide appropriate runtime endpoints and then:
docker compose -f server/community-node/docker-compose.yml up -d --build
docker compose -f server/community-node/docker-compose.yml ps
The default node edge is normally:
Do not advertise localhost to an Android device or another host. Use the machine's reachable LAN/public address.
For multiple nodes, use separate Compose project names, ports, identities and volumes, or use the unified node manager/smoke tooling. Two processes sharing one node identity are not two independent Community Nodes.
5. What each server component is for¶
flowchart LR
APP1[Android A] <--> N1[Community Node A]
APP2[Android B] <--> N2[Community Node B]
N1 --> CP[Control Plane]
N2 --> CP
CP --> REG[Node registry]
CP --> PRES[Presence]
N1 --> MB1[Mailbox]
N2 --> MB2[Mailbox]
The Control Plane handles discovery and presence (alias bindings, invitation routes). Community Nodes handle relays and circuits, encrypted mailbox envelopes and encrypted attachment blobs. Application messages are encrypted client-side before these transport layers.
6. Independent Control Plane Directory¶
server/control-plane-directory contains source for a separate operator-managed service. It is public in this repository, but not something every developer/node must install and not part of the public sparrow-server.zip.
Use it only when testing the signed multi-Control-Plane discovery/registration layer itself. Its source includes private installer/admin tooling and persistent signing state. Its own installer window (Start-SparrowDirectory.cmd / .command / .sh) creates a separate Directory folder via Build-SparrowDirectoryInstaller.py --install; it uses the Sparrow Server's proxy when one runs on the machine, otherwise its own proxy on ports 80/443. A public client should consume only its public signed endpoints, never its admin listener/token.
For ordinary local testing, a Combined unified installation can use its local Control Plane directly; a Node-only installation can be configured against an existing Control Plane. The signed independent directory is an optional advanced path.
7. Observe the system¶
Control Plane /index links to registry, presence and node information. Community Node /index links to gateway, Control Plane advertisement, federation and mailbox diagnostics.
Useful Docker commands:
docker compose -f server/control-plane/docker-compose.yml logs -f
docker compose -f server/community-node/docker-compose.yml logs -f
Android Developer Settings should show the verified discovery candidates/current node and transport state. Internal transport failures should go to diagnostics/error logging rather than replacing the user-facing online/offline status with raw TLS or routing exceptions.
8. Test important runtime cases¶
A useful local test matrix includes:
- two apps on one node;
- apps on two different Community Nodes (federation);
- recipient offline -> mailbox -> reconnect/fetch;
- Community Node loss -> client failover/reconnect;
- temporary Control Plane outage with cached verified discovery;
- invitation acceptance and Direct authorization;
- group invitation/welcome/activation;
- identity restore/reconnection and pending identity replacement review;
- encrypted attachment upload/download;
- local voice recording/playback/transcription;
- link preview server fetch + client DB cache.
For exact implementation flows, see Runtime flows, Identity recovery, Invitations, and Server runtime/build/deployment.