Project1

TTSR — Travel Trust & Safety Risk Scorer (v1)

Privacy-first travel risk-scoring API that produces a deterministic 0–100 risk score and action (allow/review/hold) from non-PII signals. Built to demonstrate platform/API product thinking: OAuth2 Client Credentials, idempotency keys, HMAC-signed webhooks with retries, audit logging, SLOs + dashboards, and IaC + CI.

Live docs / Pages: https://benkola.github.io/Project1/
Repo: https://github.com/Benkola/Project1
Demo (≤3 min): (add Loom link)


What this demonstrates (CV-ready)


Architecture (AWS-first)

API Gateway (REST) → Lambda (Python) → DynamoDB (events, webhook_outbox) → CloudWatch + X-Ray (logs/metrics/traces) → (Optional) EventBridge schedule for webhook retries → S3 (artefacts/screenshots)

Diagram: docs/architecture.png (add a diagram screenshot)


API surface (v1)

OpenAPI: api/openapi.yaml
Postman collection: postman/TTSR.postman_collection.json


Privacy-first contract (important)


Scoring model (v0 rules)

Signals (examples):

Output:


Idempotency (exactly-once semantics)

POST /v1/score requires:

Behaviour:

Implementation notes:


Webhooks (HMAC signing + retry)

Outgoing webhook headers:

Reliability:

Code:


SLOs & Observability

SLO targets (demo):

Dashboards/alerts:

Runbook:


Quickstart (golden flow)

1) Get token (OAuth2 stub)

```bash export TOKEN=$(curl -s -X POST “$TOKEN_URL”
-H “Content-Type: application/x-www-form-urlencoded”
-d “grant_type=client_credentials&client_id=demo-app&client_secret=demo-secret&scope=score:write%20events:read%20webhooks:write”
| jq -r .access_token)