Create a .env file in the root directory:
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key-here
VITE_SUPABASE_PUBLISHABLE_KEY=your-anon-key-herenpm install-
Install Supabase CLI:
npm install -g supabase
-
Login to Supabase:
supabase login
-
Link your project:
supabase link --project-ref your-project-id
-
Push database changes:
supabase db push
-
Deploy edge functions:
supabase functions deploy get-nasa-weather
- Go to your Supabase dashboard
- Run the SQL from
supabase/migrations/20240101000000_create_saved_locations.sql - Create a new edge function called
get-nasa-weather - Copy the code from
supabase/functions/get-nasa-weather/index.ts
npm run dev- Open http://localhost:5173
- Search for a location (e.g., "New York")
- Select a date and click "Get Weather Data"
- Sign up/in to save favorite locations
- CORS Errors: Make sure your Supabase URL and keys are correct
- NASA API Timeout: The NASA API can be slow; wait a few seconds
- Location Search Not Working: Check your internet connection
- Database Errors: Ensure RLS policies are properly set up
Double-check your .env file has the correct Supabase credentials:
- URL should start with
https://and end with.supabase.co - Keys should be long alphanumeric strings
If the weather data isn't loading:
- Check the edge function is deployed
- Verify the function URL in the dashboard
- Check the function logs for errors
- Customize the UI colors and styling
- Add more weather parameters
- Implement weather alerts
- Add data export functionality
- Create weather comparison features