Skip to content

This is the backend service for the Full Stack Node Editor project. It is built with FastAPI and provides APIs for validating and processing node-based pipelines.

Notifications You must be signed in to change notification settings

ullaskunder3/node-editor-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Full Stack Node Editor โ€“ Backend

This is the backend service for the Full Stack Node Editor project.
It is built with FastAPI and provides APIs for validating and processing node-based pipelines.

๐Ÿš€ Features

  • FastAPI server with CORS enabled (frontend at http://localhost:5173).
  • Pipeline validation endpoint:
    • Accepts a list of nodes and edges.
    • Runs a DAG (Directed Acyclic Graph) check using Kahnโ€™s Algorithm.
    • Detects cycles in the pipeline graph.
  • Ready to integrate with the frontend editor.

๐Ÿ“ฆ Requirements

  • Python 3.9+
  • Dependencies listed in requirements.txt

Install them:

pip install -r requirements.txt

โ–ถ๏ธ Run the Server

Start the backend locally with:

uvicorn main:app --reload

The API will be available at:

http://127.0.0.1:8000

๐Ÿ“ก API Endpoints

GET /

Simple health check.

Response

{ "Ping": "Pong" }

POST /pipelines/parse

Validate a pipeline by checking if it is a valid DAG.

Request Body

{
  "nodes": [
    { "id": "1", "type": "Start", "position": { "x": 0, "y": 0 }, "data": {} },
    {
      "id": "2",
      "type": "Task",
      "position": { "x": 100, "y": 100 },
      "data": {}
    }
  ],
  "edges": [{ "id": "e1-2", "source": "1", "target": "2" }]
}

Response

{
  "num_nodes": 2,
  "num_edges": 1,
  "is_dag": true,
  "message": "Pipeline is valid and ready for execution."
}

๐Ÿ›  Development Notes

  • CORS allows requests from the frontend (http://localhost:5173).
  • Modify origins in main.py to allow other clients.
  • Future extension: Add execution engine for pipelines.

About

This is the backend service for the Full Stack Node Editor project. It is built with FastAPI and provides APIs for validating and processing node-based pipelines.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages