As an avid kayaker and developer, I’m always looking for ways to combine my passions. That’s why I created the Kayak Trip Tracker, a very simple Streamlit application to help me organize and visualize my kayak camping trips.
In this post, I’ll walk you through the features of the app and how you can run it on your own machine using Docker.
The Kayak Trip Tracker is designed to be a one-stop shop for all my kayak trip planning needs. Here are some of the key features:
folium library to create the map, which allows for easy zooming, panning, and even measuring distances.The app is built with Python and the Streamlit library. Here’s a quick overview of the code:
The app.py file is the heart of the application. It uses Streamlit to create the user interface and folium to generate the map. The app connects to a SQLite database to fetch and store trip data.
Here’s a snippet of the code that creates the map:
# Create map
# Recalculate center based on selected trip
if river_path:
avg_lat = sum(p[0] for p in river_path) / len(river_path)
avg_lon = sum(p[1] for p in river_path) / len(river_path)
map_center = [avg_lat, avg_lon]
else:
map_center = [30.28, -82.92] # Default center
suwannee_map = folium.Map(location=map_center, zoom_start=10, tiles="OpenStreetMap")
# Add markers
for p in points:
folium.Marker(
location=p["coords"],
popup=p["name"],
tooltip=p["name"],
icon=folium.Icon(color=p["color"], icon=p["icon"], prefix="fa"),
).add_to(suwannee_map)
# Add River Route (PolyLine)
if river_path:
folium.PolyLine(
river_path,
color="#00FFFF",
weight=6,
opacity=0.9,
popup=f"{selected_trip_name} Route",
).add_to(suwannee_map)
The database.py file contains all the functions for interacting with the SQLite database. It includes functions for creating the database tables, adding new trips, and fetching trip data.
The easiest way to run the Kayak Trip Tracker is with Docker. I’ve included a docker-compose.yml file that makes it easy to build and run the app in a container.
docker-compose build
docker-compose up
Once the container is running, you can access the app in your web browser at http://localhost:8501.
This project was such a fun way to blend my love for kayaking and outdoors with my passion for coding. I’m really looking forward to using the Water Trail app to plan future adventures, and I hope it inspires you to build your own creative projects with Streamlit!