# sannidhisriram-06/bookstore-microservice-architecture-on-aws architecture

> Architecture diagram of the GitHub repository sannidhisriram-06/bookstore-microservice-architecture-on-aws, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws
- Repository: https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws

## Overview

This is a small serverless bookstore API proof of concept. A client request is routed through API Gateway to the Lambda handler, which dispatches GET/POST /books requests and returns JSON responses; its current book data is an in-memory array recreated on each invocation. The README documents MongoDB Atlas and CloudWatch in the intended deployment, but MongoDB is not wired into the sampled handler. Those documented services are shown as separate deployment capabilities, not as implemented runtime calls.

Main entry points: [`index.mjs`](https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws/blob/main/index.mjs) (Lambda handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Request handling"]
  node_lambda["Lambda handler<br/>[index.mjs]"]
  node_dispatch["Route dispatch<br/>[index.mjs]"]
  node_response["JSON response<br/>[index.mjs]"]
end

subgraph group_cloud["AWS deployment"]
  node_gateway{{"API Gateway"}}
  node_logs[("CloudWatch Logs")]
end

subgraph group_data["Book data"]
  node_books[("In-memory books<br/>[index.mjs]")]
  node_atlas[("MongoDB Atlas")]
end

node_client(("API client"))

node_client -->|"sends HTTPS"| node_gateway
node_gateway -->|"invokes"| node_lambda
node_lambda -->|"dispatches request"| node_dispatch
node_dispatch -->|"reads and updates"| node_books
node_dispatch -->|"builds response"| node_response
node_lambda -.->|"logs events"| node_logs
node_lambda -.->|"would access"| node_atlas

click node_lambda "https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws/blob/main/index.mjs"
click node_dispatch "https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws/blob/main/index.mjs"
click node_books "https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws/blob/main/index.mjs"
click node_response "https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws/blob/main/index.mjs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lambda,node_dispatch,node_response,node_client toneBlue
class node_gateway,node_logs toneAmber
class node_books,node_atlas toneMint
```

## Components

### Request handling

- [Lambda handler](https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws/blob/main/index.mjs): `index.mjs`
- [Route dispatch](https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws/blob/main/index.mjs): `index.mjs`
- [JSON response](https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws/blob/main/index.mjs): `index.mjs`

### AWS deployment

- **API Gateway**
- **CloudWatch Logs**

### Book data

- [In-memory books](https://github.com/sannidhisriram-06/bookstore-microservice-architecture-on-aws/blob/main/index.mjs): `index.mjs`
- **MongoDB Atlas**

### Other components

- **API client**

## Connections

- API client → API Gateway: sends HTTPS (evidence: `README.md`)
- API Gateway → Lambda handler: invokes (evidence: `README.md`)
- Lambda handler → Route dispatch: dispatches request (evidence: `index.mjs`)
- Route dispatch → In-memory books: reads and updates (evidence: `index.mjs`)
- Route dispatch → JSON response: builds response (evidence: `index.mjs`)
- Lambda handler → CloudWatch Logs: logs events (evidence: `README.md`)
- Lambda handler → MongoDB Atlas: would access (evidence: `README.md`)
