- This project is a Flask-based web application that allows a user to enter any location (e.g., “Fenway Park”, “Harvard Square”, “Boston Commons”), and the app returns: The nearest MBTA station, Wheelchair accessibility information,and Top 6 nearby restaurants displayed in a 3×2 grid using SerpAPI The app uses a clean styled UI with an image banner, a centered input form, and structured results. The image was obtaineed from Free Adobe Stock images
- User enters a place name through an HTML form, Mapbox API converts the user’s input → latitude & longitude, MBTA API returns the nearest station and it Shows:Station Name, and Wheelchair Accessibility
- An Empty form will displays friendly message and ask to input a Location. An Invalid location will displays an error. While No nearby stops will displays message explaining it instead of crashing
- The Bonus feature uses SerpAPI Google Maps engine to fetch top restaurants near the coordinates given, Followed by a display of restaurants in a styled 3-row × 2-column grid
pip install -r requirements.txt
Inside the project folder, make a file named .env:
MAPBOX_TOKEN=your_mapbox_key_here
MBTA_API_KEY=your_mbta_key_here
SERPAPI_KEY=your_serpapi_key_here
These keys must not be committed to GitHub. So DON'T forget to place .env in a .gitignore
python app.py
or
flask run
http://127.0.0.1:5000/
MBTA-WEB-APP-PROJECT/
│── app.py
│── mbta.py
│── README.md
│── requirements.txt
│── instructions.md
│── instructions.pdf
│── LICENSE
│── .env (should NOT be committed publicly)
│
├── templates/
│ ├── index.html
│ └── result.html
│
└── static/
├── styles.css
└── images/
└── Boston Commons.jpeg
└── Boston Map.jpeg
└── Busy T.jpeg
└── MBTA Station.jpeg (Included a few more images simply to give an opportunity to customize in the future)
- Sends request to Mapbox geocoding API
- Returns
(latitude, longitude) - Raises an error if no match is found
- Queries MBTA API for nearest stop
- Returns:
- station name
- wheelchair accessibility
- Wrapper:
- Convert place → coordinates
- Fetch nearest station
- BONUS
- Uses SerpAPI Google Maps engine
- Returns restaurants with:
- name
- address
- rating
- phone
- Displays the input form
- Shows errors
- Loads header image & CSS
- Shows station info
- Shows accessibility
- Shows 6 restaurants in a grid
- Search Again button
- Light green background
- Emerald green form box
- Centered layout
- Styled restaurant cards
- Full-width banner image
- SerpAPI free tier limits
- Mapbox may not recognize vague input
- Visual layout may vary by screen size
Developed by Daniel Rodriguez
- Firstly, I would like to mention there was usage of AI in the project planning stage as I utilized it to come up with a outline of the neccessary steps within the project. This gave a checklist and overview of everything I must complete.In order to develop this project the usae of AI was Integral as it helped Debug issues in my data calling of API key's, found errors in my logical code that returned data, and helped integrate the data necessary for the Serpapi API data in google maps. In addition it helped understand and structure the App.py file while exploring the flask library asking questions realted to setting up the routes. In the templetes files i used AI to find materials explaning the actions i required my page to take and debug any interpretation issues I ran into while running the templates. I would like to mention,there is a heavy reliance on AI in the creation of the Style.css form as it follwed commands and logic i was completely unaware of at the start of the project. As a result AI helped breakdown each individual section and explain what they do and how it interacts with the template files.In essence the usage of AI helped plan, API calling, Logoical De-Bugging, explore the flask library, learn html formatting, and accessories the flask website using CSS and explaning the process.