Skip to content

Commit

Permalink
feat: serverless dynamodb api
Browse files Browse the repository at this point in the history
  • Loading branch information
vithalreddy committed Mar 30, 2023
0 parents commit ea9e6b2
Show file tree
Hide file tree
Showing 21 changed files with 21,143 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "https://json.schemastore.org/eslintrc",
"env": {
"node": true
},
"extends": [
"eslint:recommended",
"airbnb-base",
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
// Specifying Parser
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"tsconfigRootDir": ".",
"project": [
"./tsconfig.json"
]
},
// Configuring third-party plugins
"plugins": [
"@typescript-eslint"
],
"rules": {
// Configure prettier
"prettier/prettier": "error",
"@typescript-eslint/no-explicit-any": "warn",
"import/prefer-default-export": "off",
"import/no-import-module-exports": "off",
"class-methods-use-this": "off",
"@typescript-eslint/lines-between-class-members": "off",
"no-console": "off",
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
]
}
}
133 changes: 133 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

.esbuild
build
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.15.0
17 changes: 17 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"printWidth": 80,
"endOfLine": "lf",
"singleQuote": true,
"tabWidth": 2,
"indentStyle": "space",
"useTabs": true,
"trailingComma": "all",
"importOrder": [
"^node:(.*)$",
"<THIRD_PARTY_MODULES>",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2,
"editor.codeActionsOnSave": [
"source.formatDocument",
"source.fixAll.eslint"
],
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
}
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Falcon serverless apis

> using Serverless framework, MiddyJS, DynamoDB, AWS lambda, AWS API Gateway
# Setup

- git clone this repo
- npm ci
- [openapi docs](docs/openapi.json)
- [postman collection](docs/postman.json)
- local testing `npm run dev`
- generate openapi and postman file `npm run gen-openapi`
- deploy `npm run deploy -- --aws-profile REPLACE_ME`
- will create all resources like DynamoDB table, IAM roles, S3 bucket for deployment etc
- to remove everything `npx sls remove --aws-profile REPLACE_ME`
- to import users data to DDB `npm run data-import`
- you can pass env vars for `DDB_PROFILE, DDB_REGION` script will take care of rest
Loading

0 comments on commit ea9e6b2

Please sign in to comment.