{"id":23095688,"url":"https://github.com/sharjeelsafdar/project14c-virtual-lolly-app-event-driven","last_synced_at":"2026-04-10T15:39:56.126Z","repository":{"id":122237237,"uuid":"381545091","full_name":"SharjeelSafdar/project14c-virtual-lolly-app-event-driven","owner":"SharjeelSafdar","description":"A serverless JAMstack Virtual Lolly App with event-driven architecture using Gatsby, TypeScript, AppSync, DynamoDB, Lambda, StepFunctions, EventBridge, CloudFront, and Lambda@Edge.","archived":false,"fork":false,"pushed_at":"2021-08-13T11:09:11.000Z","size":648,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-09T07:43:08.035Z","etag":null,"topics":["amplify","appsync","aws","aws-cdk","cloudfront","dynamodb","event-driven","eventbridge","gatsbyjs","jamstack","lambda-edge","lambda-functions","s3","serverless","stepfunctions","typescript"],"latest_commit_sha":null,"homepage":"https://dfloplqh4uaf7.cloudfront.net/","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/SharjeelSafdar.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":"2021-06-30T01:50:19.000Z","updated_at":"2022-12-01T09:34:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"75ff6e3f-4ab5-4eb9-a4ad-1254960880fd","html_url":"https://github.com/SharjeelSafdar/project14c-virtual-lolly-app-event-driven","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/SharjeelSafdar%2Fproject14c-virtual-lolly-app-event-driven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharjeelSafdar%2Fproject14c-virtual-lolly-app-event-driven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharjeelSafdar%2Fproject14c-virtual-lolly-app-event-driven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharjeelSafdar%2Fproject14c-virtual-lolly-app-event-driven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SharjeelSafdar","download_url":"https://codeload.github.com/SharjeelSafdar/project14c-virtual-lolly-app-event-driven/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247069803,"owners_count":20878568,"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":["amplify","appsync","aws","aws-cdk","cloudfront","dynamodb","event-driven","eventbridge","gatsbyjs","jamstack","lambda-edge","lambda-functions","s3","serverless","stepfunctions","typescript"],"created_at":"2024-12-16T22:32:11.423Z","updated_at":"2025-12-30T22:44:57.270Z","avatar_url":"https://github.com/SharjeelSafdar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.gatsbyjs.com\"\u003e\n    \u003cimg alt=\"Gatsby\" src=\"https://www.gatsbyjs.com/Gatsby-Monogram.svg\" width=\"60\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e\n  Project 14C: Serverless JAMstack Virtual Lolly App with Event-Driven Architecture\n\u003c/h1\u003e\n\n## Link to Web App\n\nA serverless JAMstack Virtual Lolly App with Gatsby, TypeScript, AppSync, DynamoDB, Lambda, StepFunctions, EventBridge, CloudFront, and Lambda@Edge. The web app has been deployed to AWS CloudFront, and can be accessed [here](https://dfloplqh4uaf7.cloudfront.net).\n\n## Features\n\nThe following are some of the features of this project:\n\n- A form for creating a new Lolly at `/create-new` using [Formik](https://formik.org/docs/overview) and [Yup](https://github.com/jquense/yup)\n- Uses [DynamoDB](https://aws.amazon.com/dynamodb/) table to store the information about all the lollipops\n- A GraphQL API with [AWS AppSync](https://aws.amazon.com/appsync/) to interact with DynamoDB\n- All lollies are fetched, and static pages are built for each one at build time.\n- A [Lambda@Edge Function](https://aws.amazon.com/lambda/edge/) works as an SSR fallback: all lollies not having a static page are redirected to this function.\n- Demonstrates CRUD operations using DynamoDB through the GraphQL API\n- The AppSync queries are performed synchronously with a DynamoDB data source.\n- The AppSync mutation `createLolly` is performed assynchronously. An HTTP data source simply puts the information about the mutation on [EventBridge](https://aws.amazon.com/eventbridge/) default bus.\n- EventBridge invokes a [AWS Step Functions](https://aws.amazon.com/step-functions/) State Machine which orchestrates four [Lambda](https://aws.amazon.com/lambda/) functions in a sequence.\n- First Lambda function, `ddbLambda` performs the actual mutation on the DynamoDB Table with the help of `aws-sdk`.\n- Second Lambda function, `gqlLambda` calls a mutation on AppSync called `lollyCreated`.\n- The client listens for this mutation with an AppSync subscription called `onLollyCreated` and redirects to the new lolly page.\n- The third Lambda function, `snsLambda` publishes a message about the new lolly on an [SNS](https://aws.amazon.com/sns/) topic to notify through email.\n- The last Lambda function sends a post request on GitHub api to trigger a workflow to redeploy the Gatsby site to S3.\n- Uses [Amplify](https://amplify.com/) for GraphQL queries and mutations at client side\n- Bootstrapped with [GatsbyJS](https://www.gatsbyjs.com/)\n- Additionally, includes TypeScript support for gatsby-config, gatsby-node, gatsby-browser and gatsby-ssr files\n- Site hosted on [AWS CloudFront](https://aws.amazon.com/cloudfront/)\n- CI/CD with [GitHub Actions](https://docs.github.com/en/actions)\n- Completely typed with [TypeScript](https://www.typescriptlang.org/)\n- Completely interactive and responsive design with vanilla CSS.\n\n## Backend\n\nThis AWS CDK App deploys the backend infrastructure for Project 14C. The app consists of two stacks.\n\n### Stack 1: AppSync GraphQL API and DynamoDB Table\n\nIt contanis the AWS services used by the web client. It has the following constructs:\n\n- A DynamoDB Table to contain the lollies saved by the users\n- An AppSync GraphQL API to access the lollies in the Table\n- A Lamba function to perform the actual mutation on the DynamoDB table\n- Another Lambda function to call an AppSync mutation to inform the client side about the new lolly through an AppSync subscription\n- Another Lamba function to publish a message on SNS\n- Another Lambda function sends post request to GitHub api to trigger the workflow to rebuild and redeploy the Gatsby app.\n- A Step Functions State Machine to run these Lambda functions sequentially.\n- An EventBridge rule to invoke this state machine when the `createLolly` mutation is performed by the client side\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Architecture Diagram\" src=\"./backend/P14c AWS Architecture.jpg\" /\u003e\n\u003c/p\u003e\n\n### Stack 2: CloudFront Distribution, S3 Bucket and Lambda Edge\n\nIt contains the infrastructure to deploy frontend client. It has the following constructs:\n\n- A [S3](https://aws.amazon.com/s3/) Bucket with public access to store the static assets of Gatsby web app\n- A Cloud Front Distribution to serve the static assets through a CDN\n- A Lambda@Edge function triggered at `origin_response` event that tries to build and serve a static page for a lolly for which there is no static page in the S3 bucket yet. Otherwise, it redirects to `/404` page\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Architecture Diagram\" src=\"./backend/CloudFront Distribution Stack with Lambda@Edge.jpg\" /\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharjeelsafdar%2Fproject14c-virtual-lolly-app-event-driven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharjeelsafdar%2Fproject14c-virtual-lolly-app-event-driven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharjeelsafdar%2Fproject14c-virtual-lolly-app-event-driven/lists"}