Skip to content

This project leverages real-time data from Ile-de-France Mobilités (IDFM) to provide an efficient metro navigation system for Paris and Bordeaux (using a simplified dataset). It utilizes graph algorithms to calculate shortest paths, visualize the minimum spanning tree of the metro network, and check network connectivity.

Notifications You must be signed in to change notification settings

P4ND4P0W3R/Metro-Efrei-Dodo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Metro, Efrei, Dodo (MED)

This project leverages real-time data from Ile-de-France Mobilités (IDFM) to provide an efficient metro navigation system for Paris and Bordeaux (using a simplified dataset). It utilizes graph algorithms to calculate shortest paths, visualize the minimum spanning tree of the metro network, and check network connectivity.

📃 Table of Contents

About the project

Note

This project falls within the scope of the Solution Factory for the 2024 IT Mastercamp during our third year curriculum at EFREI, which is a French CS engineering school. The subject is defined in the following repository: ossef/Solution_Factory_IT.

ℹ️ Project Description

This application allows users to:

  • Find the shortest path: Determine the fastest route between two metro stations, considering real-time schedules and transfer times.
  • Visualize the minimum spanning tree (MST): Explore the underlying structure of the metro network using Kruskal's algorithm, understanding the most efficient connections.
  • Check network connectivity: Verify if the entire metro network is reachable from any given station on a specific date.

The project uses:

  • Backend: Python with FastAPI for building a robust RESTful API, TortoiseORM for interacting with the PostgreSQL database, and advanced graph algorithms for calculations.
  • Frontend: React with JavaScript and Leaflet for a dynamic and interactive user interface, allowing users to visualize the metro map and routes.

👥 Team Members

Getting Started

⚙️ Prerequisites

🚦 Run the Project

  1. Clone the repository:

    git clone https://github.com/P4ND4P0W3R/Metro-Efrei-Dodo.git
  2. Navigate to the project directory:

    cd Metro-Efrei-Dodo

Important

Before running the backend, create a .env file in the backend/ directory and add your database connection string as DATABASE_URL=postgres://username:password@host:port/db_name.

  1. Setup and run the Backend:

    python -m venv .venv  # Create a virtual environment
    .venv/Scripts/activate  # Activate the virtual environment
    pip install -r ./backend/requirements.txt  # Install dependencies from requirements.txt
    
    python populate_database.py  # (OPTIONAL) Populate database with GTFS data (adjust paths if necessary)
    
    cd backend/app
    uvicorn main:app --reload   # Start the FastAPI server

    When you are done, you can deactivate your virtual environment:

    deactivate
  2. Setup and run the Frontend:

    cd frontend
    npm install  # or yarn install
    npm run dev  # or yarn dev

Now you should be able to access the frontend application in your browser at http://localhost:5173 and interact with the FastAPI backend running at http://localhost:8000.

🗂️ File Structure

  • backend:
    • .venv/: The virtual environment directory containing isolated Python packages.
    • main.py: The primary entry point for the FastAPI application.
    • config.py: Configuration for the database and other settings.
    • models.py: Defines the database models using TortoiseORM.
    • services/: Contains logic for specific features (graph, connectivity, MST).
    • utils/: Holds general utility functions.
    • tests/: Contains unit and integration tests for the backend.
    • requirements.txt: Lists the required Python packages for the backend.
  • frontend:
    • src/: The main source code for the React frontend application.
    • public/: Holds static files like your index.html.
    • package.json: Defines frontend dependencies and scripts.

📝 Additional Notes

  • GTFS Data: You will need to download the latest GTFS data from IDFM (https://data.iledefrance-mobilites.fr/explore/dataset/offre-horaires-tc-gtfs-idfm/information/) and place it in the appropriate directory (e.g., backend/data/raw_gtfs/). You process the files to only keep the RATP lines by using the command python backend/app/utils/data_processing.py in the root directory.
  • Database: Ensure that your PostgreSQL database is set up correctly with the credentials defined in your .env file.
  • Leaflet: Customize the Leaflet map in your frontend component to match the geographic region you're working with.

This project aims to provide a flexible and scalable foundation for a metro navigation application. You can extend it with additional features like:

  • Real-time train information: Integrate live updates on train delays and disruptions.
  • Multimodal routing: Incorporate other modes of transportation (bus, tram, etc.) into the pathfinding.
  • User accounts: Allow users to save favorite routes, set journey preferences, and receive personalized notifications.
  • Accessibility: Highlight accessible stations and routes.

Important

  • The .venv folder should be added to your .gitignore to avoid unnecessary tracking.
  • This project is for educational purposes and should not be considered a production-ready system.
  • Ensure you have the correct GTFS files and data processing scripts.

About

This project leverages real-time data from Ile-de-France Mobilités (IDFM) to provide an efficient metro navigation system for Paris and Bordeaux (using a simplified dataset). It utilizes graph algorithms to calculate shortest paths, visualize the minimum spanning tree of the metro network, and check network connectivity.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published