GithubHelp home page GithubHelp logo

BusinessFlow

BusinessFlow is a small but very handy tool for creating internal apps using TypeScript. It allows you to get user input without worrying about UI, authentication or API communication. BusinessFlow will create an UI based on your Flow. Need a string from the user? Just use ctx.input.text(). Need a number? Use ctx.input.number(). BusinessFlow will show the input fields to the user and return their values to your script.

Example

Overview

Overview

Flow execution

Flow

Code

BusinessFlow is built on Node.js and TypeScript and is nothing more than a npm package. To build a BusinessFlow App create a TypeScript file (e.g. main.ts), install the BusinessFlow SDK and start scripting. You can use any other npm package, like Prisma in the following example:

import BusinessFlow from "@businessflow/sdk";
import { Context, Flow } from "@businessflow/types";
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

async function run(ctx: Context) {
  // Get Name
  const name = await ctx.input.text({
    label: "Name",
    placeholder: "New Team",
    required: true,
  });

  // Get icon
  const iconUrl = await ctx.input.file({
    label: "Icon",
    required: true,
  });

  // Create db entry
  await ctx.loading.start();
  await prisma.team.create({
    data: {
      name,
    },
  });
  await ctx.loading.complete();

  // Notify
  await ctx.notify({
    title: "New team",
    description: `A new team named ${name} has been created.`,
  });

  // Show success message
  await ctx.output.text(`Successfully created ${name}.`);
}

const createTeam: Flow = {
  emoji: "💡",
  name: "Create Team",
  permission: "team.create",
  description: "To create a new team use this nifty flow.",
  run,
};

BusinessFlow.listen({
  createTeam,
});

ts-node main.ts

Help developing BusinessFlow

Install dependencies:

npm install

Start development servers:

npm run develop

businessflow's Projects

businessflow icon businessflow

Create business apps in minutes – without worrying about UI or authentication.

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.