Self-Hosted Strava Weather Integration

Rain or Shine

Automatically add weather data to all your Strava activities. Track temperature, wind, humidity, and conditions for every workout. Self-host for complete control over your data.

View on GitHub

Features

Everything you need to track weather conditions for your activities

Automatic Weather Data
Weather is automatically fetched and added to your activity descriptions when you upload to Strava.
Comprehensive Metrics
Temperature, feels-like temperature, humidity, wind speed and direction, and weather conditions.
Location-Based
Weather data is fetched for the exact location and time of your activity start.
Historical Data
Get weather data for past activities, not just new ones. Perfect for filling in missing data.
Privacy First
Self-host on your own infrastructure. Your data never leaves your control.
Real-Time Updates
Webhook integration means weather is added within seconds of uploading to Strava.

How It Works

Simple, automatic weather tracking for every activity

Upload Activity

Record and upload your activity to Strava as normal

Fetch Weather

Rain or Shine automatically fetches weather for your activity location and time

View Results

Weather data appears in your activity description on Strava

Example Weather Data
This is what gets added to your Strava activity descriptions

Clear sky, 18°C, Feels like 18°C, Humidity 82%, Wind 4.1m/s from W

Getting Started

Set up your personal Rain or Shine instance in about 30 minutes

1

Install Node.js

First, you'll need Node.js version 22 or newer on your computer.

  1. Visit nodejs.org
  2. Download the "LTS" version for your operating system
  3. Run the installer and follow the prompts
  4. Open a terminal and verify installation:
node --version

You should see something like v22.11.0

2

Create a Strava App

You need to register your app with Strava to enable the integration.

  1. Go to Strava API Settings
  2. Click "Create New Application"
  3. Fill in the form:
    • Application Name: Rain or Shine (or your choice)
    • Category: Training
    • Club: Leave blank
    • Website: http://localhost:3001 (for now)
    • Authorization Callback Domain: localhost
    • Description: Personal weather tracking for activities
  4. Agree to the terms and click "Create"
  5. Save your Client ID and Client Secret - you'll need these!
3

Get OpenWeatherMap API Key

This free API provides the weather data for your activities.

  1. Sign up at OpenWeatherMap
  2. Confirm your email address
  3. Go to "API Keys" in your account
  4. Copy your API key (it may take 10-15 minutes to activate)

The free tier includes 1,000 calls per day - more than enough for personal use!

4

Download and Configure the App

Now let's get the Rain or Shine code and set it up.

  1. Open your terminal
  2. Clone the repository:
git clone https://github.com/james-langridge/rain-or-shine.git
cd rain-or-shine
  1. Install dependencies:
npm install
  1. Copy the example environment file:
cp .env.example .env
  1. Open .env in a text editor and fill in your values:
# Your Strava App credentials
STRAVA_CLIENT_ID=your-client-id-here
STRAVA_CLIENT_SECRET=your-client-secret-here
STRAVA_WEBHOOK_VERIFY_TOKEN=make-up-a-random-string-here

# Your OpenWeatherMap API key
OPENWEATHERMAP_API_KEY=your-api-key-here

# Security - make this a random string at least 32 characters
SESSION_SECRET=generate-a-long-random-string-here-use-a-password-generator

# Leave these as-is for local development
NODE_ENV=development
PORT=3001
APP_URL=http://localhost:3001
DATABASE_URL=postgresql://user:password@localhost:5432/rain_or_shine
VITE_API_URL=http://localhost:3001/api
5

Set Up the Database

Rain or Shine needs a PostgreSQL database to store your data.

Option A: Use Docker (Easiest)

If you have Docker installed:

docker run --name rain-or-shine-db \
  -e POSTGRES_USER=user \
  -e POSTGRES_PASSWORD=password \
  -e POSTGRES_DB=rain_or_shine \
  -p 5432:5432 \
  -d postgres:15
Option B: Install PostgreSQL Locally
  1. Download PostgreSQL from postgresql.org
  2. Install it following the wizard
  3. Create a database called rain_or_shine
  4. Update the DATABASE_URL in your .env file with your credentials

Once your database is running, run the migrations:

npm run migrate
6

Start the Application

You're ready to run Rain or Shine!

npm run dev

This starts both the backend server (port 3001) and frontend (port 5173).

Open your browser and go to http://localhost:5173

Click "Connect with Strava" to authorize the app and start using it!

7

Deploy to ProductionOptional

Once you've tested locally, you can deploy to Railway for free hosting.

Railway Deployment (Recommended)
  1. Push your code to GitHub (create a new repository)
  2. Sign up for a free account at Railway
  3. Create a new project and connect your GitHub repository
  4. Add a PostgreSQL database service to your project
  5. Configure environment variables in Railway's dashboard:
    • Copy all values from your .env file
    • Update APP_URL to your Railway URL
    • Update DATABASE_URL to use Railway's database
  6. Deploy! Railway will automatically build and run your app

Alternative deployment options include Heroku, DigitalOcean App Platform, or any VPS with Node.js and PostgreSQL.

Common Issues & Solutions

Strava OAuth Error

Problem: "Invalid redirect URI" or similar OAuth errors

Solution: Make sure your Strava app's callback domain matches your APP_URL. For local development, use "localhost". For production, use your actual domain without "https://".

Weather Data Not Appearing

Problem: Activities don't show weather data

Solution: Check that your OpenWeatherMap API key is active (can take 10-15 minutes after signup). Also ensure the activity has location data - indoor activities won't have weather data.

Database Connection Failed

Problem: Can't connect to PostgreSQL

Solution: Verify your DATABASE_URL is correct and PostgreSQL is running. The format should be: postgresql://username:password@localhost:5432/rain_or_shine

Frequently Asked Questions

Is this free to use?

Yes! The code is open source. You'll only pay for hosting if you choose a paid service. Railway, Heroku, and others offer free tiers perfect for personal use. The OpenWeatherMap free tier (1,000 calls/day) is more than enough for a single user.

Will this work with my Garmin/Wahoo/other device?

Yes! Rain or Shine works with any activity uploaded to Strava, regardless of how it was recorded. As long as the activity has location data, weather will be added.

Can I use this for my club or team?

The current version is designed for single-user personal use. Multi-user support would require Strava API approval. However, each team member could set up their own instance.

Does this modify my original activity data?

No. Weather data is only added to the activity description field. Your original activity data (distance, time, power, heart rate, etc.) remains unchanged.

What about privacy?

When you self-host, all your data stays under your control. The app only communicates with Strava (for activities) and OpenWeatherMap (for weather). No data is sent anywhere else, and there's no analytics or tracking.

Can I customize the weather format?

The app currently supports metric and imperial units. The format is standardized, but since it's open source, you can modify the code to customize how weather appears in your activity descriptions.

Ready to Track Your Weather?

Set up Rain or Shine today and never forget the conditions of your epic (or terrible) weather days.

View Source Code