# mr-nilesh/lambda-appsync-boilderplate architecture

> Architecture diagram of the GitHub repository mr-nilesh/lambda-appsync-boilderplate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mr-nilesh/lambda-appsync-boilderplate
- Repository: https://github.com/mr-nilesh/lambda-appsync-boilderplate

## Overview

This repository is an AWS AppSync/Lambda boilerplate. A client invokes the AppSync API, whose query and mutation mappings dispatch to feature handlers; the handlers return results through AppSync. Auth and dashboard are the implemented feature areas. The setup script generates per-module Serverless configuration and mapping templates from function names. Configuration and a small Stripe payment type are also present, but sampled code does not show them participating in handler execution. Edges reflect README claims or shown generator behavior; no unsampled runtime wiring is assumed.

Main entry points: [`appsyncSetup.js`](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/appsyncSetup.js) (AppSync generator), [`serverless.yml`](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/serverless.yml) (AppSync API), [`src/functions/auth/loginMutation.ts`](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/auth/loginMutation.ts) (Login mutation), [`src/functions/auth/logoutMutation.ts`](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/auth/logoutMutation.ts) (Logout mutation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API setup"]
  node_appsync["AppSync API<br/>[serverless.yml]"]
  node_setup["AppSync generator<br/>[appsyncSetup.js]"]
  node_mapping["Mapping templates"]
end

subgraph group_features["Feature handlers"]
  node_authschema["Auth schema<br/>[auth.graphql]"]
  node_loginschema["Dashboard schema<br/>[dashboard.graphql]"]
  node_login["Login mutation<br/>[loginMutation.ts]"]
  node_logout["Logout mutation<br/>[logoutMutation.ts]"]
  node_events["Latest events query"]
end

subgraph group_internal["Shared types"]
  node_config["App configuration<br/>[appConfig.ts]"]
  node_tables["Table definitions<br/>[tables.ts]"]
  node_stripe["Stripe payment type<br/>[stripe.ts]"]
end

node_client(("API client"))

node_client -->|"invokes"| node_appsync
node_appsync -->|"dispatches"| node_login
node_appsync -->|"dispatches"| node_logout
node_appsync -->|"dispatches"| node_events
node_setup -->|"generates"| node_mapping
node_setup -->|"configures"| node_authschema
node_setup -->|"configures"| node_loginschema
node_setup -->|"registers"| node_login
node_setup -->|"registers"| node_logout
node_setup -->|"registers"| node_events

click node_appsync "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/serverless.yml"
click node_setup "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/appsyncSetup.js"
click node_mapping "https://github.com/mr-nilesh/lambda-appsync-boilderplate/tree/master/mapping-templates"
click node_authschema "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/auth/auth.graphql"
click node_loginschema "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/dashboard/dashboard.graphql"
click node_login "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/auth/loginMutation.ts"
click node_logout "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/auth/logoutMutation.ts"
click node_events "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/dashboard/getLatestEventsQuery.ts"
click node_config "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/config/appConfig.ts"
click node_tables "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/config/tables.ts"
click node_stripe "https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/models/stripe.ts"

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_appsync,node_setup,node_mapping,node_client toneBlue
class node_authschema,node_loginschema,node_login,node_logout,node_events toneAmber
class node_config,node_tables,node_stripe toneMint
```

## Components

### API setup

- [AppSync API](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/serverless.yml): `serverless.yml`
- [AppSync generator](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/appsyncSetup.js): `appsyncSetup.js`
- [Mapping templates](https://github.com/mr-nilesh/lambda-appsync-boilderplate/tree/master/mapping-templates): `mapping-templates`

### Feature handlers

- [Auth schema](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/auth/auth.graphql): `src/functions/auth/auth.graphql`
- [Dashboard schema](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/dashboard/dashboard.graphql): `src/functions/dashboard/dashboard.graphql`
- [Login mutation](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/auth/loginMutation.ts): `src/functions/auth/loginMutation.ts`
- [Logout mutation](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/auth/logoutMutation.ts): `src/functions/auth/logoutMutation.ts`
- [Latest events query](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/functions/dashboard/getLatestEventsQuery.ts): `src/functions/dashboard/getLatestEventsQuery.ts`

### Shared types

- [App configuration](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/config/appConfig.ts): `src/config/appConfig.ts`
- [Table definitions](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/config/tables.ts): `src/config/tables.ts`
- [Stripe payment type](https://github.com/mr-nilesh/lambda-appsync-boilderplate/blob/master/src/models/stripe.ts): `src/models/stripe.ts`

### Other components

- **API client**

## Connections

- API client → AppSync API: invokes (evidence: `README.md`)
- AppSync API → Login mutation: dispatches
- AppSync API → Logout mutation: dispatches
- AppSync API → Latest events query: dispatches
- AppSync generator → Mapping templates: generates (evidence: `appsyncSetup.js`)
- AppSync generator → Auth schema: configures (evidence: `appsyncSetup.js`)
- AppSync generator → Dashboard schema: configures (evidence: `appsyncSetup.js`)
- AppSync generator → Login mutation: registers (evidence: `appsyncSetup.js`)
- AppSync generator → Logout mutation: registers (evidence: `appsyncSetup.js`)
- AppSync generator → Latest events query: registers (evidence: `appsyncSetup.js`)
