Giter Club home page Giter Club logo

sfn-wait-for-callback's Introduction

sfn-wait-for-callback

Welcome to the sfn-wait-for-callback repository! This project complements our blog post, demonstrating a real-world application of AWS Step Functions using the callback pattern.

We implement a basic UI that starts a Step Function, let's it wait for a specific input (title forbidden), and continues it only on user input.

Step Function Workflow

Deploy

You can use any package manager, we've used pnpm. Follow these commands to deploy the project to your AWS default profile:

pnpm install
pnpm run deploy:prod

Running Locally

To run the project on your local machine:

  1. Install dependencies:
pnpm install
  1. Start the development server:
pnpm run dev
  1. For the frontend, navigate to the packages/frontend directory and start its development server:
cd packages/frontend
pnpm run dev

Components

Frontend

Technology: Next.js

Submit Articles: We've implemented a mock form that submits new articles. We only send new article titles. If you send the title forbidden a step Function will halt.

Content Moderation System UI

Admin Page: In /admin we've built an admin page that shows you all waiting step functions. On approve or reject you will continue the Step Function with the respective decision.

image

More details are available in our blog post.

Backend Resources

  • Step Function: Built using AWS CDK, employing the chain syntax for state management.

    Step Function

  • Lambda Functions:

    • REST API: Starts Step Functions and retrieves items from DynamoDB.
    • Approval Receiver: Handles decision and task token reception.
    • Manual Approval Request: Records Step Functions awaiting approval in DynamoDB.
  • DynamoDB: Stores active Step Functions and related metadata.

Costs

This project is serverless, meaning it is 100% usage-based. Testing should be free under the AWS Free Tier. For larger-scale operations, be mindful of DynamoDB scan costs and Step Function state changes.

Contributions

Interested in contributing? Great! ๐Ÿš€ Simply create an issue or a pull request, and we'll take a look.

sfn-wait-for-callback's People

Contributors

alessandrovol23 avatar oieduardorabelo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.