Giter VIP home page Giter VIP logo

pro-platform's Introduction

xyflow-header xyflow-header-dark

GitHub License MIT npm downloads npm downloads

Powerful open source libraries for building node-based UIs with React or Svelte. Ready out-of-the-box and infinitely customizable.

React Flow · Svelte Flow · React Flow Pro · Discord


The xyflow mono repo

The xyflow repository is the home of four packages:

We just moved repositories from the @wbkd org to this one. React Flow v11 will remain on the v11 branch. When we have a stable v12, the package name of React Flow will change from reactflow to @xyflow/react.

Commercial usage

Are you using React Flow or Svelte Flow for a personal project? Great! No sponsorship needed, you can support us by reporting any bugs you find, sending us screenshots of your projects, and starring us on Github 🌟

Are you using React Flow or Svelte Flow at your organization and making money from it? Awesome! We rely on your support to keep our libraries developed and maintained under an MIT License, just how we like it. For React Flow you can do that on the React Flow Pro website and for both of our libraries you can do it through Github Sponsors.

Getting started

The best way to get started is to check out the React Flow or Svelte Flow learn section. However if you want to get a sneak peek of how to install and use the libraries you can see it here:

React Flow basic usage

Installation

npm install reactflow

Basic usage

import { useCallback } from 'react';
import ReactFlow, {
MiniMap,
Controls,
Background,
useNodesState,
useEdgesState,
addEdge,
} from 'reactflow';

import 'reactflow/dist/style.css';

const initialNodes = [
{ id: '1', position: { x: 0, y: 0 }, data: { label: '1' } },
{ id: '2', position: { x: 0, y: 100 }, data: { label: '2' } },
];

const initialEdges = [{ id: 'e1-2', source: '1', target: '2' }];

function Flow() {
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);

const onConnect = useCallback((params) => setEdges((eds) => addEdge(params, eds)), [setEdges]);

return (
  <ReactFlow
    nodes={nodes}
    edges={edges}
    onNodesChange={onNodesChange}
    onEdgesChange={onEdgesChange}
    onConnect={onConnect}
  >
    <MiniMap />
    <Controls />
    <Background />
  </ReactFlow>
);
}

export default Flow;
Svelte Flow basic usage

Installation

npm install @xyflow/svelte

Basic usage

<script lang="ts">
import { writable } from 'svelte/store';
import {
  SvelteFlow,
  Controls,
  Background,
  BackgroundVariant,
  MiniMap,
} from '@xyflow/svelte';

import '@xyflow/svelte/dist/style.css'

const nodes = writable([
  {
    id: '1',
    type: 'input',
    data: { label: 'Input Node' },
    position: { x: 0, y: 0 }
  },
  {
    id: '2',
    type: 'custom',
    data: { label: 'Node' },
    position: { x: 0, y: 150 }
  }
]);

const edges = writable([
  {
    id: '1-2',
    type: 'default',
    source: '1',
    target: '2',
    label: 'Edge Text'
  }
]);
</script>

<SvelteFlow
{nodes}
{edges}
fitView
on:nodeclick={(event) => console.log('on node click', event)}
>
<Controls />
<Background variant={BackgroundVariant.Dots} />
<MiniMap />
</SvelteFlow>

The xyflow team

React Flow and Svelte Flow are maintained by the team behind xyflow. If you need help or want to talk to us about a collaboration, reach out through our contact form or by joining our Discord Server.

License

React Flow and Svelte Flow are MIT licensed.

pro-platform's People

Contributors

chrtze avatar johnrobbjr avatar moklick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pro-platform's Issues

change method for authorizing github pro example content access

for fetching the pro examples from the private repo, we need a github access token. currently, we are using a PAT (personal access token) but this is not ideal as these are valid only for 90days max. we should switch to our own github app that should live under the xyflow org (not in the personal user account).

refactor transactional email templates

we want to adjust the email templates of the pro platform to match with the new content and look.

these templates need to be created:

  • enterprise welcome mail (+video support)
  • team invite notification (click here to sign in)

additionally, we need to adjust the existing templates:

  • starter, pro, enterprise: add section about adding your team members

update hasura auth version

current version: 0.19.1

latest version: 0.21.3


to upgrade, you can change these lines in nhost.toml:

[auth]
version = '0.21.3'

improve markdown rendering

In the collaborative flow readme, we have this nested list at the beginning:

- [Dependencies](#dependencies)
- [Breakdown](#breakdown)
  - [Setting up yjs](#setting-up-yjs)
  - [The `useNodesStateSynced` hook](#the-usenodesstatesynced-hook)
  - [The `useCursorStateSynced` hook](#the-usecursorstatesynced-hook)
  - [Rendering multiple cursors](#rendering-multiple-cursors)
- [Related docs](#related-docs)
- [See also](#see-also)

But it seems to be rendering as a flat list:

Screenshot 2023-12-14 at 12 41 20

rethink student sign up flow

some users still have problems signing up via the university sign up - we can fix this in the new platform by creating a dedicated page that you can enroll after you are signed in

add trial mode

we want to add a trial mode to the pro platform so that you can see the format of the pro examples. there are two options:

  1. we have 1-2 "free" pro examples that everyone can view when they sign up
  2. we add a free trial via stripe checkout that gives you access to some examples once you enter the billing details.

add redirectTo parameters to signup flow

to support the new and old app running in parallel, we need to adjust the redirect url within the new pro platform:

useSignUpEmailPassword()

needs to be changed to something like:

useSignUpEmailPassword({ redirectTo: 'pro-beta.reactflow.dev/dashboard' })

The redirect option needs to be different for dev, staging and production.

handle paused subscriptions

just discovered a bug where subscriptions were still active (in our database) when they are paused through the stripe customer portal. this is because the stripe event that gets send to our webhook still has status: 'active' even if you pause the payment collection. this allows users to have an active subscription without paying.

for now, we have disabled the pause subscription feature in the customer portal and need to think about how to deal with this:

  • what happens to the active subscriptions that have paused the payment (cancel all of them? resume payment manually?)?
  • how to update our database so that these users resume to the free plan?
  • how is this implemented correctly so that users are able to pause and switch to the free plan automatically?

move pro platform + backend into own repo

Why?

  • reduce deploy time
  • more lightweight monorepo
  • the platform is not so connected to the rest of the repo (except for xy-ui)
  • easier to use the platform as a starting point

Potential tasks:

  • publish xy-ui
  • use xy-ui from npm instead of workspace
  • change repo in nhost
  • change deployment repo in vercel

add redirectTo parameter when not signed in

to redirect to the page that you were looking for, we should add a redirectTo parameter to the signup/signin form so that we can redirect after successfully authentication. example:

-> pro.reactflow.dev/examples/react/auto-layout
-> not signed in
-> pro.reactflow.dev/signin?redirectTo=/examples/react/auto-layout
-> enter credentials
-> pro.reactflow.dev/examples/react/auto-layout

get pro examples from local filesystem in development mode

for a better dev experience, it would be great to be able to edit the pro examples side-by-side with the platform. this would also save some setup work as you won't need to:

  • create github access token
  • get upstash/redis to work
  • push to the examples repo before seeing the changes

idea: when developing locally, the nhost function for downloading the example returns from local filesystem instead of remote github repo/redis.

improve checkout loading times

  • create stripe customer whenever a user signs up
    currently, we only create a stripe customer when a user clicks the subscribe button for which we need to wait before showing the checkout. to minimize the loading time of the checkout, we could create the customer already when the user signs up (using hasura events).

  • store prices in upstash / redis
    the current version loads the prices each time when the checkout is created. we should cache the prices to make this faster. maybe we can use the stripe webhook to sync the prices with upstash?

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.