RelayFlow is a FastAPI-based backend for generating and visualizing routes that pass through T-junctions on a graph. It loads a graph, finds T-junctions, and provides endpoints to calculate and visualize routes that must pass through at least one T-junction.
- REST API for route calculation
- Visualization of routes and T-junctions
- Modular, clean project structure
RelayFlow/
api/
main.py # FastAPI app instance, API entrypoint
endpoints.py # General endpoints (root, /map, etc.)
models.py # (optional) Pydantic schemas
utils.py # (optional) Helper functions
services/ # (optional) Business logic
app/
routing.py # Graph and T-junction logic
t_junctions.py # T-junction route logic
static/
route_map.html # Generated map visualizations
cache/
*.json # Cached data
- Clone the repository:
git clone https://github.com/YektaRoustaei/RelayFlow.git cd RelayFlow - Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate - Install dependencies:
pip install -r requirements.txt
- Run the API:
uvicorn api.main:app --reload
- POST to
/routewith origin and destination coordinates to get a route passing through a T-junction. - GET
/mapto view the generated route map.
MIT