Train of Thought is an iOS app that allows you to tie the journal entries you write while on public transit to the train stations or the trips between them (currently only for the 'L' in Chicago). The app gives you many different convenient ways to select a train station to associate with your journal entry: through a map view, through a current location locator button, and through a list of train stations by train line. The app also displays information about the different train lines accessible through each train station and a map view displaying pins of all train stations, giving the user helpful transit information in addition to a space to reflect.
When reflecting on public transit, sometimes your words aren't enough to capture how you're feeling. That is why user's can also submit up to 3 links to attach to their journal entry. A user could link a playlist, a YouTube video, an image URL, a poem, etc.
If the user selects the emotion analysis option when submitting a journal entry, the app also analyzes the emotion in submitted journal entries and aggregates the information for all train stations or by train station, displaying the analyzed data in a pie chart. The user can control the time interval over which submitted journal entries are analyzed by selecting a start date in settings (only available for all journal entries, not filtered by train station). The user can also customize the colors displayed in the mood charts in settings.
Users have access to their journal entries either in a list of all journal entries or filtered by train station.
- SwiftUI
- MapKit
- CoreLocation
- Firebase (firebase-ios-sdk)
- Emotion Analysis API by Twinword, Inc (available through RapidAPI)
- CTA Train Station JSON data included, but updated data can be found at: https://www.transitchicago.com/data/
- Clone this repository and open the project in XCode.
- Add Google Firebase:
- Create a Firebase project in your Firebase Console (log in using Google account).
- Register your app in the Firebase console using your project's bundle id.
- Download the Firebase configuration file from your Firebase console and add it to your project.
- Install the firebase-ios-sdk package through Swift Package Manager.
- Make sure Firebase is initialized in your app by checking that
FirebaseApp.configure()
is in CTA_Map_Journal_App.swift in the init().
- Create a file Secrets.swift in the CTA-Map-Journal folder.
- In Secrets.swift, create a
struct
calledSecrets
. - Subscribe to the Emotion Analysis API by Twinword, Inc:
- Get your API Key from the Rapid API Developer Dashboard.
- In the
Secrets
struct in Secrets.swift, create a static constant calledAPIKey
declared as theString
data type. - Assign
APIKey
's value to the API Key from Emotion Analysis API as aString
. It should look like this:
import Foundation struct Secrets { static let APIKey: String = "YOUR API KEY HERE" }
- When first running the app, a DomainError will print in console from Firebase asking you to create an index for the firebase query in the
EmotionDataViewModel
methodgetAllEmotionData
. Follow the url given in the error and build an index in your Firestore database. It may take a few minutes to build. - Create a .gitignore file and add all dependencies as well as the Secrets.swift file and your GoogleService-Info.plist file.
- Watch this video
The Train of Thought app was developed by Ada Developers Academy cohort 16 student Ivette Fernandez.