Quickstart Guide
Get SkyCast IA displaying weather data in under 5 minutes. This guide will take you from zero to a working weather application with minimal setup.This quickstart assumes you have Node.js (v20+) and npm installed. For detailed installation instructions, see the Installation page.
Prerequisites
Before starting, obtain these free API keys:- OpenWeatherMap API Key - Sign up here
- Groq API Key - Get one here
NEXT_PUBLIC_OPENWEATHER_API_KEY=your_openweather_api_key_here
GROQ_API_KEY=your_groq_api_key_here
RECAPTCHA_SECRET_KEY=your_recaptcha_secret_here
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=your_recaptcha_site_key_here
NEXT_PUBLIC_ prefix is required for client-side environment variables. Keys without this prefix are only available on the server.
Open http://localhost:3000 in your browser. The app will automatically request your location and display weather data.
Your First Weather Display
Once the dev server is running, SkyCast IA will:- Request browser geolocation permission
- Fetch current weather for your location
- Display AI-generated weather analysis
- Show hourly forecast and interactive map
Understanding the Main Dashboard
The main page (src/app/page.tsx) orchestrates all weather features:
src/app/page.tsx
Fetching Weather Data
The weather API client (src/lib/api/weather.ts) provides three core functions:
Get Current Weather by Coordinates
Get Weather by City Name
Get Hourly Forecast
All temperature values are in Celsius by default. The API calls include
units=metric and lang=es parameters.Displaying Weather with Components
Use pre-built components to display weather data:Main Weather Card
- City name and country
- Local time
- Large temperature display with weather icon
- AI-generated analysis box
- Dynamic styling based on weather conditions
Forecast Card
Weather Stats
- Humidity percentage
- Wind speed
- Atmospheric pressure
- Feels-like temperature
Adding AI Analysis
The AI analysis feature uses Groq’s Llama 3.1 model to generate weather insights:src/lib/api/mistral.ts
- City name
- Temperature and humidity
- Wind speed
- Weather description
View the AI prompt configuration
View the AI prompt configuration
Testing Location Detection
TheuseLocation hook handles geolocation:
src/hooks/useLocation.ts
- Automatic location request on mount
- 15-second timeout for GPS acquisition
- Manual refresh function for retry
- Detailed error messages for permission issues
Common Quickstart Issues
Location permission denied
Location permission denied
If the browser denies location access:
- Click the lock icon in the browser address bar
- Set location permission to “Allow”
- Refresh the page or click “Mi Ubicación” button
- Alternatively, use the search bar to manually enter a city
API key errors
API key errors
If you see “Falta la API Key” or fetch errors:
- Verify
.env.localfile exists in root directory - Check variable names match exactly (case-sensitive)
- Restart the dev server after adding environment variables
- Ensure OpenWeatherMap key is activated (can take 10 minutes)
Map not loading
Map not loading
The WeatherMap component uses dynamic import to prevent SSR issues:If the map doesn’t load, check browser console for Leaflet errors.
Next Steps
Now that you have SkyCast IA running:- Explore Components: Check
src/components/ui/for all available components - Customize Themes: Modify weather-based color schemes in
src/app/page.tsx - Add Features: Integrate the AI chat component for conversational weather queries
- Deploy: See the Installation guide for production deployment
The app includes a beautiful animated footer with mountains, trees, and flying birds. Explore
page.tsx to see the SVG implementation.