https://github.com/sketchingdev/serverlessrealtimereporter
Demo app for reporting the progress of automated processes in realtime using AppSync
https://github.com/sketchingdev/serverlessrealtimereporter
appsync aws lambda nodejs serverless sqs
Last synced: about 1 year ago
JSON representation
Demo app for reporting the progress of automated processes in realtime using AppSync
- Host: GitHub
- URL: https://github.com/sketchingdev/serverlessrealtimereporter
- Owner: SketchingDev
- Created: 2019-11-09T22:31:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-03T08:35:51.000Z (over 5 years ago)
- Last Synced: 2025-01-13T04:21:32.012Z (about 1 year ago)
- Topics: appsync, aws, lambda, nodejs, serverless, sqs
- Language: TypeScript
- Homepage:
- Size: 443 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless Realtime Reporter
[](https://lerna.js.org/)
A demonstration of a Serverless application for reporting the progress of automated processes in realtime through a UI.
In this example processes update their progress by pushing Commands to a queue, although it could be extended to other
mediums e.g. CloudWatch.
At the centre of the application is AppSync (AWS's fully managed GraphQL instance) which manages the state. It pushes
data to the UI via subscriptions and receives data from a Lambda via mutations. SQS invokes the Lambda with commands
pushed to it by automated processes.
## Using a restricted deployment user
This solution can be deployed with a user that only has the necessary permissions - although they're not as restricted
as they could be.
**Creating User**
```bash
aws cloudformation create-stack \
--stack-name realtime-deployment-user \
--capabilities CAPABILITY_NAMED_IAM \
--template-body file://./.github/deployment-user.yml
```
**Updating User**
```bash
aws cloudformation update-stack \
--stack-name realtime-deployment-user \
--capabilities CAPABILITY_NAMED_IAM \
--template-body file://./.github/deployment-user.yml
```
### Configuring development environment
Follow these steps to configure your environment to use the deployment user.
```bash
# 1. Retrieve user's Access Key and Secret
aws cloudformation describe-stacks --stack-name realtime-deployment-user
# 2. Create profile for user
aws configure --profile process-reporter-deployer
# 3. Example of performing an action using this new profile
AWS_PROFILE=process-reporter-deployer yarn test:integration
```
## Improvements
* Using queries in place of scans for DynamoDB
* Using EventBridge with a schema registry
* Use [event sourcing with projections](https://stackoverflow.com/a/47313279) for Commands
* Implement pagination