Giter Club home page Giter Club logo

conductor-nextjs-example's Introduction

Example checkout app with Conductor and NextJS

Prerquisite

  1. node >= 18
  2. port 3456 open
  3. Conductor server

Setup conductor server (IMPORTANT)

  1. To run this app against a server, you need to set the KEY, SECRET and server URL
  2. To obtain the KEY and SECRET for the server, visit the applications from the Conductor UI, create a new application and copy the KEY and SECRET.
  3. Make sure to grant full unrestricted worker role to the application you create for dev and testing environment.
  4. Export the variables as below
# set the KEY and SECRET values with the one obtained from the Conductor UI after creating an application
export KEY=
export SECRET=
# replace CONDUCTOR_SERVER with the actual hostname, the URL must end with /api
export SERVER_URL=http://CONDUCTOR_SERVER/api
# Optional checkout workflow name defaults to MyCheckout2
export CHECKOUT_WF_NAME=MyCheckout2

Run the app

Install dependencies

yarn
yarn seedWf

Start app in the dev mode

yarn dev

open http://localhost:3456/ in the browser to use the app

Under the hood

  1. When a user places the order from the UI, a Conductor workflow is started.
  2. The UI artifically waits for a few seconds, so give an opportunity to cancel the order - this might not be the case in production env
  3. Once the wait time is over, the workflow is completed unless the user cancels the order, in which case the workflow is terminated.

Workflow definition

See workflowCreation.mjs for the workflow creation using the SDK Checkout Workflow

conductor-nextjs-example's People

Contributors

sudakatux avatar v1r3n avatar

Stargazers

 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.