SwimTO: Your GTA Pool Finder

by Alex Johnson 29 views

Expanding swimTO: Bringing Mississauga's Pools into the Fold

As the swimTO app continues to serve as a vital resource for Torontonians seeking drop-in swim schedules, a natural and exciting next step is to broaden its reach. This article details the proposed expansion of swimTO to encompass the vibrant community pools within Mississauga. By integrating Mississauga's facility and schedule data, we aim to create a truly unified Greater Toronto Area (GTA) pool schedule application. This expansion isn't just about adding more locations; it's about enhancing the user experience by providing a single, comprehensive view of aquatic facilities across two major GTA municipalities. The branding will remain under the familiar swimTO banner, with a refined tagline to reflect the expanded coverage: "Toronto & Mississauga." The core business objective is to offer a seamless user experience where both cities are presented together on a single map and schedule, eliminating the need for users to navigate between separate interfaces or selectors. This strategic enhancement will significantly increase the app's utility and appeal to a wider audience throughout the GTA, making it the go-to platform for anyone looking to find a public pool for a recreational swim.

The Technical Blueprint: Integrating Mississauga's Aquatic Data

The technical approach to integrating Mississauga's pool data into the existing swimTO infrastructure involves several key phases, ensuring a robust and scalable solution. The process begins with a thorough Research Phase, delving into Mississauga's open data resources. We'll meticulously investigate the Mississauga Open Data Catalogue (data.mississauga.ca) and explore datasets such as City Landmarks to identify recreation facilities. Simultaneously, we'll examine recreation.mississauga.ca for program schedules. A critical aspect of this phase is determining the most effective method for data acquisition – ideally an API or a reliable data feed. However, we must also prepare for the possibility of needing to implement web scraping techniques if direct data access is unavailable. The outcome of this research will be a clear understanding of the data format and access methods for Mississauga's pool information. Key considerations during this phase include recognizing that Mississauga might not utilize the same CKAN API structure as Toronto, potentially requiring more specialized scraping tools like Playwright. Crucially, we need to acquire both the precise facility locations and their corresponding schedule data to provide a complete user experience.

Following the research, the Database Schema Updates will involve introducing a new city field to the Facility model. This VARCHAR field will store values like "Toronto" or "Mississauga," enabling straightforward filtering. An index will be added to this city field to ensure efficient data retrieval. An Alembic migration will be generated to implement this schema change seamlessly. These updates will be reflected in apps/api/app/models.py and apps/api/app/schemas.py to incorporate the new city field.

The Data Pipeline Updates are central to ingesting and processing Mississauga's data. A new module, data-pipeline/sources/mississauga_data.py, will be created to parse both facility locations and drop-in schedules from Mississauga. This data will be normalized to match the existing schema used for Toronto's data, including handling Mississauga-specific swim type classifications. We will then update the seed_facilities.py job to include Mississauga facilities, modify the daily_refresh.py job to fetch Mississauga schedules, and ensure the reseed_all.py job can handle data from both cities. Configuration details, including URLs specific to Mississauga, will be added to data-pipeline/config.py.

In the API Updates phase, we'll enhance the existing API routes. Specifically, apps/api/app/routes/facilities.py and apps/api/app/routes/schedule.py will be modified to accept an optional city query parameter. The crucial aspect here is ensuring that all API queries, by default, return data from both Toronto and Mississauga, thereby supporting the unified view objective. This means the underlying database queries will be adjusted to not filter by city unless explicitly requested.

Finally, the Frontend Updates will ensure the user interface reflects the expanded scope. Copy Changes across pages like Home.tsx, About.tsx, and RealTimeUpdates.tsx will be made to replace "Toronto" with "GTA" or explicitly mention "Toronto and Mississauga." For instance, the hero section on the Home page will be updated to read, "Discover indoor pool drop-in swim schedules across Toronto and Mississauga." Functionality-wise, MapView.tsx will be updated to display city indicators on map markers (perhaps using different colors or icons) and ensure the map bounds encompass both cities. An optional filter to show/hide by city might be added for advanced users. Similarly, ScheduleView.tsx will include a city column or indicator and an optional city filter dropdown. Metadata updates for manifest.json and index.html will also be performed to reflect the broader GTA coverage.

Ensuring a Seamless User Experience Across the GTA

The Frontend Updates are paramount to delivering a cohesive and intuitive user experience that truly reflects the expanded