Skip to main content

Architecture

CareToSher is an iOS app backed by a small serverless API on AWS. Everything (the app, the API, the infrastructure and these docs) lives in one repository (ADR 0002).

  • The iOS app is the only client. It signs in with Cognito and calls the API with the caregiver's ID token.
  • API Gateway checks the token, then passes every request to one API Lambda written in Go.
  • The generator Lambda runs once a day and writes the upcoming scheduled entries and on-duty stretches, so the API only has to read them.
  • DynamoDB holds everything, one table per kind of record.
  • AppConfig serves feature flags. SNS carries feedback emails and alarm emails. CloudWatch holds the logs and the alarms.
  • caretosher.com is a static site (privacy, terms, support) on S3 and CloudFront.

There are two copies of everything in AWS: dev (each push to an open pull request deploys to it) and prod (each merge to main deploys to it). See Infrastructure.

The repository​

FolderWhat it isPage
api/The Go HTTP API and its acceptance scenariosAPI
ios/The SwiftUI appiOS app
services/generator/The daily generator LambdaGenerator
shared/openapi/The API contract, the source of truth for the API's shapeContract and codegen
shared/types-go/, types-ts/, types-swift/Clients generated from the contractContract and codegen
shared/go-common/Go code the API and generator share: entities, DynamoDB stores, config, logging, flagsAPI
infra/AWS CDK in TypeScript: every AWS resourceInfrastructure
web/site/The static caretosher.com pagesWebsite
docs/This site, and the product spec (PRD.md) until it moves here
scripts/Checks for the screen catalog and these docs