Skip to content

highfunctioning/SalleRoute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 SalleRoute

Project Overview

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.

Features

  • 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.

Technologies Used

  1. Frontend:
    • React
    • JavaScript
    • Figma (for design)
  2. Backend:
    • Flask (Python)

Project Structure

  • data/map_data.py: Contains the map data including rooms, nodes, and edges.
  • data/GraphObjects.py: Defines the Node and Edge classes.
  • app.py: Main Flask application with API endpoints.
  • src/pathfinding.py: Contains the implementation of Dijkstra's algorithm.

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/SalleRouteBackend.git
    cd SalleRouteBackend
  2. Create a virtual environment and activate it:

    python3 -m venv venv
    source venv/bin/activate
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

  1. Run the Flask application:

    python app.py
  2. 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"
        }

API Endpoints

  • 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}
      ]
  • 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
      }
  • POST /api/route: Finds the shortest route between two rooms. Requires start and end 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"]
      }

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •