{"id":25615182,"url":"https://github.com/wednesday-solutions/serverless-template","last_synced_at":"2025-10-17T06:23:47.740Z","repository":{"id":146763115,"uuid":"522569387","full_name":"wednesday-solutions/serverless-template","owner":"wednesday-solutions","description":"Cloud management demands efficiency, and the Serverless Template is your key to streamline and simplify. Your ready to use batteries included serverless-framework boilerplate. Comes with lambdas, rds, and a bunch of things pre-configured","archived":false,"fork":false,"pushed_at":"2024-07-10T07:10:15.000Z","size":2133,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"dev","last_synced_at":"2025-04-13T21:13:08.701Z","etag":null,"topics":["aurora","aws","aws-lambdas","lambdas","rds","serverless-boilerplate","serverless-framework","serverless-starter","serverless-starter-kit","serverless-template","step-functions"],"latest_commit_sha":null,"homepage":"https://wednesday.is/?utm_source=github\u0026utm_medium=serverless-template","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/wednesday-solutions.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":"2022-08-08T13:52:31.000Z","updated_at":"2024-07-10T07:10:19.000Z","dependencies_parsed_at":"2023-03-26T16:04:50.913Z","dependency_job_id":null,"html_url":"https://github.com/wednesday-solutions/serverless-template","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/wednesday-solutions%2Fserverless-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wednesday-solutions%2Fserverless-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wednesday-solutions%2Fserverless-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wednesday-solutions%2Fserverless-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wednesday-solutions","download_url":"https://codeload.github.com/wednesday-solutions/serverless-template/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782260,"owners_count":21160717,"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":["aurora","aws","aws-lambdas","lambdas","rds","serverless-boilerplate","serverless-framework","serverless-starter","serverless-starter-kit","serverless-template","step-functions"],"created_at":"2025-02-22T03:18:48.837Z","updated_at":"2025-10-17T06:23:47.685Z","avatar_url":"https://github.com/wednesday-solutions.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"left\" src=\"./serverless_github.svg\" width=\"480\" height=\"520\" /\u003e\n\n\u003cdiv\u003e\n  \u003ca href=\"https://www.wednesday.is/?utm_source=github\u0026utm_medium=serverless-template\" align=\"left\"\u003e\u003cimg src=\"https://uploads-ssl.webflow.com/5ee36ce1473112550f1e1739/5f5879492fafecdb3e5b0e75_wednesday_logo.svg\"\u003e\u003c/a\u003e\n  \u003cp\u003e\n    \u003ch1 align=\"left\"\u003e Serverless Template \u003c/h1\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    A repository of Serverless applications showcasing how to orchestrate cloud infrastructure for varied use cases with multiple cloud infrastructure providers.\n  \u003c/p\u003e\n\n---\n\n  \u003cp\u003e\n    \u003ch4\u003e\n      Expert teams of digital product strategists, developers, and designers.\n    \u003c/h4\u003e\n  \u003c/p\u003e\n\n  \u003cdiv\u003e\n    \u003ca href=\"https://www.wednesday.is/contact-us/?utm_source=github\u0026utm_medium=serverless-template\" target=\"_blank\"\u003e\n      \u003cimg src=\"https://uploads-ssl.webflow.com/5ee36ce1473112550f1e1739/5f6ae88b9005f9ed382fb2a5_button_get_in_touch.svg\" width=\"121\" height=\"34\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/wednesday-solutions/\" target=\"_blank\"\u003e\n      \u003cimg src=\"https://uploads-ssl.webflow.com/5ee36ce1473112550f1e1739/5f6ae88bb1958c3253756c39_button_follow_on_github.svg\" width=\"168\" height=\"34\"\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n\n---\n\n\n\u003cspan\u003eWe’re always looking for people who value their work, so come and join us. \u003ca href=\"https://www.wednesday.is/hiring/?utm_source=github\u0026utm_medium=serverless-template\"\u003e \u003c/br\u003e We are hiring!\u003c/a\u003e\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003cdiv\u003e\n\u003cimg src='./badges/badge-statements.svg' height=\"20\"/\u003e\n\u003cimg src='./badges/badge-branches.svg' height=\"20\"/\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cimg src='./badges/badge-lines.svg'  height=\"20\"/\u003e\n\u003cimg src='./badges/badge-functions.svg' height=\"20\"/\u003e\n\u003c/div\u003e\n\nThis is serverless template. This will help you get started with serverless architecture.\n\n# Architecture\n\nWe follow [clean code](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html).\n\n```\n.\n└── src/\n\t├── drivers\n\t│   └── models\n    ├── interface-adaptors\n    └── use-cases\n```\n\n## drivers\n\n- Layer #1 for frameworks and drivers.\n- This example uses Sequelize, Model definitions are written in this folder\n- AWS SDK client creation should be done in this folder\n\n## interface-adaptors\n\n- Layer #2 for adaptors that sit in between your drivers and the business logic.\n- Write your DAOs here\n- do not use Models or SDK directly\n\n\u003cblockquote cite=\"https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html\"\u003e \nThe software in this layer is a set of adapters that convert data from the format most convenient for the use cases and entities, to the format most convenient for some external agency such as the Database or the Web. \n\u003c/blockquote\u003e\n\n## use-cases\n\n- Layer #3, for your business logic.\n\n\u003cbr\u003e\n\n# Creation of the following resources is automated\n\n- [Serverless Aurora cluster](resources/config/rds.yml)\n- [Subnets](resources/config/subnet.yml)\n- [Public Route Table](resources/config/route-public.yml)\n- [Private Route Table](resources/config/route-private.yml)\n- [Security Groups](resources/config/security-groups.yml)\n- [VPC](resources/config/vpc.yml)\n- [Elastic IP](resources/config/elastic-ip.yml)\n- [NAT Gateway](resources/config/nat-gateway.yml)\n- [Internet Gateway](resources/config/internet-gateway.yml)\n- [IAM Roles](resources/config/roles.yml)\n- [Lambdas](resources/lambda/functions.yml)\n\n# Development\n\n## Local DB setup\n\nTo setup up the database locally run\u003csup\u003e\\*\u003c/sup\u003e:\n\n```sh\npnpm local:db:up\n```\n\n- requires docker\n\nRun the following command to run migrations\n\n```sh\n./setup-local.sh\n```\n\n## Creating Models\n\nTo create a new Model Test with name of type string, run:\n\n```sh\npnpm model:generate --name Test --attributes name:string\n```\n\n## Running migrations\n\nTo run migrations, run:\n\n```sh\npnpm db:migrate\n```\n\n## Lambda Builder\n\nBuild a handler for your lambda with a set of basic middy middlewares.\n\n### Usage\n\nCreate a new handler with the basic middlewares\n\n```javascript\n// index.js\n\nconst baseHandler = (event, context) =\u003e {\n\t// write logic here\n};\n\nexport const handler = new LambdaBuilder(baseHandler)\n\t.buildBasicMiddlewares()\n\t.getLambdaHandler();\n```\n\nAlso supports Schema Validation , just pass schema in basicMiddleware\n\n```\nexport const handler = new LambdaBuilder(baseHandler)\n\t.buildBasicMiddlewares(schema)\n\t.getLambdaHandler();\n\n```\n\n## Lambda Closer\n\nIf you are using the APIGateway, this Class will help you construct success and error responses.\n\nAPIGateway expectes the following response signatures.\n\n### Success\n\n```javascript\n{\n\t...\n\tstatusCode: 2XX,\n\tbody: {...}\n\t...\n}\n```\n\n### Error\n\n```javascript\n{\n\t...\n\tstatusCode: 4XX, // or 5XX\n\tbody: {...}\n}\n```\n\n### Usage\n\n### Close the handler with statusCode and body\n\n```javascript\nconst baseHandler = (event, context) =\u003e {\n\treturn new LambdaCloser(data).ok();\n};\n```\n\n#### 200\n\n```javascript\nconst response = new LambdaCloser({\n\tdata: {...},\n\tmessage: 'response message'\n}).ok();\n\nexpect(response).toEqual({\n\tstatusCode: 200,\n\tbody: {\n\t\tdata: {...},\n\t\tmessage: 'response message'\n\t},\n}); //true\n```\n\n#### 201\n\n```javascript\nconst response = new LambdaCloser({\n\tdata: {...},\n\tmessage: 'response message'\n}).created();\n\nexpect(response).toEqual({\n\tstatusCode: 201,\n\tbody: {\n\t\tdata: {...},\n\t\tmessage: 'response message'\n\t},\n}); // true\n```\n\n### Predefined Error codes and messages\n\nThe LambdaCloser promotes usage of predefined error codes and error code messages.\n\nDefine your error code in utils/error-code.js and add a message for the code in utils/error-code-messages.js\n\n#### 400\n\n```javascript\n// create an error code in error-codes.js\nconst ERROR_CODES = {\n\tE1: 'E1',\n};\n\n// create an error code message for the code in error-code-messages.js\nconst ERROR_CODE_MESSAGES = {\n\tE1: 'Custom error message',\n};\n\nconst response = new LambdaCloser({\n\tcode: 'E1',\n}).badRequest();\n\nexpect(response).toEqual({\n\tstatusCode: 400,\n\tbody: {\n\t\tmessage: 'Custom error message',\n\t\tcode: 'E1',\n\t},\n}); // true\n```\n\n# Lambda Functions\n\nWe have different lambda functions for showcasing :\n\n- CRUD options for Todo\n- Cron jobs\n- Cognito triggers\n\n[functions](https://github.com/wednesday-solutions/serverless-template-todo/tree/dev/functions)\n\n# Postman collection\n\nYou can find postman collection here : [collection](https://github.com/wednesday-solutions/serverless-template-todo/tree/dev/postman)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwednesday-solutions%2Fserverless-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwednesday-solutions%2Fserverless-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwednesday-solutions%2Fserverless-template/lists"}