# Project export: car·e

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: TreeHacks 2024
- Tagline: College students struggle to access grocery stores due to distance and busy schedules. Car·e strives to alleviate these difficulties by providing a space to match students with classmates who care.
- Devpost: https://devpost.com/software/car-e
- GitHub: https://github.com/ameeraeshtewi/treehacks24
- Video: https://www.youtube.com/embed/6t7jw_znGUc?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 4 GitHub contributor(s) — Alicia (14 commits), elaine-zhai (12 commits), Ameera Eshtewi (7 commits), Sarah Tang (6 commits)

## Devpost submission (written by the team)

### Inspiration

Inspired by our own struggles, as college students, to: Find nearby grocery stores and Find transportation to the already sparse grocery stores, we created car•e to connect altruistic college kids, with cars (or other forms of transportation) and a love for browsing grocery store aisles, with peers (without modes of transportation) looking to grab a few items from the grocery store. Food insecurity is a huge issue for college campuses. It was estimated that over 10% of Americans were food insecure in 2020, but the number shot up to over 23% of college students. Food insecurity has a strong correlation with the outcomes of student education– not only are students less likely to academically excel, but they are also less likely to obtain a bachelor's degree. Our team wanted to address the sustainability track and the Otsuka Valuenex challenge because we identified a gap in organizations that address the lack of food access for college students. Being unable to easily access a grocery store would be inconvenient at best, but more than likely perpetuates health issues, economic inequity, and transportation barriers.

### What it does

Our project is a space for college students, with the means to take quick trips to the grocery store, to volunteer a bit of their time to help out some of their peers. The “shoppers,” or students with access, input their grocery list and planned time and location of the trip. Then, “hoppers,” or college students who would like to hop onto a grocery trip would input their grocery list, and our matching algorithm sorts through the posted shopping trips.

### How we built it

We implemented our idea with low-fidelity prototypes, working from diagrams on a whiteboard, to illustrating user flow and design on Figma, and then building the product itself on SwiftUI, XCode, and Firebase. When producing the similarity-matching results between shoppers and hoppers, we looked into Python, Flask, and Chroma, exploring various methodologies to achieve a good user experience while maximizing efficiency with available shoppers.

### Challenges we ran into

Through this process, organizing the user flow and fleshing out logistical details proved to be a challenge. Our idea also required familiarization with new technology and errors, including Firebase, unknown XCode problems, and Chroma. When faced with these struggles, we dynamically built off each others’ ideas and explored various methodologies and approaches to our proposed solution; every idea and its implementation was a discussion. We drew from our personal experiences to create something that would benefit those around us, and we truly came together to address an issue that we all feel passionately about.

### Accomplishments we're proud of

Ideating process Perseverance Ability to build off of ideas Team bonding Exploration Addressing issues we experience Transforming personal experiences into solutions

### What we learned

This experience taught us that there are infinite solutions to a single problem. Thus when evaluating the most optimal solution, it’s important to evaluate on a comprehensive criteria, focusing on efficiency, impact, usability, and implementation. While this process may be time-consuming, it is necessary to keep the user in mind to ensure that the product and its features truly fulfill an unmet user need.

### What's next

Building out future features (e.g. messaging capability) Building a stronger community aspect through features in our app: more bonding and friendships Business model Incentives to get ppl started on the app

## README (from the GitHub repository)

No README available.

## Detected evidence (automated analysis)

Indexed codebase: 12 recognized source files, 50 KB.
- Python (language) — detected in the code
- Swift (language) — detected in the code
- Firebase (technology) — claimed on Devpost, not found in the code
- Flask (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (66 of 66)

```
.DS_Store
treehacks24.xcodeproj/project.pbxproj
treehacks24.xcodeproj/project.xcworkspace/contents.xcworkspacedata
treehacks24.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
treehacks24.xcodeproj/project.xcworkspace/xcuserdata/alicia.xcuserdatad/UserInterfaceState.xcuserstate
treehacks24.xcodeproj/project.xcworkspace/xcuserdata/ameerae.xcuserdatad/UserInterfaceState.xcuserstate
treehacks24.xcodeproj/xcuserdata/alicia.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
treehacks24.xcodeproj/xcuserdata/alicia.xcuserdatad/xcschemes/xcschememanagement.plist
treehacks24.xcodeproj/xcuserdata/ameerae.xcuserdatad/xcschemes/xcschememanagement.plist
treehacks24.xcodeproj/xcuserdata/elainezhai.xcuserdatad/xcschemes/xcschememanagement.plist
treehacks24/.DS_Store
treehacks24/AccountView.swift
treehacks24/activity.swift
treehacks24/Assets.xcassets/AccentColor.colorset/Contents.json
treehacks24/Assets.xcassets/AppIcon.appiconset/Contents.json
treehacks24/Assets.xcassets/Contents.json
treehacks24/Assets.xcassets/edit.imageset/Contents.json
treehacks24/Assets.xcassets/graph.imageset/Contents.json
treehacks24/Assets.xcassets/list.imageset/Contents.json
treehacks24/Assets.xcassets/map.imageset/Contents.json
treehacks24/Assets.xcassets/Montserrat/Contents.json
treehacks24/Assets.xcassets/Montserrat/Montserrat-Italic-VariableFont_wght.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/Montserrat-VariableFont_wght.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/OFL.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/OFL.dataset/OFL.txt
treehacks24/Assets.xcassets/Montserrat/README.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/README.dataset/README.txt
treehacks24/Assets.xcassets/Montserrat/static/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-Black.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-BlackItalic.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-Bold.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-BoldItalic.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-ExtraBold.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-ExtraBoldItalic.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-ExtraLight.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-ExtraLightItalic.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-Italic.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-Light.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-LightItalic.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-Medium.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-MediumItalic.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-Regular.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-SemiBold.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-SemiBoldItalic.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-Thin.dataset/Contents.json
treehacks24/Assets.xcassets/Montserrat/static/Montserrat-ThinItalic.dataset/Contents.json
treehacks24/Assets.xcassets/profile_pic.imageset/Contents.json
treehacks24/Assets.xcassets/profile.imageset/Contents.json
treehacks24/Assets.xcassets/receipt.imageset/Contents.json
treehacks24/browse.swift
treehacks24/chroma/c3489252-de13-4349-8cd1-812e18724b59/index_metadata.pickle
treehacks24/chroma/chroma.sqlite3
treehacks24/ContentView.swift
treehacks24/data/.DS_Store
treehacks24/data/Costco-products.csv
treehacks24/data/WholeFoods-products.csv
treehacks24/db_store.py
treehacks24/GoogleService-Info.plist
treehacks24/groceryList.swift
treehacks24/InputFieldView.swift
treehacks24/LogInForm.swift
treehacks24/Preview Content/Preview Assets.xcassets/Contents.json
treehacks24/SignUpForm.swift
treehacks24/startTrip.swift
treehacks24/TabView.swift
treehacks24/treehacks24App.swift
```

### Dependencies

No dependency index available.

### Recent commits (newest first)

- postTrip routes to activities
- Merge remote-tracking branch 'refs/remotes/origin/main'
- activity page + map (exchange text with vars for user data)
- without badges
- changes to grocery List
- Grocery List with correct button usage
- Add GoogleService-Info.plist
- Add grocery list items to Firebase
- Merge remote-tracking branch 'refs/remotes/origin/main'
- browse trips pull up details
- changes to the start trip and grocery list
- browse basics
- New files
- added broswe files
- try agained
- fixed the colors for the tabview icons
- new commit to activity page
- Add Firebase
- rounded all text backgrounds/shapes to cornerRadius:15 (still need to look at some and alter)
- framework for activity page

## Key source files (fetched from GitHub, selected and truncated for size)

### treehacks24/treehacks24App.swift

```swift
//
//  treehacks24App.swift
//  treehacks24
//
//  Created by Ameera Eshtewi on 2/17/24.
//

import SwiftUI
import FirebaseCore

class AppDelegate: NSObject, UIApplicationDelegate {
  func application(_ application: UIApplication,
                   didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    FirebaseApp.configure()

    return true
  }
}

@main
struct treehacks24App: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

```

### treehacks24/InputFieldView.swift

```swift
//
//  InputFieldView.swift
//  treehacks24
//
//  Created by Alicia Bao on 2/17/24.
//

import SwiftUI

struct InputFieldView: View {
    @Binding var data: String
        var title: String?
var body: some View {
    ZStack {
        TextField("", text: $data)
            .padding(.horizontal, 10)
            .frame(height: 42)
            .overlay(
                RoundedRectangle(cornerSize: CGSize(width: 4, height: 4))
                    .stroke(Color.gray, lineWidth: 1)
            )
        HStack {
            Text(title ?? "Input")
                .font(.headline)
                .fontWeight(.thin)
                .foregroundColor(Color.gray)
                .multilineTextAlignment(.leading)
                .padding(4)
                .background(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
            Spacer()
        }
        .padding(.leading, 8)
        .offset(CGSize(width: 0, height: -20))
    }.padding(4)
    }
}


struct InputFieldView_Previews: PreviewProvider{
    @State static var data: String = ""
    static var previews: some View {
        InputFieldView(data: $data, title: "Password")
        
    }
}

```

### treehacks24/TabView.swift

```swift
//
//  TabView.swift
//  treehacks24
//
//  Created by Alicia Bao on 2/17/24.
//

import SwiftUI

struct TabViewExample: View {
    var username: String = "DefaultUsername"
    
    init(username: String) {
        self.username = username
        UITabBar.appearance().backgroundColor = UIColor(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
    }
    
    var body: some View {
        TabView() {
            groceryList(username: username)
                .tabItem {
                    Text("Your List")
                    Image("list")
                }
            browse()
                .tabItem {
                    Text("Browse Trips")
                    Image("map")
                }
            activity()
                .tabItem {
                    Text("Activity")
                    Image("receipt")
                }
            AccountView()
                .tabItem {
                    Text("Profile")
                    Image("profile")
                }
            
        }
        .accentColor(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
    }
    
    struct TabViewExample_Previews: PreviewProvider {
        static var previews: some View {
            TabViewExample(username: "DefaultUsername")
        }
    }
}

```

### treehacks24/db_store.py

```python
import chromadb
import pandas as pd

chroma_client = chromadb.PersistentClient()
collections_list = chroma_client.list_collections()
print(collections_list[0].name)
collection = None
if "shops" in collections_list[0].name:
    print("Collection exists")
    collection = chroma_client.get_collection("shops")
else:
    print("Creating new collection")
    collection = chroma_client.create_collection(name="shops")

    # Load the CSV files
    file_path_costco = './data/Costco-products.csv'
    data_costco = pd.read_csv(file_path_costco)
    costco_products = data_costco.iloc[:, 0].astype(str).tolist()

    file_path_wf = './data/WholeFoods-products.csv'
    data_wf = pd.read_csv(file_path_wf)
    wf_products = data_wf.iloc[:, 0].astype(str).tolist()

    # Add Costco products
    collection.add(
        documents=costco_products,
        metadatas=[{"source": "Costco"}]*len(costco_products),
        ids=[f"costcoId{i+1}" for i in range(len(costco_products))]
    )

    # Add Whole Foods products
    collection.add(
        documents=wf_products,
        metadatas=[{"source": "Whole Foods"}]*len(wf_products),
        ids=[f"wholeFoodsId{i+1}" for i in range(len(wf_products))]
    )

results = collection.query(
    query_texts=["Lamp"],
    n_results=3
    # where={"source": "Costco"}
)

print(results)
print()

threshold = 1.2
product_matches = []
stores = []
for i in range(3):
    if results['distances'][0][i] < threshold:
        product_matches.append(results['documents'][0][i])
        stores.append(results['metadatas'][0][i]['source'])

print(product_matches)
print(stores)
```

### treehacks24/ContentView.swift

```swift
//
//  ContentView.swift
//  treehacks24
//
//  Created by Ameera Eshtewi on 2/17/24.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationView {
            ZStack{
                Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274).edgesIgnoringSafeArea(.all)
                VStack{
                    Text("Name of App")
                        .font(.largeTitle
                            .weight(.bold))
                        .foregroundStyle(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                        
                    NavigationLink(destination: SignUpForm()){
                        Text("Create a Profile")
                            .padding()
                            
                    }
                    .frame(maxWidth: 200)
                    .background(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                    .cornerRadius(15)
                    NavigationLink(destination: LogInForm()){
                        Text("Log In")
                            .padding()
                        
                    }
                    .frame(maxWidth: 200)
                    .background(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                    .cornerRadius(15)
                }
            }
        }
            .accentColor(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

```

### treehacks24/LogInForm.swift

```swift
//
//  LogInForm.swift
//  treehacks24
//
//  Created by Alicia Bao on 2/17/24.
//

import SwiftUI

struct LogInForm: View {
    @State var username: String = ""
    @State var password: String = ""
    var body: some View {

            NavigationView{
                ZStack{
                    Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274).edgesIgnoringSafeArea(.all)
                    VStack{
                        Text("Log In")
                            .font(.largeTitle
                                .weight(.bold))
                            .foregroundStyle(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                        InputFieldView(data: $username, title: "Username")
                            .padding()
                        InputFieldView(data: $password, title: "Password")
                            .padding()
                        NavigationLink(destination: TabViewExample(username: username)){
                            Text("Log In")
                                .padding()
                        }
                        .background(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                        .cornerRadius(15)
                        .frame(width: 200, height: 75)
                        .accentColor(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
                    }
                }
                .background(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274)).edgesIgnoringSafeArea(.all)
                .accentColor(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
            }
        
    }
}

struct LogIn_Previews: PreviewProvider {
    static var previews: some View {
        LogInForm()
    }
}

```

### treehacks24/SignUpForm.swift

```swift
//
//  SignUpForm.swift
//  treehacks24
//
//  Created by Alicia Bao on 2/17/24.
//

import SwiftUI

struct SignUpForm: View {
    @State var username: String = ""
    @State var password: String = ""
    @State var name: String = ""
    @State var location: String = ""
    @State var venmo: String = ""
    @State var bio: String = ""
    
    var body: some View {
        NavigationView{
            ZStack{
                Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274).edgesIgnoringSafeArea(.all)
                VStack{
                    Text("Profile")
                        .font(.largeTitle
                            .weight(.bold))
                        .foregroundStyle(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                    InputFieldView(data: $username, title: "Username")
                        .padding()
                    SecureField("Password", text: $password)
                        .padding(.leading, 35)
                        .frame(height: 80)
                        .overlay(
                            RoundedRectangle(cornerSize: CGSize(width: 4, height: 4))
                                .stroke(Color.gray, lineWidth: 1)
                                .padding()
                        )
                    InputFieldView(data: $name, title: "Name")
                        .padding()
                    InputFieldView(data: $location, title: "Location")
                        .padding()
                    InputFieldView(data: $venmo, title: "Venmo")
                        .padding()
                    InputFieldView(data: $bio, title: "Bio") 
                        .padding()
                    NavigationLink(destination: LogInForm()){
                        Text("Create New Profile")
                            .padding()
                    }
                    .background(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                    .cornerRadius(15)
                    .frame(width: 200, height: 75)
                    .accentColor(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
                    
                    
                }
            }
        }
    }
}

struct SignUpForm_Previews: PreviewProvider {
    static var previews: some View {
        SignUpForm()
    }
}

```

### treehacks24/groceryList.swift

```swift
//
//  groceryList.swift
//  treehacks24
//
//  Created by Alicia Bao on 2/17/24.
//


import SwiftUI
import FirebaseFirestore

struct Listitem: Identifiable {
    let id = UUID()
    var title: String
}

class ListModel: ObservableObject {
    @Published var items: [Listitem] = []

    var username: String
    let db = Firestore.firestore()
    
    init(username: String) {
        self.username = username
    }
    
    func addItem(title: String) {
        let newItem = Listitem(title: title)
        items.append(newItem)
        print(username)
        
        let titlesArray = items.map { $0.title }

        Reference the document for this user in the "users" collection
        let userDocument = db.collection("users").document(username)

        //Update the document with the new array of item titles
        userDocument.setData(["groceryList": titlesArray], merge: true) { error in
            if let error = error {
                print("Error updating document: \(error)")
            } else {
                print("Document successfully updated with new item")
            }
        }
        
    }
    
    func deleteItem(at indexSet: IndexSet) {
        items.remove(atOffsets: indexSet)
    }
}



struct groceryList: View {
    @StateObject var listModel: ListModel
    @State private var newItemTitle = ""
    @State private var navigateToStartTrip = false

    var username: String
    
    init(username: String) {
        self.username = username
        _listModel = StateObject(wrappedValue: ListModel(username: username))
    }
    
    var body: some View {
        NavigationView{
            VStack {
                Text("Grocery List")
                    .font(.system(size: 25))
                    .fontWeight(.bold)
                    .foregroundColor(Color(red: 76 / 255.0, green: 86 / 255.0, blue: 57 / 255.0))
                    .padding(.top)
                List {
                    ForEach(listModel.items) { item in
                        Text(item.title)
                        
                    }
                    .onDelete(perform: deleteItem)
                }
                .background(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
                .scrollContentBackground(.hidden)
                .frame(height:500)
                HStack {
                    TextField("Enter new item", text: $newItemTitle)
                        .padding()
                        .background(Color.white)
                    Button(action: addItem) {
                        Text("Add")
                            .padding()
                    }
                    .background(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                    .cornerRadius(15)
                    .buttonBorderShape(.capsule)

                }
                HStack{
                    Button(action: {
                        navigateToStartTrip = true
                    }) {
                        Text("Start a trip")
                            .padding()
                    }
                    .background(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                    .cornerRadius(15)
                    .buttonBorderShape(.capsule)

                    Button(action: joinTrip) {
                        Text("Join a Trip")
                            .padding()
                    }
                    .background(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                    .cornerRadius(15)


                }
                NavigationLink(destination: startTripView(), isActive: $navigateToStartTrip) { EmptyView() }

                Spacer()
            }
            .padding()
            .background(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
            .accentColor(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
        }
        

    }
    // connect with activity page
    func startTrip(){
        
    }
    func joinTrip(){
        
    }
    func addItem() {
           guard !newItemTitle.isEmpty else { return }
           listModel.addItem(title: newItemTitle)
           newItemTitle = ""
       }
       
   func deleteItem(at offsets: IndexSet) {
       listModel.deleteItem(at: offsets)
   }
}



struct ListMakerView_Previews: PreviewProvider {
    static var previews: some View {
        groceryList(username: "PreviewUsername")
    }
}

```

### treehacks24/startTrip.swift

```swift
//
//  startTrip.swift
//  treehacks24
//
//  Created by Elaine Zhai on 2/17/24.
//
import SwiftUI
import MapKit

struct startTripView: View {


    @State private var startTimeText = "" // User-entered time as text

    @State private var searchText = ""
    @State private var items = [String]()
    @State private var addedItems = [String]()
    
    @State private var navigateToActivities = false

    

    private func searchItems(searchText: String) -> [String] {
            if searchText.isEmpty { return items }
            return items.filter { $0.lowercased().contains(searchText.lowercased()) }
        }
    
    var body: some View {
        NavigationView{
            ZStack {
    
                Color(red: 76 / 255.0, green: 86 / 255.0, blue: 57 / 255.0)
                    .edgesIgnoringSafeArea(.all)
                VStack {
                    Text("Start Trip")
                        .font(.system(size: 30))
                        .fontWeight(.bold)
                        .foregroundColor(.white)
                        .padding(.top, 20)

                    Text("Time")
                        .padding(.top, 30)
                        .padding(.bottom, 10)
                        .foregroundColor(.white)
                        .fontWeight(.bold)
                        .font(.system(size: 20))
                    
                    TextField("Set Time", text: $startTimeText)
                        .font(.headline)
                        .foregroundColor(.white)
                        .padding()
                        .background(Color(red: 150 / 255.0, green: 165 / 255.0, blue: 120 / 255.0))
                        .cornerRadius(5.0)
                        .multilineTextAlignment(.center)
                        .frame(width: 200) // Specify the width here
                    
                    .padding()
                    
                    TextField("Search...", text: $searchText)
                        .padding(7)
                        .background(Color(.systemGray6))
                        .cornerRadius(8)
                        .padding(.horizontal, 10)
                        .onSubmit {
                            addSearchTextToList()
                        }
                        .submitLabel(.done)
                        .edgesIgnoringSafeArea(.all)
                    List {
                        ForEach(addedItems, id: \.self) { addedItem in
                            HStack {
                                Text(addedItem)
                                Spacer()
                                Button(action: {
                                    if let index = addedItems.firstIndex(of: addedItem) {
                                        addedItems.remove(at: index)
                                    }
                                }) {
                                    Image(systemName: "minus.circle.fill")
                                        .foregroundColor(.red)
                                }
                                
                            }
                        }
                        .onDelete(perform: removeItems)
                    }.background(Color(red: 150 / 255.0, green: 165 / 255.0, blue: 120 / 255.0))
                        .padding()
                    .scrollContentBackground(.hidden)

                    Spacer()
                                    
                    Button(action: {
                        navigateToActivities = true
                        print("Start Trip Button Tapped")
                    }) {
                        Text("Post Trip")
                            .padding(EdgeInsets(top: 5, leading: 10, bottom: 5, trailing: 10))
                            .background(Color(red: 150 / 255.0, green: 165 / 255.0, blue: 120 / 255.0))
                            .cornerRadius(8)
                            .font(.system(size: 14))
                            .foregroundColor(.white)
                    }
                    .padding(.horizontal)
                    .padding(.top, 20)
                    NavigationLink(destination: activity(), isActive: $navigateToActivities) { EmptyView() }
                    .hidden()
                    Spacer()
                   
                }
                
            }
            
        }
    }
    private func addSearchTextToList() {
            let trimmedText = searchText.trimmingCharacters(in: .whitespacesAndNewlines)
            if !trimmedText.isEmpty && !addedItems.contains(trimmedText) {
                addedItems.append(trimmedText)
                searchText = ""
            }
        }
    private func removeItems(at offsets: IndexSet) {
            addedItems.remove(atOffsets: offsets)
        }

}
#Preview {
    startTripView()
}

```

### treehacks24/browse.swift

```swift
//
//  browse.swift
//  treehacks24
//
//  Created by Alicia Bao on 2/17/24.
//

import SwiftUI

struct browse: View {
    @State private var detailedView = false
    var body: some View {
        ZStack{
            Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059).edgesIgnoringSafeArea(/*@START_MENU_TOKEN@*/.all/*@END_MENU_TOKEN@*/)
                VStack{
                    Text("Browse Trips")
                        .font(.largeTitle
                            .weight(.bold))
                        .foregroundStyle(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
                    VStack{
                        HStack{
                            Text("Costco")
                                .fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
                            Spacer()
                            Text("Alicia, 5:00 PM")
                        }
                        .padding()
                    HStack{
                        Text("3 items available from your list")
                            .frame(alignment: .leading)
                    }
                    HStack{
                        Button(action:{
                            detailedView = true
                        }){
                            Text("See full trip details")
                        }
                            .padding(10)
                            .background(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                            .foregroundColor(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
                            .popover(isPresented:$detailedView){
                                ZStack{
                                    Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274)
                                    VStack{
                                        HStack{
                                            Button(action:{
                                                detailedView = false
                                            }){
//                                               Image("exit")
                                            }
                                            Spacer()
                                            
                                        }
                                        Text("Alicia’s Trip to Trader Joes")
                                            .font(.largeTitle
                                                .weight(.bold))
                                        Text("Your Items")
                                            .fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
                                            .padding(.top, 10)
                                        Text("Bananas")
                                        Text("Oranges")
                                        Text("Belvita crackers")
                                        Text("Pickup Location")
                                            .fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
                                            .padding(.top, 10)
                                        Text("McIver Residence Hall 103 Raleigh St. Chapel Hill, NC 27514")
                                            .frame(maxWidth: 250)
                                        Text("Pickup Time")
                                            .fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
                                            .padding(.top, 10)
                                        Text("Today at 5:00 pm")
                                        Spacer()
                                    }.padding()
                                        .foregroundStyle(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                                }
                            }
                        Spacer()
                        Button(action: {}){
                        Text("Join Cart")
                                .padding(10)
                        }
                        .background(Color(red: 0.2980392156862745, green: 0.33725490196078434, blue: 0.2235294117647059))
                        .accentColor(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
                    }.padding()
                    }
                    .background(Color(red: 1, green: 0.9725490196078431, blue: 0.9098039215686274))
                    .frame(maxWidth:300)
                    .cornerRadius(15)
                    Spacer()
                }
        }
    }
}
                         
struct browse_Previews: PreviewProvider {
    static var previews: some View {
        browse()
    }
}


```

[2 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]