- Go to https://supabase.com and sign in (or create an account)
- Click "New Project"
- Fill in:
- Name: weather-mapper (or your preferred name)
- Database Password: Choose a strong password (save this!)
- Region: Choose closest to you
- Click "Create new project"
- Once your project is created, go to the SQL Editor in the left sidebar
- Click "New query"
- Copy and paste the entire contents of
backend/migrations/001_initial_schema.sql - Click "Run" (or press Cmd/Ctrl + Enter)
- You should see "Success. No rows returned"
- Go to Settings → API in the left sidebar
- Copy the following values:
- Project URL (this is your
SUPABASE_URL) - anon/public key (this is your
SUPABASE_ANON_KEY)
- Project URL (this is your
-
Copy
.env.exampleto.env:cd backend cp .env.example .env -
Edit
.envand replace the placeholder values:SUPABASE_URL=https://your-project-id.supabase.co SUPABASE_ANON_KEY=your-anon-key-here
- Restart your backend server if it's running
- Check the backend logs - it should connect successfully
- Test the API:
curl http://localhost:3000/health
The migration creates:
weather_spotstable - stores city/location dataweather_recordstable - stores historical weather data- Indexes for performance
- Trigger for automatic
updated_attimestamp
- Connection errors: Double-check your SUPABASE_URL and SUPABASE_ANON_KEY
- Migration errors: Make sure you're running the SQL in the Supabase SQL Editor
- Permission errors: Ensure you're using the
anonkey, not theservice_rolekey