AWS backend handoff

Backend-ready architecture for live chatrooms.

This page gives developers the intended AWS integration points for authentication, real-time chat, storage, moderation, and medical-safe access control.

Authentication

AWS Cognito handles sign-in. DiagnosisChat should not have a separate registration flow; it should accept Anonamed-linked members.

Cognito User Pool → Anonamed member identity → JWT → AppSync auth

Real-time chat

AWS AppSync GraphQL subscriptions for room/thread updates and live replies.

mutation createMessage → subscription onMessageCreated(roomId/threadId)

Data storage

DynamoDB for rooms, threads, messages, users, moderation events, and reports.

RoomsTable · ThreadsTable · MessagesTable · ModerationTable · ReportsTable

Uploads

S3 private bucket with signed upload URLs. No public medical files.

POST /upload-url → signed S3 URL → attachmentId saved on thread

Moderation

Lambda moderation pipeline scores every post before publish.

onCreatePost → AI scoring → publish / warn / hold / hide / block

Protection

AWS WAF + rate limits to slow bots and commercial abuse.

WAF rules · API throttling · account trust score · report queue

Suggested GraphQL types

type Room { id, slug, name, specialty, description, threadCount } type Thread { id, roomId, title, createdBy, status, moderationScore, emergencyFlag, createdAt, updatedAt } type Message { id, threadId, authorId, body, role, clinicianVerified, moderationFlags, createdAt } type UserProfile { id, anonamedMemberId, role, trustScore, clinicianBadge, country } type ModerationEvent { id, targetType, targetId, score, flags, action, reviewerId, createdAt }