Skip to main content

AWS architecture

The API runs in AWS Lambda behind API Gateway HTTP API. DynamoDB stores user accounts, reviews, audit records, quota counters, and admin settings. AWS SES sends verification, password-reset, and support messages.

Runtime components​

  • Lambda handler: apps/api/src/lambda.ts.
  • Infrastructure: apps/api/template.yaml.
  • Local development: .local-dynamodb.json fallback.
  • AUTH_JWT_SECRET: HMAC session signing secret; keep stable and secret.
  • ADMIN_USERNAME, ADMIN_PASSWORD: admin credentials sourced from repository deployment secrets.
  • GEMINI_API_KEY: server-side contract analysis key.

DynamoDB tables​

  • clauseshield-users — primary key id; the previous identity-provider index is no longer used. Existing user records remain stored; only first-party accounts created with password credentials are active for sign-in.
  • clauseshield-audits — primary key id, userId-index for saved account reviews.
  • clauseshield-reviews — primary key id.
  • clauseshield-settings — primary key id, quota counters and platform settings.

The current auth service does not read any third-party identity field. Existing user rows are preserved; previously authenticated users need to create and verify a password account before using first-party account features.

Email and quota controls​

SES requires a verified sender and production SES access for public recipients. Quotas are adjustable in the admin panel; conditional DynamoDB transactions increment daily and weekly totals atomically.