Brahim Elhoube

DevOps & SRE

Serverless Chatbot App

A serverless AWS chatbot architecture designed around managed identity, event-driven compute, NoSQL persistence, static hosting, and AI integration.

Open project

Abstract

This project explores a fully serverless chatbot architecture deployed on AWS. The application combines static hosting, managed authentication, event-driven backend functions, NoSQL persistence, and OpenAI API integration without provisioning or maintaining application servers. The objective was to evaluate how managed cloud services can reduce operational overhead while preserving scalability and secure multi-user access.

Problem

Traditional web applications often require long-running servers, manual capacity planning, and separately maintained authentication infrastructure. For a chatbot workload with variable usage patterns, this can create idle cost and unnecessary operational complexity.

Architecture

Architecture diagram

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, which are 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.

Method

  • 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 from compute
  • Cost model: Pay-per-use across all layers with no idle resource cost
  • Stateless design: All application state is externalized to DynamoDB and Cognito, making functions trivially replaceable

Outcome

The resulting system demonstrates a zero-server application model where scaling, identity, persistence, and static delivery are delegated to managed services. It provides a practical reference for small AI-enabled applications that need secure access control and elastic cost behavior without a traditional backend server.