+1

Serverless Chatbot App


A fully serverless application architecture deployed on AWS, designed to explore cloud-native infrastructure patterns: event-driven compute, managed auth, NoSQL persistence, and static hosting — all wired together without provisioning or managing a single server.

Architecture

Architecture diagram

Compute: AWS Lambda + API Gateway

All backend logic runs as stateless Lambda functions invoked through API Gateway. This eliminates server management, provides automatic scaling from zero to peak load, and follows a pay-per-invocation cost model — key characteristics of a production-grade serverless deployment.

Identity & Access: Amazon Cognito

User authentication and authorization are handled entirely by Cognito, offloading identity management to a managed service. This provides JWT-based access control without maintaining an auth server.

Persistence: DynamoDB

Chat rooms and conversation history are stored in DynamoDB, chosen for its serverless on-demand capacity model and low-latency access patterns. The schema is designed around access patterns (by user, by room) rather than normalized relations.

Static Hosting: Amazon S3

The React.js frontend is deployed as a static bundle to S3, served directly without a web server. Combined with the serverless backend, this achieves a fully managed, zero-infrastructure stack.

AI Integration: OpenAI API

Lambda functions call the OpenAI API to generate chatbot responses, demonstrating how serverless functions serve as lightweight integration glue between AWS services and third-party APIs.

Infrastructure Highlights

  • Auto-scaling compute: Lambda handles concurrent requests without pre-provisioning capacity
  • Managed auth: Cognito handles token issuance, refresh, and revocation
  • Serverless NoSQL: DynamoDB scales independently of compute
  • Cost model: Pay-per-use across all layers — no idle resource cost
  • Stateless design: All application state is externalized to DynamoDB and Cognito, making functions trivially replaceable

Finally

Thank you for reaching the end of this description. If you have any questions, or suggestions, or need help feel free to contact me.

Have a nice day ^_^