{"id":13580191,"url":"https://github.com/hardyscc/aws-nestjs-starter","last_synced_at":"2025-04-06T02:09:37.413Z","repository":{"id":37360965,"uuid":"249102102","full_name":"hardyscc/aws-nestjs-starter","owner":"hardyscc","description":"Serverless, AWS, NestJS, GraphQL and DynamoDB starter","archived":false,"fork":false,"pushed_at":"2024-04-13T17:18:37.000Z","size":63227,"stargazers_count":308,"open_issues_count":2,"forks_count":51,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-13T20:08:01.655Z","etag":null,"topics":["apollo-server","aws","dynamodb","dynamoose","graphql","jest","jest-dynamodb","lambda","nest","nestjs","nestjs-dynamoose","nestjs-graphql","nodejs","serverless","type-graphql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hardyscc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-03-22T02:58:04.000Z","updated_at":"2024-04-15T06:59:48.971Z","dependencies_parsed_at":"2023-10-17T04:38:07.742Z","dependency_job_id":"7d4df0fe-eb67-45d9-9e80-5fe36b0442bf","html_url":"https://github.com/hardyscc/aws-nestjs-starter","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/hardyscc%2Faws-nestjs-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardyscc%2Faws-nestjs-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardyscc%2Faws-nestjs-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardyscc%2Faws-nestjs-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hardyscc","download_url":"https://codeload.github.com/hardyscc/aws-nestjs-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"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":["apollo-server","aws","dynamodb","dynamoose","graphql","jest","jest-dynamodb","lambda","nest","nestjs","nestjs-dynamoose","nestjs-graphql","nodejs","serverless","type-graphql"],"created_at":"2024-08-01T15:01:48.522Z","updated_at":"2025-04-06T02:09:37.398Z","avatar_url":"https://github.com/hardyscc.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Serverless, AWS, NestJS, GraphQL and DynamoDB starter\n\n\u003cp\u003e\n\u003ca href=\"https://github.com/hardyscc/aws-nestjs-starter/actions\"\u003e\u003cimg src=\"https://github.com/hardyscc/aws-nestjs-starter/workflows/Node.js%20CI/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n\u003ca href=\"https://sonarcloud.io/dashboard?id=hardyscc_aws-nestjs-starter\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=hardyscc_aws-nestjs-starter\u0026metric=alert_status\" alt=\"Alert Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://sonarcloud.io/component_measures?id=hardyscc_aws-nestjs-starter\u0026metric=coverage\u0026view=list\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=hardyscc_aws-nestjs-starter\u0026metric=coverage\" alt=\"Coverage\"\u003e\u003c/a\u003e\n\u003ca href=\"https://sonarcloud.io/project/issues?id=hardyscc_aws-nestjs-starter\u0026resolved=false\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=hardyscc_aws-nestjs-starter\u0026metric=bugs\" alt=\"Bugs\"\u003e\u003c/a\u003e\n\u003ca href=\"https://sonarcloud.io/project/issues?id=hardyscc_aws-nestjs-starter\u0026resolved=false\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=hardyscc_aws-nestjs-starter\u0026metric=code_smells\" alt=\"Code Smells\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/hardyscc/aws-nestjs-starter/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/hardyscc/aws-nestjs-starter\" alt=\"License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://twitter.com/hardyscchk\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/hardyscchk.svg?style=social\u0026label=Follow\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Description\n\nA starter project that makes creating a deployable AWS Serverless project extremely easy.\n\n## Technologies\n\n- [AWS Lambda](https://aws.amazon.com/lambda)\n- [AWS DynamoDB](https://aws.amazon.com/dynamodb)\n- [Serverless](https://serverless.com/framework/docs/providers/aws/)\n- [NestJS](https://docs.nestjs.com/)\n- [NestJS GraphQL](https://docs.nestjs.com/graphql/quick-start)\n- [NestJS Dynamoose](https://github.com/hardyscc/nestjs-dynamoose)\n\n## Usage\n\n```bash\ngit clone https://github.com/hardyscc/aws-nestjs-starter.git \u003cYour_Project_Name\u003e\ncd \u003cYour_Project_Name\u003e\n\nnpm install\n```\n\nAfter that find and replace `aws-nestjs-starter` to your project name on the following files:\n\n- package.json\n- serverless.yml\n- .env\n\n## Setup AWS Credentials\n\n1. [Sign up for an AWS account](https://serverless.com/framework/docs/providers/aws/guide/credentials#sign-up-for-an-aws-account)\n\n2. Login to your AWS account and go to the **Identity \u0026 Access Management (IAM)** page.\n\n3. Click on **Users** and then **Add user**. Enter a name in the first field to remind you this User is related to the Serverless Framework, like `serverless-admin`. Enable **Programmatic access** by clicking the checkbox. Click **Next** to go through to the Permissions page. Click on **Attach existing policies directly**. Search for and select **AdministratorAccess** then click **Next: Review**. Check to make sure everything looks good and click **Create user**.\n\n4. View and copy the **API Key \u0026 Secret** to a temporary place. You'll need it in the next step.\n\n## Setup Workstation\n\nInstall AWS CLI\n\n- Windows: `choco install awscli`\n- MacOS: `brew install awscli`\n\nConfig AWS CLI\n\n```bash\n$ aws configure\n\nAWS Access Key ID [****************TKYQ]:\nAWS Secret Access Key [****************yNO2]:\nDefault region name [us-east-1]:\nDefault output format [None]:\n```\n\n\u003e Please enter your **AWS Access Key ID**, **AWS Secret Access Key** and **Default region name**\n\n## Deployment\n\n```bash\n# deploy to AWS\n$ npm run deploy\n```\n\n## Install DynamoDB local\n\n```bash\n# download dynamodb local into .dynamodb folder\n$ npm run ddb:install\n```\n\n## Local Offline Development\n\n```bash\n# start dynamodb local\n$ npm run ddb:start\n\n# start serverless-offline server\n$ npm run sls:offline\n\n# start serverless-offline server and connect to online dynamodb\n$ npm run sls:online\n```\n\n## Local NestJS Development - (Optional)\n\n```bash\n# start dynamodb local\n$ npm run ddb:start\n\n# start local nestjs server\n$ npm start\n\n# start local nestjs server in watch mode\n$ npm run start:watch\n\n# start local nestjs server and connect to online dynamodb\n$ npm run start:online\n```\n\n## Tools\n\n```bash\n# re-generate the resources/dynamodb.yml from schemas\n$ npm run genres\n```\n\n## Unit Testing\n\n```bash\n# run unit test\n$ npm test\n\n# run unit test with coverage\n$ npm run test:cov\n```\n\n## E2E Testing\n\n```bash\n# start dynamodb local\n$ npm run ddb:start\n\n# run unit test with coverage\n$ npm run test:e2e\n```\n\n## GraphQL Endpoint Test\n\n- offline: http://localhost:3000/dev/graphql\n- local: http://localhost:3000/graphql\n- AWS: https://\u003cyour_aws_deployment_id\u003e.execute-api.\u003cyour_aws_region\u003e.amazonaws.com/dev/graphql\n\n```graphql\nmutation {\n  createNotification(\n    input: { targetId: \"device1\", userId: \"user1\", content: \"Hello World\" }\n  ) {\n    id\n  }\n}\n```\n\n```graphql\nquery {\n  notificationByUserId(userId: \"user1\") {\n    id\n    targetId\n    userId\n    content\n    createAt\n  }\n}\n```\n\n```graphql\nquery {\n  notificationByTargetId(targetId: \"device1\") {\n    id\n    targetId\n    userId\n    content\n    createAt\n  }\n}\n```\n\n```graphql\nmutation {\n  updateNotification(\n    id: \"1ca7726e-0af8-4ff1-8ef1-4eae97377162\"\n    input: { status: Deleted }\n  ) {\n    id\n    targetId\n    userId\n    content\n    createAt\n  }\n}\n```\n\n## RESTful Endpoint Test\n\n\u003e Please remove `/dev` from path if test using local nestjs mode\n\n```sh\ncurl -X POST 'http://localhost:3000/dev/notification' \\\n  -H 'Content-Type: application/json' \\\n  --data-raw '{ \"targetId\": \"device1\", \"userId\": \"user1\", \"content\": \"Hello\" }'\n```\n\n```sh\ncurl -X GET 'http://localhost:3000/dev/notification?targetId=device1'\n```\n\n```sh\ncurl -X GET 'http://localhost:3000/dev/notification?userId=user1'\n```\n\n```sh\ncurl -X PATCH 'http://localhost:3000/dev/notification/a30f7101-2434-4443-87fa-493c9d9d3358' \\\n  -H 'Content-Type: application/json' \\\n  --data-raw '{ \"status\": \"Deleted\" }'\n```\n\n## Stay in touch\n\n- Author - [Hardys](mailto:hardyscc@gmail.com)\n- Twitter - [@hardyscchk](https://twitter.com/hardyscchk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardyscc%2Faws-nestjs-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhardyscc%2Faws-nestjs-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardyscc%2Faws-nestjs-starter/lists"}