{"id":22756772,"url":"https://github.com/yamamotok/sst-demo","last_synced_at":"2026-05-06T19:32:06.743Z","repository":{"id":46819275,"uuid":"409669879","full_name":"yamamotok/sst-demo","owner":"yamamotok","description":"Serverless Stack (SST) demo with Node, DynamoDB, Fastify, React / SSTでサーバーレスやると楽しいです、サンプルプロジェクト","archived":false,"fork":false,"pushed_at":"2021-09-24T01:27:17.000Z","size":212,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T17:49:58.645Z","etag":null,"topics":["fastify","nodejs","react","serverless","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yamamotok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-23T16:40:19.000Z","updated_at":"2024-11-27T15:45:17.000Z","dependencies_parsed_at":"2022-09-03T19:00:54.991Z","dependency_job_id":null,"html_url":"https://github.com/yamamotok/sst-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamamotok%2Fsst-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamamotok%2Fsst-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamamotok%2Fsst-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamamotok%2Fsst-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yamamotok","download_url":"https://codeload.github.com/yamamotok/sst-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246290648,"owners_count":20753730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastify","nodejs","react","serverless","typescript"],"created_at":"2024-12-11T07:15:05.850Z","updated_at":"2026-05-06T19:32:06.714Z","avatar_url":"https://github.com/yamamotok.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Japanese follows (日本語は後半に)\n\n# Serverless Stack (SST) demo\n\n[Serverless Stack (SST)](https://docs.serverless-stack.com/) is a very useful framework.\nI can deploy my serverless app on AWS without any complex YAML or other config files.\n\nThis repo is a simple demo using my favorite tech stack,\n**TypeScript**, **DynamoDB**, **Node.js**, **Fastify**, and **React**.\n\n![image](https://user-images.githubusercontent.com/2731953/134549280-7fa6d3c2-5abe-4bd2-a4bc-04888aef4b3e.png)\n\n- Message Board App in React.\n- DynamoDB backed RESTful API with Node.js, Fastify.\n- TypeScript.\n- AWS.\n\n\n## TypeScript\n\nThankfully, in SST, TypeScript is supported without adding any plugin.\n\nHowever, if you want to create a backend and a frontend project in one repository, and they are in TypeScript, it may be a bit difficult\nbecause you need to manage two \"tsconfig.json\" files with different characteristics.\nPlease check \"React\" section too.\n\n\n## AWS DynamoDB\n\nSST is very friendly with AWS DynamoDB out of the box. Please refer to [lib/MyStack.ts](lib/MyStack.ts)\nI added one table with primary index (pair of partition key and sort key) and also one GSI.\n\n![image](https://user-images.githubusercontent.com/2731953/134549759-b4a727a4-c7d1-4917-9420-9883f4276e51.png)\n\n\n## Fastify\n\nI implemented all handlers in a Fastify application.\nPlease check [src/app.ts](src/app.ts) which is the entry point.\n\n- [Fastify](https://www.fastify.io/)\n- [aws-lambda-fastify](https://github.com/fastify/aws-lambda-fastify)\n\n\nFastify should be excluded from the bundle, otherwise unexpected error occurs.\nLet's add this setting, please see [lib/MyStack.ts](lib/MyStack.ts).\n\n```javascript\nbundle: {\n  nodeModules: ['fastify'],\n}\n```\n\n## React\n\nThis [SST React Example](https://serverless-stack.com/examples/how-to-create-a-reactjs-app-with-serverless.html)\nis using [Create React App](https://github.com/facebook/create-react-app) and JavaScript.\nHowever, I want to use TypeScript.\n\nSince CRA has a strong opinion on \"tsconfig.json\", I thought this might be a problem in this demo project.\nSo now I am using [Parcel](https://parceljs.org/) for development and making bundle.\n\n\n## Note\n\n- We can install aws-sdk with `--save-dev` option because Lambda will be able to provide the actual library.  \n  e.g. `npm install --save-dev aws-sdk`\n- If you are changing your infrastructure repeatedly and get unexpected errors when deploying,\n  `rm -f .build` may help you.\n\n\n\u0026nbsp;  \n\u0026nbsp;  \n\u0026nbsp;\n\n# Serverless Stack (SST) のデモ\n\n[Serverless Stack (SST)](https://docs.serverless-stack.com/) はとても便利なフレームワークです。\n複雑なYAMLや設定ファイルなどを編集することなく、サーバーレスアプリをAWSにデプロイすることができます。\n\n## TypeScript\n\nTypeScriptは最初からサポートされています。\n(ただし、バックエンドとフロントエンドとを同梱して両方でTypeScriptを使う場合、工夫が必要かもしれません。Reactのセクションを見てください)\n\n## AWS DynamoDB\n\nSSTはDynamoDBとの親和性が高いので、とても簡単です。\n私は１つのテーブル（Primary index と GSI）を追加しました。詳しくは [lib/MyStack.ts](lib/MyStack.ts) をみてください。\n\n## Fastify\n\nハンドラはFastifyアプリとして実装しました。[src/app.ts](src/app.ts) こちらがエントリポイントとなりますので、みてください。\n\n- [Fastify](https://www.fastify.io/)\n- [aws-lambda-fastify](https://github.com/fastify/aws-lambda-fastify)\n\n\n## React\n\nこちらの例 [SST React Example](https://serverless-stack.com/examples/how-to-create-a-reactjs-app-with-serverless.html)\nでは [Create React App](https://github.com/facebook/create-react-app) と JavaScript を使用しています。\nしかし TypeScript を使いたいところです。\n\nCRAは\"tsconfig.json\"を編集してしまうので、このデモプロジェクト（TypeScriptのプロジェクトがネストしている）では問題になりました。\nそれなので、[Parcel](https://parceljs.org/) を使用しました。\n\n\n## Note\n\n- aws-sdk は \"--save-dev\" オプションでインストールすれば十分です。Lambdaが本物を提供してくれます。  \n  例) `npm install --save-dev aws-sdk`\n\n\u0026nbsp;  \n\u0026nbsp;  \n\u0026nbsp;  \n\n## License (MIT)\n\nCopyright (c) 2021 Keisuke Yamamoto\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamamotok%2Fsst-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyamamotok%2Fsst-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamamotok%2Fsst-demo/lists"}