TAS Portal
Snoraire · as built on the team’s main code, 22 October · status updated 29 October 2026

How Snoraire runs, and how a change reaches users.

In short

  • The phone does the heavy lifting. Recording and analysing a night happen on the phone, even offline. The server signs people in and keeps their results.
  • One small server, in Singapore, owned by Easmed. The Snoraire service runs on AWS Lambda, which switches on only when the app calls it. Compare projected costs for 100, 1,000 and 10,000 monthly active users.
  • Every change is checked automatically. Before code is merged it is formatted, checked, tested, built, scanned for leaked passwords and for known security weaknesses, and its database changes are rehearsed.
  • Releases are repeatable and reversible. The same pipeline deploys the server and builds the app. If a new server version fails its check, it rolls back automatically.
  • Test and live are separate. Staging and production have their own server, database, passwords and app builds.

The system at a glance

Snoraire system architecture Snoraire appiPhone and AndroidBuilt with ExpoRecords and analyses AWS · Singapore (ap-southeast-1) · Easmed account Snoraire service · AWS LambdaSign-in, email login codes, results, research uploadsReached through a Lambda Function URL (HTTPS)Container image on Arm processors Secrets ManagerPasswords and keys ECRStored server versions CloudWatchLogs and error alarm EventBridge + SQSRoutes alarms; keeps failures Relay service · AWS LambdaTurns alarms and deploy events into team messages S3 + IAMInfrastructure records; least-privilege access roles Neon · Postgres databaseAccounts, consent, results Cloudflare R2 · file storageResearch audio (with consent only) Resend · emailLogin codes PostHogCrashes and app usage TelegramOps, business and support alerts Zoho CRM (planned)Care-team callback requests HTTPS usage events
The app talks to one Snoraire service on AWS. That service uses AWS for passwords, stored versions, logs and alarms, and outside services for the database, file storage and email. Alarms reach the team on Telegram through the relay service. Dashed box: planned.

Each part and the AWS service behind it

PartAWS serviceWhat it does
Snoraire serviceAWS Lambda (container, Arm) with a Function URLThe app’s server: sign-in and email login codes, saving and restoring results, and research uploads. It runs only when called, so idle time costs almost nothing. Sign-in used to be a separate service and was merged into this one.
Relay serviceAWS Lambda (container, Arm)Receives alarms and deployment events and posts them to the team’s Telegram channels.
Server versionsAmazon ECRStores each built server version. The last 5 are kept so a bad release can be rolled back.
Passwords and keysAWS Secrets ManagerHolds the database password, email key, storage keys and sign-in secret, separately for staging and production.
Logs and alarmsAmazon CloudWatchKeeps server logs and raises an alarm when errors spike.
Alert routingAmazon EventBridge + SQSSends alarms to the relay service. A holding queue (dead-letter queue) keeps any alert that fails to send.
Infrastructure recordsAmazon S3Stores the encrypted record of what has been set up in each environment, with locking so two changes can’t clash.
Access controlAWS IAM with GitHub sign-in (OIDC)The pipeline gets short-lived, narrowly limited access for each job. No permanent AWS keys are stored in GitHub.

From code change to users: the CI/CD pipeline

CI (continuous integration) checks every change automatically. CD (continuous delivery) deploys a checked change in the same way every time.

Snoraire CI/CD pipeline 1 · Propose a change Pull requestProposed code changeon GitHub 2 · Automatic checks (GitHub Actions) Develop CI • Format, lint, type check, build • Automated tests (on Mac for audio) • Leaked-password scan • High-severity security weakness check • Database change rehearsal + drift check • Block risky database deletes unless approved Infrastructure plan • Shows AWS changes as a PR comment Runs on in-house build machines (Linux + Mac) App previews (Expo) • EAS Update: a preview of the change testers can open on their phone Native smoke tests • App launched and signed in on an Android emulator and an iPhone simulator Device smoke (manual) • Installs the latest test build on a real Android phone in the office 3 · Merge, then release:staging automatically, production on request Server release 1. Check environment settings and security 2. Apply database changes (Neon) 3. Build server image → ECR 4. Boot check, then update Lambda 5. Live check: health, sign-in, sign-out 6. Failed check → automatic rollback to the previous version Relay service released the same way Team notified on Telegram App release (Expo EAS) 1. EAS Workflow starts from the exact same code version as the server 2. EAS Build: iPhone + Android apps 3. Pipeline confirms both builds match that code version and environment 4. EAS Submit to the stores’ test tracks Runs on request, only after the server release passed. Staging submits itself; production is submitted by a person Apple TestFlight Invited iPhone testers install the app Next: App Store review and public release Google Play internal testing Invited Android testers install the app Next: Play review and public release
A change is checked automatically, merged, then released to the server and to the app stores’ test tracks from the same code version. Staging server releases run on merge; production and app builds run on request.
PipelineWhen it runsWhat it does
Develop CIEvery pull request and merge, plus a daily runAll the automatic checks in step 2. A change cannot merge until they pass.
Snoraire mobileEvery pull requestPublishes a preview of the app change with EAS Update and runs the native smoke tests.
InfrastructurePull requests that change AWS setup; apply by handShows the planned AWS changes, then applies them only after someone confirms.
Staging CDMerge to the main code; production on requestThe full release in step 3: database changes, server deploy with rollback and relay deploy. App builds for the stores run when requested, only after the server release passes.
Device smokeOn requestInstalls and starts the latest test build on a real Android phone.
Release notesAfter checks pass on the release branchCreates version numbers and change notes automatically (release-please).

Three versions of the app: staging, research and production

The same code produces three separate versions of the app. Each has its own name on the phone, its own update channel and its own store listing, so research code can never reach ordinary users by accident.

StagingResearchProduction
PurposeTesting the next releaseCollecting overnight audio, with consent, to improve the snore analysisThe real app for beta testers and, later, the public
Who gets itThe team and testersInternal research participants only; never sold in a storeBeta testers, then everyone
Server it talks toStagingStagingProduction
Uploads sound recordings?NoYes, to the research audio storeNo
How it is installedTestFlight and Google Play internal testingDirect install on registered test phonesTestFlight and Google Play internal now; App Store and Google Play at launch
Latest buildVersion 0.1.8 and newer17 October (iPhone and Android, version 0.1.8)Android 4 and 6, iPhone 8 (19–20 October)
StatusRunningPartly set up Builds work. The store-testing version (TestFlight and Play) is set up in code but its Apple app record has not been created yet, and no automated release pipeline exists for it.Running

The September cloud design proposed a different route: one ordinary app with research switched on per person after consent. The team later chose a separate research app instead, which keeps audio collection out of the ordinary app entirely.

Environments

EnvironmentWho uses itServerApp builds
DevelopmentEngineersA developer’s own computerDevelopment builds on engineers’ phones
PreviewReviewers of a changeStagingEAS Update preview per pull request
ResearchInternal research participantsStaging server; audio to the research storeSeparate research app, installed directly on test phones
Staging (test)The team and testersAWS Lambda, staging database and storageTestFlight and Play internal testing
Production (live)Beta testers, then the publicAWS Lambda, production database and storageTestFlight and Play internal now; App Store and Google Play at launch

Outside services

ServiceUsed forNotes
Expo (EAS)Building the iPhone and Android apps (Build), sending them to the stores (Submit), app previews (Update) and running the app release steps (Workflows)Builds come straight from the shared code, not a laptop.
Apple App Store Connect / TestFlightiPhone test distribution, then App Store releaseStore listing is at “Prepare for Submission”.
Google Play ConsoleAndroid internal testing, then Play releaseInternal testing submission succeeded on 20 October.
GitHub and GitHub ActionsCode, reviews and all automated pipelinesJobs run on in-house build machines; outside contributions use GitHub’s own machines.
NeonThe Postgres databaseSeparate staging and production databases. Where it physically stores data is still to confirm.
Cloudflare R2File storage for consented research audioSeparate staging and production storage. Data location still to confirm.
ResendSending email login codesLogin email received in production on 19 October.
PostHogCrash and usage tracking from the appProduction settings saved; real-phone events still to confirm.
TelegramTeam alerts: operations, business and supportDelivery of live alerts still to confirm.
Zoho CRMCare-team callback requestsPlanned Singapore access in place; Malaysia access pending.

What is running today

AreaStatusStill to do
Automatic checksRunning On every change since mid-October.—
Staging serverRunning Sign-in, sign-out and recovery from a failed update checked on 13 October.Confirm the newest version is deployed; test on real phones.
Production serverRunning since 19 October. Health checks, sign-in, sign-out, file storage and login email passed.Test rolling back to an older version; confirm usage events from a real phone.
App store buildsDone Android builds 4 and 6 and iPhone build 8 (19–20 October). Android in Play internal testing; iPhone in TestFlight.Store listings, screenshots and review before public release.
Saving and restoring resultsDesigned V1 has accounts with email login codes (decided 26 October).Build the results database and routes; test saving, restoring and deleting on real phones.
Research audio uploadsDesigned Not switched on.Consent checks and an off switch before any audio is collected.
App updates without a store releasePreviews only Used for pull request previews.Decide whether to use them for live users.

Safety and reliability

  • All traffic and stored data are encrypted. Passwords and keys live in AWS Secrets Manager, separately for staging and production.
  • The pipeline signs in to AWS with short-lived access for each job; nothing permanent is stored in GitHub.
  • Logs never contain sound recordings, health results, login tokens or consent details.
  • A failed server release rolls back automatically. Database backups are proven by restoring them.
  • Speed target: everyday actions under 2 seconds; the first request after a quiet spell under 5 seconds.

Still to decide with Easmed

  • How long results and audio are kept, and how deleting an account works.
  • Who is on call for the live system, with a backup.
  • Where Neon and Cloudflare physically store data. Choosing Singapore for AWS does not decide this.
  • The expected peak number of users, and a monthly cost limit.

Snoraire running costs

Current Easmed AWS spending comes from the daily billing snapshot. The six-month forecast models 100, 1,000 and 10,000 monthly users. Peak load, recovery and support still need validation before we set a budget.

Sources

Built from the team’s main code as of 22 October 2026 (pipeline files, AWS setup and Expo configuration), the Airese AWS API and cloud sync spec (17 September, updated 26 October), and the deployment records of 13, 19 and 20 October. Account numbers, web addresses, app IDs and other internal identifiers are left out on purpose. The 18 November 2026 v4 workbook extends the AWS, Neon and Base44 model with peak-load costs and a service guide.