0.3.31 • Published 2 years ago

@incta/model-builder v0.3.31

Weekly downloads
53
License
ISC
Repository
github
Last release
2 years ago

Artifacts in AWS (aarts)

This is a AWS serverless application, with end to end developer experience. It targets configurable speed to cost ratio, that remains the same at any scale.

Aarts is taking care of events handling topology, and underlying dynamodb storage, allowing for focusing only on domain logic development. It does that by a simple pattern matching mechanism, accross AppSync, SNS, SQS and DynamoStreams. Aarts comprise of 6 lambdas in total, which (by the pattern matching strategy) will invoke particular Command or Query from your domain.

Performance is of highest prioirity, however significant further cost and data model optimizations can be made, once it is about a concrete business problem

End to end developer experience

  • local development environment, using aws-cli sam local dynamodb
  • infrastructure as code, using aws-cdk
  • push notifications, using Appsync and GraphQL subscriptions. Aarts workers are javascript async generators. All yielded messages (for ex. validations, etc) can be forwarded to client applications, via the feeder lambda
  • bootstrap-cli (WIP)
  • Graphql queries, allowing for getting all data needed at once
  • single dynamo table design implementation
  • optimistic locking
  • historical records of the items manipulations
  • aggregation records keeping totals of all domain items, by their state
  • Unique constraints
  • Higher level item manager objects, which lay foundations for client domain logic plug-ing

Prerequisites

Recommended way of development on Windows is via WSL2

Create local dynamo test table

  • aws dynamodb create-table --cli-input-json file://local-dev-table-def.json --endpoint-url http://localhost:8000

TODOs

  • start using lerna
  • boilerplate code generation in aarts-cli. Goal is to be able to bootstrap a project from single data-model.json file
  • Graphql schema, query, mutations generation from whitin cdk, based on the client app's data-model.json

trouble shooting

  • first do a cleanup:
  • remove all node_modules find . -name "node_modules" -exec rm -rf '{}' +
  • remove all package-lock files: find . -name "package-lock.json" -exec rm -rf '{}' +
  • ensure proper line endings: find . -type f -exec dos2unix -k -s -o {} ';'
  • rebuild: cd ./packages/aarts-cli && sh buildandlink.sh (well, you need to edit buildandlink.sh not to publish to npm :) TODO start using lerna)

Useful

git 2fa with wsl2 Linux GUI apps with wsl2 Linux GUI appImage with wsl2 dynamo marshaller sns-sqs and dlqs sns-sqs and dlqs2 the saga pattern and lambda

wsl2 setup again:

  • install win 10
  • install vs code
  • enable win features: hyper-v and wsl
  • install docker for win desktop (it will complain that wsl2 is not installed)
  • install wsl2
  • install nvm/node in wsl2
  • install git in wsl2 distro
  • setup git SSH keys
  • clone the repo, note: for local-dynamodb development you need to clone into the host's windows fs (mnt/c/..etc..), not under /home/..
  • install aws sam
  • install aws cli for Linux
  • install AWS NoSQL Workbench and setup a local connection to localhost:8000
  • npm install -g aws-cdk
  • npm install -g typescript

TODO

  • npm namespaces

  • lerna

  • API gateway as alternative to AppSync

  • pre-auth post-auth lambdas in cognito

    • post auth to attach custom claims on access
  • pass (identity)/id token/access token only? to backend

    • from appsync
    • from gateway api
    • __validate methods to check for claims in token
    • when item is BASE, check cognito user for admin cognito group or to do authotization based on IAM policy?
  • eject infra from aarts-cli

  • update tests

0.3.31

2 years ago

0.3.9

2 years ago

3.0.9

2 years ago

0.3.20

2 years ago

0.3.26

2 years ago

0.3.24

2 years ago

0.3.22

2 years ago

0.3.21

2 years ago

0.3.7

2 years ago

0.1.19

2 years ago

0.3.2

2 years ago

0.3.4

2 years ago

0.1.18

3 years ago

0.1.15

3 years ago

0.1.16

3 years ago

0.1.17

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago