Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new serverless-framework-sqs-dynamodb kit #709

Open
wants to merge 62 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
567ff6a
init commit
dustinsgoodman Dec 22, 2022
f0fed2e
add docker-compose.yml with dynamodb and elasticmq config
dustinsgoodman Dec 22, 2022
fd662b2
add tsconfig
dustinsgoodman Dec 22, 2022
916f815
add .editorconfig
dustinsgoodman Dec 22, 2022
0f2bd12
add serverless configuration
dustinsgoodman Dec 22, 2022
734e6bf
add initial healthcheck
dustinsgoodman Dec 22, 2022
92fea91
add project linting
dustinsgoodman Dec 22, 2022
b94767c
add jest and related config
dustinsgoodman Dec 23, 2022
873a7e6
add comment to serverless config about profiles
dustinsgoodman Dec 23, 2022
154e8b1
add isOffline util
dustinsgoodman Dec 23, 2022
53bfa47
add dynamodb client
dustinsgoodman Dec 23, 2022
c5cec69
update dynamodb setup
dustinsgoodman Dec 23, 2022
0ff732d
remove serverless-dynamodb-local
dustinsgoodman Dec 23, 2022
055cb96
update eslint config
dustinsgoodman Dec 23, 2022
2858ec5
add path aliases
dustinsgoodman Dec 23, 2022
c204411
setup .env
dustinsgoodman Dec 23, 2022
a071b26
fix path aliases
dustinsgoodman Dec 23, 2022
74c90c8
update dynamodb/getClient to use correct client
dustinsgoodman Dec 23, 2022
0fc18c6
add technology type
dustinsgoodman Dec 23, 2022
7c32890
add technologies seed file
dustinsgoodman Dec 23, 2022
e1b9c89
readd serverless-dynamodb-local and fix config
dustinsgoodman Dec 23, 2022
9dac4e5
update README
dustinsgoodman Dec 23, 2022
6f617ab
update jest ignore paths to avoid build
dustinsgoodman Dec 24, 2022
047280f
add dynamodb and uuid packages
dustinsgoodman Dec 24, 2022
7a20a73
fix module reloading for lamdba
dustinsgoodman Dec 24, 2022
ebbe95c
enable typescript strict mod and new models alias
dustinsgoodman Dec 24, 2022
2905aca
update seed to use uuid
dustinsgoodman Dec 24, 2022
1c00f24
add process.env type defns
dustinsgoodman Dec 24, 2022
f0726d9
add technology CRUD endpoint config to serverless
dustinsgoodman Dec 24, 2022
b634c66
fix handler reference in update path
dustinsgoodman Dec 24, 2022
17423d1
add create & update zod schemas + types
dustinsgoodman Dec 24, 2022
2c59c35
add getErrorMessage util
dustinsgoodman Dec 24, 2022
b2eb850
fix tests for strict mode
dustinsgoodman Dec 25, 2022
f45bf79
disable no-empty-function lint rule
dustinsgoodman Dec 25, 2022
368e1fd
add aws-sdk-client-mock
dustinsgoodman Dec 25, 2022
e45ff75
add dynamodb utils
dustinsgoodman Dec 25, 2022
398eac5
add redis to project
dustinsgoodman Dec 25, 2022
08ed410
add cache utils
dustinsgoodman Dec 25, 2022
ce12f61
update test describes per https://bettertests.js.org/
dustinsgoodman Dec 27, 2022
ad0f533
add tests to technology functions
dustinsgoodman Dec 31, 2022
0f1c5ae
add technology api handlers
dustinsgoodman Dec 31, 2022
8536b17
fix errors in eslint config
dustinsgoodman Jan 1, 2023
8e2467c
fix lint and bundle optimizations
dustinsgoodman Jan 1, 2023
97bddbc
fix install of ioredis-mock
dustinsgoodman Jan 1, 2023
ee9398d
add deploy script
dustinsgoodman Jan 1, 2023
2a6151a
update readme
dustinsgoodman Jan 1, 2023
2efcd59
add swagger and configure endpoint docs
dustinsgoodman Jan 1, 2023
2c7ec1e
add queue examples
dustinsgoodman Jan 1, 2023
858ca82
update linting rules
dustinsgoodman Jan 1, 2023
7144919
fix caching bug in update
dustinsgoodman Jan 1, 2023
cfee852
fix autoswagger config
dustinsgoodman Jan 1, 2023
f507499
lock deps
dustinsgoodman Jan 1, 2023
3d3d021
update healthcheck endpoint
dustinsgoodman Jan 1, 2023
8a090f5
fix permissions
dustinsgoodman Jan 1, 2023
f6f373d
update readme
dustinsgoodman Jan 1, 2023
f6ea679
add new kit to website and CLI
dustinsgoodman Jan 1, 2023
c54d859
update docs to use npm by default
dustinsgoodman Jan 15, 2023
b33cd7b
update processors to optimize record handler instantiation
dustinsgoodman Jan 15, 2023
5012a6a
address PR feedback
dustinsgoodman Jan 15, 2023
c960a81
add notes about aws
dustinsgoodman Jan 15, 2023
d3c47ba
fix docker refernces in readme
dustinsgoodman Jan 17, 2023
fea8909
fix analyzer command
dustinsgoodman Jan 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions packages/website/src/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ import {
ExpressIcon,
PostgresIcon,
TypeOrmIcon,
ServerlessFrameworkIcon,
DynamoDBIcon,
SQSIcon,
} from './icons';

export interface NavItem {
Expand Down Expand Up @@ -311,20 +314,38 @@ export const TECHNOLOGIES = [
key: 'express',
name: 'Express.js',
tags: ['Framework'],
Icon: (props) => <ExpressIcon {...props} />
Icon: (props) => <ExpressIcon {...props} />,
},
{
key: 'typeorm',
name: 'TypeORM',
tags: ['Data Management'],
Icon: (props) => <TypeOrmIcon {...props} />
Icon: (props) => <TypeOrmIcon {...props} />,
},
{
key: 'postgres',
name: 'Postgres',
tags: ['Data Management'],
Icon: (props) => <PostgresIcon {...props} />
}
Icon: (props) => <PostgresIcon {...props} />,
},
{
key: 'serverless-framework',
name: 'Serverless Framework',
tags: ['Framework'],
Icon: (props) => <ServerlessFrameworkIcon {...props} />,
},
{
key: 'dynamodb',
name: 'AWS DynamoDB',
tags: ['Data Management'],
Icon: (props) => <DynamoDBIcon {...props} />,
},
{
key: 'sqs',
name: 'AWS SQS',
tags: ['Data Queue'],
Icon: (props) => <SQSIcon {...props} />,
},
];

export const SPONSORS_ICON = [
Expand Down
32 changes: 32 additions & 0 deletions packages/website/src/icons/DynamoDBIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Props } from './types';

export function DynamoDBIcon({ className }: Props) {
return (
<svg
width="55"
height="63"
viewBox="0 0 256 289"
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="xMidYMid"
className={className}
>
<path
d="M165.258 288.501h3.508l57.261-28.634.953-1.347V29.964l-.953-1.354L168.766 0h-3.551l.043 288.501"
fill="#5294CF"
/>
<path
d="M90.741 288.501h-3.557l-57.212-28.634-1.161-1.997-.589-226.742 1.75-2.518L87.184 0h3.601l-.044 288.501"
fill="#1F5B98"
/>
<path d="M87.285 0h81.426v288.501H87.285V0z" fill="#2D72B8" />
<path
d="M256 137.769l-1.935-.429-27.628-2.576-.41.204-57.312-2.292h-81.43l-57.313 2.292V91.264l-.06.032.06-.128 57.313-13.28h81.43l57.312 13.28 21.069 11.199v-7.2l8.904-.974-.922-1.798-28.192-20.159-.859.279-57.312-17.759h-81.43L29.972 72.515V28.61L0 63.723v30.666l.232-.168 8.672.946v7.348L0 107.28v30.513l.232-.024 8.672.128v12.807l-7.482.112L0 150.68v30.525l8.904 4.788v7.433l-8.531.942-.373-.28v30.661l29.972 35.118v-43.901l57.313 17.759h81.43l57.481-17.811.764.335 27.821-19.862 1.219-1.979-8.904-.982v-7.284l-1.167-.466-19.043 10.265-.69 1.44-57.481 13.203v.016h-81.43v-.016l-57.313-13.259v-43.864l57.313 2.284v.056h81.43l57.312-2.34 1.305.6 26.779-2.306 1.889-.923-8.904-.128v-12.807l8.904-.128"
fill="#1A476F"
/>
<path
d="M226.027 215.966v43.901L256 224.749v-30.461l-29.8 21.626-.173.052M226.027 197.421l.173-.04 29.8-16.028v-30.649l-29.973 2.757v43.96M226.2 91.208l-.173-.04v43.8L256 137.769v-30.634l-29.8-15.927M226.2 72.687L256 94.193V63.731L226.027 28.61v43.905l.173.06v.112"
fill="#2D72B8"
/>
</svg>
);
}
43 changes: 43 additions & 0 deletions packages/website/src/icons/SQSIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { Props } from './types';

export function SQSIcon({ className }: Props) {
return (
<svg
width="51"
height="63"
viewBox="0 0 256 309"
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="xMidYMid"
className={className}
>
<path
d="M255.991 100.211l-4.112-.069-123.792-36.65-.074-1.696V0L256 64.006l-.009 36.205"
fill="#D9A741"
/>
<path
d="M128 65.5l.013-65.5L.017 63.981 0 244.996l.064.032v.002l127.923 63.973.425-.591-.165-60.871-.251-.339L120 241.5 21 212l.5-114.5 106.5-32"
fill="#876929"
/>
<path
d="M147.141 195.298l-130.79 18.399.009-118.417 130.79 18.424-.009 81.594"
fill="#D9A741"
/>
<path
d="M80.864 187.813l47.132 6 .008-78.658-47.131 5.995-.009 66.663M33.385 181.771l30.587 3.888.009-62.363-30.596 3.897v54.578"
fill="#876929"
/>
<path
d="M16.36 95.28l111.653-33.484 127.978 38.415-108.76 13.502L16.36 95.28"
fill="#624A1E"
/>
<path
d="M255.927 177.376l-127.931 16.145.008-78.366 127.923 16.296v45.925M255.918 208.834l-2.753.119-124.776 37.77-.393.479-.009 61.801 127.931-63.951v-36.218"
fill="#D9A741"
/>
<path
d="M16.351 213.697l111.645 33.505 127.922-38.368-108.777-13.536-130.79 18.399"
fill="#FAD791"
/>
</svg>
);
}
18 changes: 18 additions & 0 deletions packages/website/src/icons/ServerlessFrameworkIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Props } from './types';

export function ServerlessFrameworkIcon({ className }: Props) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="64"
height="64"
className={className}
>
<path
d="M0 46.85h11.328l-3.5 10.6H0zM0 26.7h18l-3.5 10.6H0zM0 6.55h24.673l-3.5 10.6H0zm35.838 0H64v10.6H32.328zM25.656 37.3l3.5-10.6H64v10.6zm-3.163 9.552H64v10.6H18.983z"
fill="#fd5750"
fillRule="evenodd"
/>
</svg>
);
}
5 changes: 4 additions & 1 deletion packages/website/src/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ export { ShareIcon } from './ShareIcon';
export { LinkedinIcon } from './LinkedinIcon';
export { QwikIcon } from './QwikIcon';
export { SolidJsIcon } from './SolidJsIcon';
export { DenoIcon } from './DenoIcon.tsx';
export { DenoIcon } from './DenoIcon';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

export { ExpressIcon } from './ExpressIcon';
export { PostgresIcon } from './PostgresIcon';
export { TypeOrmIcon } from './TypeOrmIcon';
export { ServerlessFrameworkIcon } from './ServerlessFrameworkIcon';
export { DynamoDBIcon } from './DynamoDBIcon';
export { SQSIcon } from './SQSIcon';
3 changes: 2 additions & 1 deletion starter-kits.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"solidjs-tailwind": "SolidJs and TailwindCSS",
"angular-ngrx-scss": "Angular, NgRx, and SCSS",
"deno-oak-denodb": "Deno, Oak, and DenoDB",
"express-typeorm-postgres": "Express.js, TypeOrm, and PostgreSQL"
"express-typeorm-postgres": "Express.js, TypeOrm, and PostgreSQL",
"serverless-framework-sqs-dynamodb": "Serverless Framework, AWS SQS, and AWS DynamoDB"
}
12 changes: 12 additions & 0 deletions starters/serverless-framework-sqs-dynamodb/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.yml]
indent_style = space
6 changes: 6 additions & 0 deletions starters/serverless-framework-sqs-dynamodb/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# indicate to serverless if you're offline mode or not
IS_OFFLINE=true
# connection info for Redis used for caching
REDIS_CACHE_URL=redis://:sOmE_sEcUrE_pAsS@localhost:6379
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just wondering, since we have SQS and other docker containers running, don't we need env variables for those as well? I'm not that acquainted with serverless-framework on how that's done. Is it automatically connecting to the default ports? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: document in readme that this is only for jest, not for run time.

# how long should items last in the cache by default
DEFAULT_CACHE_TIME=300000
13 changes: 13 additions & 0 deletions starters/serverless-framework-sqs-dynamodb/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Ignore artifacts:
build
coverage
node_modules
.esbuild
.dynamodb
.redis
.serverless
swagger

# yaml
*.yaml
*.yml
126 changes: 126 additions & 0 deletions starters/serverless-framework-sqs-dynamodb/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
module.exports = {
env: {
es2021: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
overrides: [
{
files: ['**/*.test.ts', 'jest.setupEnvironment.js'],
env: {
jest: true,
},
rules: {
'no-unused-expressions': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'import', 'promise'],
rules: {
'array-callback-return': 'error',
'block-scoped-var': 'error',
'camelcase': ['error', { properties: 'never' }],
'consistent-return': 'error',
'curly': ['error', 'multi-line'],
'dot-notation': 'error',
'eqeqeq': ['error', 'allow-null'],
'guard-for-in': 'error',
'indent': ['error', 'tab'],
'linebreak-style': ['error', 'unix'],
'new-cap': 'error',
'no-array-constructor': 'error',
'no-caller': 'error',
'no-confusing-arrow': ['error', { allowParens: false }],
'no-duplicate-imports': 'error',
'no-else-return': 'error',
'no-eval': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-implied-eval': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-loop-func': 'error',
'no-multi-str': 'error',
'no-nested-ternary': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-object': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-restricted-syntax': ['error', 'ForInStatement', 'WithStatement'],
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow': 'error',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-unneeded-ternary': ['error'],
'no-unused-expressions': ['error'],
'no-unused-vars': ['error', { vars: 'local', args: 'after-used' }],
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'error',
'no-useless-rename': [
'error',
{ ignoreDestructuring: false, ignoreImport: false, ignoreExport: false },
],
'no-var': 'error',
'no-void': 'error',
'object-shorthand': ['error', 'always', { ignoreConstructors: false, avoidQuotes: true }],
'one-var': ['error', 'never'],
'operator-assignment': ['error', 'always'],
'prefer-arrow-callback': ['error', { allowNamedFunctions: false, allowUnboundThis: true }],
'prefer-const': ['error', { destructuring: 'any', ignoreReadBeforeAssign: true }],
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'quotes': ['error', 'single', { avoidEscape: true }],
'radix': 'error',
'require-atomic-updates': 'off', // Reports false positives: https://github.com/eslint/eslint/issues/11899
'semi': ['error', 'always'],
'spaced-comment': ['error', 'always'],
'strict': ['error', 'safe'],
'vars-on-top': 'error',
'yoda': 'error',

// import plugin settings
'import/export': 'error',
'import/first': ['error', 'absolute-first'],
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.test.ts',
'prettier.config.js',
'jest.config.ts',
'jest.setup.ts',
'esbuild-plugins.ts',
],
},
],
'import/no-mutable-exports': 'error',
'import/no-named-as-default': 'error',
'import/no-named-as-default-member': 'error',
'import/no-unresolved': ['error', { commonjs: false }],

// typescript settings
'@typescript-eslint/no-empty-function': 'off',
},
settings: {
'import/resolver': {
typescript: {},
},
},
};
10 changes: 10 additions & 0 deletions starters/serverless-framework-sqs-dynamodb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage
node_modules
jspm_packages

.dynamodb
.esbuild
.env
.redis
.serverless
swagger
1 change: 1 addition & 0 deletions starters/serverless-framework-sqs-dynamodb/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/gallium
13 changes: 13 additions & 0 deletions starters/serverless-framework-sqs-dynamodb/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Ignore artifacts:
build
coverage
node_modules
.esbuild
.dynamodb
.redis
.serverless
swagger

# yaml
*.yaml
*.yml
8 changes: 8 additions & 0 deletions starters/serverless-framework-sqs-dynamodb/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"endOfLine": "lf",
"printWidth": 100,
"quoteProps": "consistent",
"singleQuote": true,
"trailingComma": "es5",
"useTabs": true
}
Loading