SalleRoute is a project created for GDSC that aims to help students navigate Concordia University's buildings, such as the Hall Building, by providing floor maps and directing them to the correct classrooms.
- Interactive Maps: Provides floor maps of Concordia University buildings.
- Route Finding: Directs students to specific classrooms within the buildings.
- User-Friendly Interface: Designed with Figma for an intuitive experience.
- Frontend:
React
JavaScript
Figma (for design)
- Backend:
Flask (Python)
data/map_data.py
: Contains the map data including rooms, nodes, and edges.data/GraphObjects.py
: Defines theNode
andEdge
classes.app.py
: Main Flask application with API endpoints.src/pathfinding.py
: Contains the implementation of Dijkstra's algorithm.
-
Clone the repository:
git clone https://github.com/yourusername/SalleRouteBackend.git cd SalleRouteBackend
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the Flask application:
python app.py
-
Access the API endpoints:
- Get all rooms:
GET /api/rooms
- Get a specific room by ID:
GET /api/rooms/<room_id>
- Find the shortest route between two rooms:
POST /api/route
- Request body example:
{ "start": "start", "end": "831" }
- Request body example:
- Get all rooms:
-
GET /api/rooms: Returns a list of all rooms.
- Example Request:
curl -X GET http://127.0.0.1:5000/api/rooms
- Example Response:
[ {"id": "831", "name": "Room 831", "category": "room", "x": 113, "y": 116}, {"id": "833", "name": "Room 833", "category": "room", "x": 180, "y": 116}, {"id": "835", "name": "Room 833", "category": "room", "x": 237, "y": 116}, {"id": "837", "name": "Room 833", "category": "room", "x": 257, "y": 116}, {"id": "start", "name": "Entrance", "category": "start", "x": 369, "y": 252} ]
- Example Request:
-
GET /api/rooms/<room_id>: Returns details of a specific room by ID.
- Example Request:
curl -X GET http://127.0.0.1:5000/api/rooms/831
- Example Response:
{ "id": "831", "name": "Room 831", "category": "room", "x": 113, "y": 116 }
- Example Request:
-
POST /api/route: Finds the shortest route between two rooms. Requires
start
andend
in the request body.- Example Request:
curl -X POST http://127.0.0.1:5000/api/route -H "Content-Type: application/json" -d '{"start": "start", "end": "831"}'
- Example Response:
{ "path": ["start", "837", "831"] }
- Example Request:
This project is licensed under the MIT License.