Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MBTA Subway Alert Viewer

An iOS app built with SwiftUI that displays real-time alerts for MBTA subway lines in Boston.

What It Does

  • Displays the four main MBTA subway lines: Red, Blue, Orange, and Green
  • Fetches live alerts from the MBTA V3 API on tap
  • Shows each alert's header and description on a detail page
  • Handles the Green Line's four branches (B, C, D, E) automatically

Requirements

  • Xcode 15+
  • iOS 17+

Getting Started

  1. Clone the repository
  2. Open mbta project.xcodeproj in Xcode
  3. Run the app on a simulator or device

Note: API key is included in the AlertsRequest file, this should never be done in any actual codebase unless for learning purposes.

Project Structure

File Description
ContentView.swift Root view of the app
SubwayStatus.swift Main screen listing the four subway lines
RowAlertHeaders.swift Detail screen showing alerts for a selected line
AlertsRequest.swift API key, data models, and fetchAlerts network call

API

This app uses the MBTA V3 API to fetch real-time subway alerts.

The endpoint used is:

GET https://api-v3.mbta.com/alerts?filter[route]=<route>

For the Green Line, all four branches are queried together:

filter[route]=Green-B,Green-C,Green-D,Green-E

Data Model

AlertsResponse
└── data: [Alert]
        └── attributes: AlertAttributes
                ├── header: String?
                └── description: String?

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages