Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Onboard Server

Note

EDUCATIONAL PROJECT DISCLAIMER

This project is developed purely for educational and demonstrative purposes. While it aims to provide useful public transport information for Milan, it relies on data sources, including scraping information from giromilano.atm.it.

The terms of service for ATM (Azienda Trasporti Milanesi) regarding data usage are not explicitly clear, and this project may potentially violate them.

Therefore:

  • Use at Your Own Risk: We do not guarantee the accuracy or continued availability of the data, nor do we assume responsibility for any consequences arising from its use.
  • Unscheduled Discontinuation: This project, or parts of it, may be taken down or become non-functional unexpectedly if ATM's policies change or if the data sources become inaccessible.

We advise caution and understanding of these limitations.

The heart of the Onboard Project, this Vercel Python backend is responsible for fetching, processing, and serving real-time public transport data for Milan. It acts as the central data hub for the entire Onboard ecosystem, providing structured information to the client application.

✨ Key Features

  • Real-time Data Scraper: Scrapes live transport data from giromilano.atm.it to provide accurate arrival and waiting times.
  • Open Data Integration: Combines scraped data with official open data sources for comprehensive stop and line information.
  • Vercel Deployment: Optimized for serverless deployment on Vercel, ensuring high availability and scalability.
  • RESTful API: Exposes a clean and well-documented RESTful API for the Onboard SDK and Client to consume.
  • Data Caching: Implements intelligent caching mechanisms to reduce load on source systems and improve response times.

⚙️ How It Works

The server orchestrates data flow by:

  1. Periodically fetching the latest stop data, often generated by onboard-project/stopsgen.
  2. Scraping real-time vehicle arrival information from official transport websites.
  3. Processing and transforming this raw data into a structured format.
  4. Serving this enriched data via various API endpoints (e.g., stops, lines, real-time predictions).

🚀 Getting Started

API Documentation

The deployed API is accessible at: https://onboard-project-api.vercel.app

Explore the available endpoints and their responses (e.g., /stops, /lines) to understand the data structure.

Local Development

To set up the server for local development:

  1. Clone the Repository:
    git clone https://github.com/onboard-project/server.git
    cd server
  2. Create Virtual Environment:
    python -m venv venv
    # On Windows:
    .\venv\Scripts\activate
    # On macOS/Linux:
    source venv/bin/activate
  3. Install Dependencies:
    pip install -r requirements.txt
  4. Run the Server:
    uvicorn main:app --reload
    The server will typically run on http://localhost:8000.

🤝 Contributing

We encourage contributions to the Onboard Server! Whether it's improving scraping logic, optimizing API endpoints, or adding new features, your help is invaluable. Please open issues or submit pull requests.

📄 License

This project is licensed under the GNU GPL v3.0 License.

About

A Vercel Python backend responsible for fetching, processing, and serving real-time public transport data for Milan.

Resources

Stars

1 star

Watchers

1 watching

Forks

Contributors

Languages