{"id":22086246,"url":"https://github.com/imjaroiswebdev/dynamoose-sls-crud","last_synced_at":"2026-03-27T04:45:00.985Z","repository":{"id":123516019,"uuid":"124069979","full_name":"imjaroiswebdev/dynamoose-sls-crud","owner":"imjaroiswebdev","description":"Implementation of JSON API endpoints with AWS Gateway using Serverless and Dynamoose","archived":false,"fork":false,"pushed_at":"2018-09-08T18:54:51.000Z","size":210,"stargazers_count":16,"open_issues_count":1,"forks_count":8,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-04T22:12:02.074Z","etag":null,"topics":["aws-lambda","dynamoose","serverless-framework","webpack4"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/imjaroiswebdev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-06T11:41:13.000Z","updated_at":"2023-08-23T11:45:25.000Z","dependencies_parsed_at":"2023-04-09T23:30:16.252Z","dependency_job_id":null,"html_url":"https://github.com/imjaroiswebdev/dynamoose-sls-crud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imjaroiswebdev/dynamoose-sls-crud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjaroiswebdev%2Fdynamoose-sls-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjaroiswebdev%2Fdynamoose-sls-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjaroiswebdev%2Fdynamoose-sls-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjaroiswebdev%2Fdynamoose-sls-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjaroiswebdev","download_url":"https://codeload.github.com/imjaroiswebdev/dynamoose-sls-crud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjaroiswebdev%2Fdynamoose-sls-crud/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266878574,"owners_count":23999620,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aws-lambda","dynamoose","serverless-framework","webpack4"],"created_at":"2024-12-01T01:22:33.330Z","updated_at":"2026-03-27T04:45:00.932Z","avatar_url":"https://github.com/imjaroiswebdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flt-square)](https://standardjs.com)\n# ⚡ Serverless Basic CRUD API for use of DynamoDB with Dynamoose\n\n#### Basic implementation of JSON API endpoints for creating, reading, update and delete (CRUD) for a generic data structure called just item with the interest of making of this a boilerplate for quick starting projects based on [Serverless Framework](https://serverless.com/) focused in [AWS Lambda](https://aws.amazon.com/lambda/?nc1=h_ls).\n\n## Features\n* Includes __webpack 4 support__ for packaging and including babel transpilation.\n* Yarn support (_previous versions of serverless webpack did not have well yarn support_).\n* Complete supprt for __ES6+ syntax__ up to stage 2.\n* Basic schema for \"Item\" model with [__Dynamoose__](https://github.com/automategreen/dynamoose).\n* Create, Read, Update, Delete, List and Batch creation of items.\n* In the case of new item data entries it includes auto id creation based on uuid/v1.\n* Handlers only manages IO.\n* Error parsing, logging and response to endpoint.\n* API Gateway path described for every http verb included.\n\n## Starting\n```bash\n$ yarn\n$ export AWS_PROFILE=\"Your AWS credentials profile\"\n$ serverless deploy\n```\n\n## 📢 Highlight\n  Every handler is built inside a template strutured for reusing with the folowing parts:\n\n  ```javascript\n  export const handler = async ({ body }, context, callback) =\u003e {\n    // Action invocation through promisified method\n    // handleErr and to are declared below.\n    const [err, result] = await to(crudItem(body))\n\n    // Error handling\n    if (err) {\n    callback(null, handleErr(err))\n    } else {\n      // Response construction\n      const response = {\n        statusCode: 200,\n        headers: { 'Content-Type': 'application/json' },\n        body: JSON.stringify(result)\n      }\n\n      console.log(` =\u003e Action logging...`)\n      callback(null, response)\n    }\n  }\n\n  // 🚧 Outside the handler 🚧\n  // Function responsible of data manipulation (✨ Where magic happens)\n  const crudItem = data =\u003e {\n    const itemData = JSON.parse(data)\n    // Dynamoose promisified API method for data manipulation\n    return Item.crud()\n  }\n\n  // *** Error handling support in promises\n  const to = promise =\u003e\n    promise\n      .then(data =\u003e [null, data])\n      .catch(err =\u003e [pe(err)]) // parse-error (npm module)\n\n  const handleErr = (error, statusCode = 500) =\u003e {\n    console.error(' =\u003e ERROR:', error.stack)\n\n    return {\n      statusCode,\n      headers: { 'Content-Type': 'application/json' },\n      body: JSON.stringify({ error })\n    }\n  }\n  ```\n\n\n### Endpoint description\n\n#### Get an item by its id (handler get.getById)\n`GET` -\u003e `https://[api-gateway-code].execute-api.[aws-region].amazonaws.com/[stage]/api/item/:id`\n\n#### List all the stored items (handler list.listAll)\n`GET` -\u003e `https://[api-gateway-code].execute-api.[aws-region].amazonaws.com/[stage]/api/items`\n\n#### Add one item (handler add.addOne)\n`POST` -\u003e `https://[api-gateway-code].execute-api.[aws-region].amazonaws.com/[stage]/api/add/one`\n\n#### Batch add an array of items (handler batchAdd.batchAdd)\n`POST` -\u003e `https://[api-gateway-code].execute-api.[aws-region].amazonaws.com/[stage]/api/add/batch`\n\n#### Update an item (handler update.updateOne)\n`PUT` -\u003e `https://[api-gateway-code].execute-api.[aws-region].amazonaws.com/[stage]/api/item/:id`\n\n#### Delete an item (handler delete.deleteOne)\n`DELETE` -\u003e `https://[api-gateway-code].execute-api.[aws-region].amazonaws.com/[stage]/api/item/:id`\n\n\n---\n### 🤚 Disclaimer\n\n\u003e Considere this as a quick start project boilerplate if you like some of the things implemented here, because that is the use i plan to give it. Considere that for production level even for little project there room for various validations that were ommited for the sake of general use of this.\n\n## 😎 If you came all through here then i might tell you that you can use this at your will. Enjoy! 🤘\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjaroiswebdev%2Fdynamoose-sls-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjaroiswebdev%2Fdynamoose-sls-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjaroiswebdev%2Fdynamoose-sls-crud/lists"}