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.
- 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.
- Python 3.9+
- Dependencies listed in
requirements.txt
Install them:
pip install -r requirements.txtStart the backend locally with:
uvicorn main:app --reloadThe API will be available at:
http://127.0.0.1:8000
Simple health check.
Response
{ "Ping": "Pong" }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."
}- CORS allows requests from the frontend (
http://localhost:5173). - Modify
originsinmain.pyto allow other clients. - Future extension: Add execution engine for pipelines.