{"id":20826716,"url":"https://github.com/cedrickchee/serverless-fullstack","last_synced_at":"2026-04-20T22:02:53.471Z","repository":{"id":138118836,"uuid":"283517791","full_name":"cedrickchee/serverless-fullstack","owner":"cedrickchee","description":"Serverless full stack app on AWS Lambda","archived":false,"fork":false,"pushed_at":"2020-07-29T14:14:49.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-21T05:18:53.005Z","etag":null,"topics":["aws-dynamodb","aws-lambda","educational-project","fullstack-javascript","microservices-application","nodejs","serverless-framework"],"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/cedrickchee.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":"2020-07-29T14:14:22.000Z","updated_at":"2025-02-21T15:52:54.000Z","dependencies_parsed_at":"2024-03-26T12:15:27.658Z","dependency_job_id":null,"html_url":"https://github.com/cedrickchee/serverless-fullstack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cedrickchee/serverless-fullstack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickchee%2Fserverless-fullstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickchee%2Fserverless-fullstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickchee%2Fserverless-fullstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickchee%2Fserverless-fullstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedrickchee","download_url":"https://codeload.github.com/cedrickchee/serverless-fullstack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickchee%2Fserverless-fullstack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32067626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T21:26:33.338Z","status":"ssl_error","status_checked_at":"2026-04-20T21:26:22.081Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-dynamodb","aws-lambda","educational-project","fullstack-javascript","microservices-application","nodejs","serverless-framework"],"created_at":"2024-11-17T23:09:50.406Z","updated_at":"2026-04-20T22:02:53.433Z","avatar_url":"https://github.com/cedrickchee.png","language":"JavaScript","readme":"# Serverless Full Stack App on AWS\n\nAn example project that shows how to setup and build a frontend for Serverless and a Node.js REST API service allowing you to create, get, authenticate our user, and validate user JWT tokens. We will deploy this to AWS Lambda. DynamoDB is our data store.\n\nWhat is our project:\n- Multiple microservices\n- A simple frontend (work-in-progress)\n- User management\n- CRM type app with multiple related entities (work-in-progress)\n    - Contacts entity\n    - Companies entity\n- Each entity is its own modular service with asynchronous communication\n\n## Setup\n\nFirst, install the Serverless Framework.\n\n```sh\n$ npm install -g serverless\n\n\u003e protobufjs@6.10.1 postinstall /home/cedric/.nvm/versions/node/v12.16.0/lib/node_modules/serverless/node_modules/protobufjs\n\u003e node scripts/postinstall\n\n\n\u003e serverless@1.76.1 postinstall /home/cedric/.nvm/versions/node/v12.16.0/lib/node_modules/serverless\n\u003e node ./scripts/postinstall.js\n\n\n   ┌───────────────────────────────────────────────────┐\n   │                                                         │\n   │   Serverless Framework successfully installed!          │\n   │                                                         │\n   │   To start your first project run 'serverless'.         │\n   │                                                         │\n   └───────────────────────────────────────────────────┘\n\n+ serverless@1.76.1\nadded 752 packages from 501 contributors in 33.039s\n```\n\nNext, sign up for a Serverless account.\n\nThen, head over to Serverless Dashboard and look for your deployment \"profiles\".\nGo to your \"dev\" profile and add an additional \"parameters\" to that:\n\n```text\nJWT_SECRET: xxxxxxxxxxxxx\n```\n\n## Build serverless endpoint\n\nCreate a User service:\n- User management service\n- We would use an external authentication provider (which is recommended) - Cognito or Auth0 - we're going with Auth0\n- We will create a custom authoriser\n- Manage user state (user CRUD)\n- Login request\n- Token generation\n\n### Create User service\n\nThis project was created with this command.\n\n```sh\n$ serverless create --template-path ./serverless-template --path user-service\nServerless: Generating boilerplate...\n```\n\nCreate a Lambda function for authenticating our user:\n\n```sh\n$ serverless create function -f createUser --handler src/functions/createUser.createUser --path src/tests\nServerless: Generating function...\nServerless: Created function file \"/home/cedric/m/dev/scratch/serverless/user-service/src/functions/createUser.js\"\nServerless: serverless-mocha-plugin: created src/tests/createUser.js\n```\n\nCreate a Lambda function for validating user JWTs:\n\n```sh\n$ serverless create function -f validate --handler src/functions/validate.validate --path src/tests\nServerless: Generating function...\nServerless: Created function file \"/home/cedric/m/dev/scratch/serverless/user-service/src/functions/validate.js\"\nServerless: serverless-mocha-plugin: created src/tests/validate.js\n```\n\n### Deploy\n\nDeploy via Serverless Dashboard profile.\n\n```sh\n$ sls login\nServerless: Logging you in via your default browser...\n... trucated ...\nServerless: You sucessfully logged in to Serverless.\nServerless: Please run 'serverless' to configure your service\n```\n\nDeploy the endpoint:\n\n```sh\n$ serverless deploy\n```\n\nThe expected result should be similar to:\n\n```sh\n$ sls deploy\nServerless: Packaging service...\nServerless: Excluding development dependencies...\nServerless: Installing dependencies for custom CloudFormation resources...\nServerless: Safeguards Processing...\nServerless: Safeguards Results:\n\n   Summary --------------------------------------------------\n\n   passed - allowed-regions\n   passed - allowed-runtimes\n   passed - allowed-stages\n   passed - framework-version\n   passed - no-secret-env-vars\n   passed - no-unsafe-wildcard-iam-permissions\n   warned - require-cfn-role\n\n   Details --------------------------------------------------\n\n   1) Warned - no cfnRole set\n      details: http://slss.io/sg-require-cfn-role\n      Require the cfnRole option, which specifies a particular role for CloudFormation to assume while deploying.\n\n\nServerless: Safeguards Summary: 6 passed, 1 warnings, 0 errors\nServerless: Creating Stack...\nServerless: Checking Stack create progress...\n........\nServerless: Stack create finished...\nServerless: Uploading CloudFormation file to S3...\nServerless: Uploading artifacts...\nServerless: Uploading service user-service.zip file to S3 (138.58 KB)...\nServerless: Uploading custom CloudFormation resources...\nServerless: Validating template...\nServerless: Updating Stack...\nServerless: Checking Stack update progress...\n..................................................................\nServerless: Stack update finished...\nService Information\nservice: user-service\nstage: dev\nregion: us-east-1\nstack: user-service-dev\nresources: 37\napi keys:\n  None\nendpoints:\n  POST - https://XXXXXXXXXX.execute-api.us-east-1.amazonaws.com/dev/v1/user/login\n  POST - https://XXXXXXXXXX.execute-api.us-east-1.amazonaws.com/dev/v1/user\nfunctions:\n  validate: user-service-dev-validate\n  loginUser: user-service-dev-loginUser\n  createUser: user-service-dev-createUser\nlayers:\n  None\nServerless: Publishing service to the Serverless Dashboard...\nServerless: Successfully published your service to the Serverless Dashboard: https://dashboard.serverless.com/tenants/{username}/applications/{application name}/services/user-service/stage/dev/region/us-east-1\n```\n\n## Usage\n\nSend an HTTP request directly to the endpoint using a tool like curl.\n\n- Register a new user:\n\n```sh\n$ curl --request POST --url https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/v1/user --data '{\"username\":\"cedric\",\"password\":\"superpass321\"}' -H 'Content-Type: application/json' -i\nHTTP/1.1 201 Created\nContent-Type: application/json\nContent-Length: 0\nConnection: keep-alive\nDate: Wed, 29 Jul 2020 04:31:52 GMT\nx-amzn-RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\nAccess-Control-Allow-Origin: *\nAccess-Control-Allow-Headers: Authorization\nx-amz-apigw-id: XXXXXXXXXXXXXXX=\nX-Amzn-Trace-Id: Root=1-xxxxxx-xxxxxxxxxxxxxxxx;Sampled=0\nAccess-Control-Allow-Credentials: true\nX-Cache: Miss from cloudfront\nVia: 1.1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.cloudfront.net (CloudFront)\nX-Amz-Cf-Pop: FRA2-C1\nX-Amz-Cf-Id: xxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxx==\n```\n\n- Authenticate a user and and return a JWT:\n\n```sh\n$ curl --request POST --url https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/v1/user/login --data '{\"username\":\"cedric\",\"password\":\"superpass321\"}' -H 'Content-Type: application/json'\n\nHTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 141\nConnection: keep-alive\nDate: Wed, 29 Jul 2020 13:23:44 GMT\nx-amzn-RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\nx-amz-apigw-id: XXXXXXXXXXXXXXX=\nX-Amzn-Trace-Id: Root=1-xxxxxx-xxxxxxxxxxxxxxxx;Sampled=0\nX-Cache: Miss from cloudfront\nVia: 1.1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.cloudfront.net (CloudFront)\nX-Amz-Cf-Pop: AMS54-C1\nX-Amz-Cf-Id: xxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxx==\n\n{\"token\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}\n```\n\nThat's it. We're done.\n\nYou can remove your service:\n\n```sh\n$ serverless remove\n\nServerless: Getting all objects in S3 bucket...\nServerless: Removing objects in S3 bucket...\nServerless: Removing Stack...\nServerless: Checking Stack removal progress...\n.............................\nServerless: Stack removal finished...\nServerless: Publishing service to the Serverless Dashboard...\nServerless: Successfully published your service to the Serverless Dashboard: https://dashboard.serverless.com/tenants/{username}/applications/{app name}/services/{service name}/stage/dev/region/{AWS region}\n```\n\n## References\n\n- [Serverless Full Stack Application on AWS course](https://www.serverless.com/learn/courses/full-stack-application-development-on-aws/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedrickchee%2Fserverless-fullstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedrickchee%2Fserverless-fullstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedrickchee%2Fserverless-fullstack/lists"}