This project implements a C++ backend using the Crow framework to support queries on a dynamic graph built from soccer and basketball data relationships. The frontend, written in React, lets users explore connection paths between soccer or basketball players. BFS and Dijkstra algorithms are implemented to find the shortest path between any two players.
- C++ (Crow HTTP server)
- React.js
- CSV as data source
- Clone the repository:
git clone https://github.com/chatmartin/player-pathways-team157.git- Build the C++ backend
cd player-pathways-team157
mkdir build && cd build
cmake ..
make
- Run the backend server:
./main- Navigate to the frontend folder and start React:
cd frontend
npm install
npm install axios
npm install @mui/material @emotion/react @emotion/styled
npm start
The C++ backend reads CSV files and builds a graph of player-team relationships.
Endpoints:
/fball_graph— returns node-link JSON graph for soccer/bball_graph— returns node-link JSON graph for basketball/fballAlgo— POST body with source, target, algo="bfs" or "dijkstra"/bballAlgo— same but for basketball
The frontend renders the graph and makes POST requests to the backend to fetch paths. Players can be selected via dropdown and paths are visualized interactively.
main— Final project statefrontend-feature— React UIplayer-class— Player graph modeling