{"id":25424722,"url":"https://github.com/asmitranjansinha/flowcraft-api","last_synced_at":"2026-05-18T09:37:27.823Z","repository":{"id":275789582,"uuid":"898555919","full_name":"asmitranjansinha/flowcraft-api","owner":"asmitranjansinha","description":"A FastAPI-based backend that validates whether a directed graph is a Directed Acyclic Graph (DAG) using Kahn’s Algorithm. It integrates with the Flowcraft frontend to analyze graph pipelines.","archived":false,"fork":false,"pushed_at":"2025-02-04T15:18:33.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T16:25:37.166Z","etag":null,"topics":["dag","fastapi","flowcraft","graph-algorithms","kahns-alogrithm","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asmitranjansinha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T15:53:10.000Z","updated_at":"2025-02-04T15:18:37.000Z","dependencies_parsed_at":"2025-02-04T16:35:50.576Z","dependency_job_id":null,"html_url":"https://github.com/asmitranjansinha/flowcraft-api","commit_stats":null,"previous_names":["asmitranjansinha/flowcraft-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmitranjansinha%2Fflowcraft-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmitranjansinha%2Fflowcraft-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmitranjansinha%2Fflowcraft-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmitranjansinha%2Fflowcraft-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asmitranjansinha","download_url":"https://codeload.github.com/asmitranjansinha/flowcraft-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239207394,"owners_count":19599966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dag","fastapi","flowcraft","graph-algorithms","kahns-alogrithm","python"],"created_at":"2025-02-16T23:17:26.885Z","updated_at":"2026-05-18T09:37:27.756Z","avatar_url":"https://github.com/asmitranjansinha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI DAG Checker (flowcraft-api)\n\n## 📌 Project Overview\n\nThis is a FastAPI-based backend that provides an API to check if a directed graph is a Directed Acyclic Graph (DAG). It is designed to work with the **Flowcraft** frontend, which submits a pipeline to determine whether the graph is a DAG.\n\n## 🚀 Features\n\n- Parses and analyzes graph structures submitted via API\n- Uses **Kahn’s Algorithm** to determine if the graph is a DAG\n- Provides CORS support for frontend integration\n- Fast and efficient processing using FastAPI\n\n## 🏗️ Project Architecture\n\n```\nbackend/\n├── main.py               # FastAPI application\n├── requirements.txt      # Python dependencies\n├── README.md             # Project documentation\n```\n\n## ⚙️ Installation and Setup\n\nTo run this project locally, follow these steps:\n\n1. Clone the repository:\n\n   ```sh\n   git clone \u003crepository-url\u003e\n   cd backend\n   ```\n\n2. Create a virtual environment and activate it:\n\n   ```sh\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. Install dependencies:\n\n   ```sh\n   pip install -r requirements.txt\n   ```\n\n4. Run the FastAPI server:\n\n   ```sh\n   uvicorn main:app --reload\n   ```\n\nThe API will be available at `http://127.0.0.1:8000/`.\n\n## 📡 API Endpoints\n\n### Health Check\n\n- **Endpoint:** `/`\n- **Method:** `GET`\n- **Response:** `{ \"Ping\": \"Pong\" }`\n\n### Parse Pipeline\n\n- **Endpoint:** `/pipelines/parse`\n- **Method:** `POST`\n- **Request Body:**\n\n  ```json\n  {\n    \"nodes\": [{ \"id\": \"A\" }, { \"id\": \"B\" }, { \"id\": \"C\" }],\n    \"edges\": [\n      { \"source\": \"A\", \"target\": \"B\" },\n      { \"source\": \"B\", \"target\": \"C\" }\n    ]\n  }\n  ```\n\n- **Response:**\n\n  ```json\n  {\n    \"num_nodes\": 3,\n    \"num_edges\": 2,\n    \"is_dag\": true\n  }\n  ```\n\n## 🛠️ Dependencies\n\n- `fastapi` - Web framework for Python\n- `uvicorn` - ASGI server to run FastAPI apps\n\n## 🛡️ CORS Configuration\n\nThe backend supports CORS to allow requests from the frontend:\n\n```python\napp.add_middleware(\n    CORSMiddleware,\n    allow_origins=[\"http://localhost:3000\"],\n    allow_credentials=True,\n    allow_methods=[\"*\"],\n    allow_headers=[\"*\"],\n)\n```\n\n## 🔗 Integration with Flowcraft\n\nThis backend is designed to work seamlessly with the **Flowcraft** frontend, which allows users to visually create and submit pipeline graphs for validation.\n\n## 📜 License\n\nThis project is open-source and available under the [MIT License](LICENSE).\n\n---\n\nFeel free to contribute, report issues, or suggest improvements!\n\nHappy coding! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmitranjansinha%2Fflowcraft-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasmitranjansinha%2Fflowcraft-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmitranjansinha%2Fflowcraft-api/lists"}