Skip to content

halilatilla/weather-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

31 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Weather App ๐ŸŽฎโ›ˆ๏ธ

A retro 90s-themed weather application built with Next.js, TypeScript, and styled-components. This app brings back the nostalgia of Windows 95 era computing while providing real-time weather information โ€” now featuring an AI-powered weather announcer, multiple retro themes, and animated weather effects!

CleanShot 2025-12-14 at 21 50 08

Features

๐ŸŒค๏ธ Core Weather Features

  • ๐Ÿ” City Search - Search for weather by city name with URL-based sharing
  • ๐ŸŒก๏ธ Current Weather - Hero temperature display with toggle between ยฐC/ยฐF
  • ๐Ÿ“Š Weather Stats - Humidity, wind speed, sunrise time, visibility, and more
  • ๐Ÿ“… 5-Day Forecast - Interactive floppy disk cards with detailed popups
  • ๐ŸŽจ Animated Weather Effects - Dynamic backgrounds and particle effects based on conditions
    • โ˜” Rain animations for rainy weather
    • โ„๏ธ Snowflakes for snowy conditions
    • โ›ˆ๏ธ Lightning flashes for thunderstorms
    • โ˜๏ธ Floating clouds for cloudy skies
    • ๐ŸŒซ๏ธ Fog effects for misty weather
    • โ˜€๏ธ Sun rays for clear skies

๐Ÿค– AI-Powered Features

  • AI Weather Announcer "Chip" - Your friendly 90s-style TV weather presenter
    • ๐Ÿ“บ Lives in a retro CRT TV studio with scanlines and studio lights
    • ๐Ÿ’ฌ AI-Generated Weather Reports - Automatic initial reports when weather loads
    • ๐Ÿ—ฃ๏ธ Interactive Chat - Ask Chip anything about the weather!
    • ๐ŸŽฏ Uses GPT-4o-mini for smart, contextual responses
    • โšก Rate-limited to 10 requests/minute and 20 requests/day per user (configurable)
    • ๐Ÿ“ฑ Minimizable widget that stays out of your way
    • ๐ŸŽญ Animated pixel-art character with mouth movements
    • ๐Ÿ’พ Static fallback messages when AI is unavailable

๐ŸŽจ Retro Theme System

  • 4 Authentic Retro Themes with theme switcher:
    • ๐ŸชŸ Windows 95 (Default) - Classic gray interface with neon accents
    • ๐Ÿ’พ Windows 98 - Blue gradient title bars and softer colors
    • ๐ŸŽ Mac OS 9 - Platinum gray with purple accents
    • ๐Ÿ’ป MS-DOS - Green-on-black terminal aesthetic with CRT effects
  • Theme Persistence - Your theme choice is saved in localStorage
  • Dynamic CSS Variables - All components adapt to the selected theme
  • Theme-Aware Components - Buttons, inputs, and UI elements match each theme

๐ŸŽฏ UI/UX Features

  • ๐Ÿ“ฑ Fully Responsive - Works beautifully on mobile, tablet, and desktop
  • ๐ŸŽจ Hero Temperature Display - Large, glowing temperature as the centerpiece
  • ๐Ÿ“ Retro Forecast Cards - Floppy disk-styled cards with click-to-expand details
  • ๐ŸŽฌ Smooth Animations - Retro-style transitions and effects
  • โ™ฟ WCAG AA Compliant - High contrast ratios for accessibility
  • ๐Ÿ”— URL-Based Search - Shareable weather links via query parameters
  • โšก Fast Loading - SWR caching for instant data updates

Meet Chip Forecast ๐ŸŽ™๏ธ

Chip is your friendly 90s-style TV weather announcer! This pixel-art character:

  • ๐Ÿ“บ Lives in a retro CRT TV studio with scanlines and studio lights
  • ๐Ÿ’ฌ Announces weather updates with a typewriter effect
  • ๐Ÿค– AI-Powered Chat - Ask Chip anything about the weather!
  • ๐ŸŽฏ Uses GPT-4o-mini for smart, contextual responses
  • โšก Rate-limited to 10 requests/minute and 100 requests/day per user (configurable)
  • ๐Ÿ“ฑ Minimizable widget that stays out of your way
  • ๐ŸŽญ Animated expressions and mouth movements
  • ๐Ÿ“ฐ Live news ticker with weather updates

AI Features

  • Initial Weather Reports - Chip automatically generates a fun, personalized weather report when you search for a city
  • Interactive Chat - Ask questions like "Should I bring an umbrella?" or "What's the best time to go outside?"
  • 90s Personality - Uses retro slang ("radical", "totally", "awesome") and makes weather puns
  • Smart Fallbacks - Static messages when AI is unavailable (rate limits, network issues, etc.)

90s Retro Aesthetic

This app features an authentic 90s aesthetic including:

  • Windows 95-style UI - Classic title bar ("WEATHER.EXE"), sharp borders, and 3D box shadows
  • CRT Scanlines - Horizontal scanline overlay for that authentic CRT monitor feel
  • Pixel Fonts - "Press Start 2P" and "VT323" fonts throughout for retro gaming vibes
  • Neon Color Palette - Cyan, magenta, neon green, teal, and purple accents
  • Retro Interactions - Button hover/active states with classic depth effects
  • TV Studio Widget - Pixel-art news anchor with animated expressions
  • Floppy Disk Forecast - 5-day forecast displayed as retro floppy disk cards
  • Marquee Ticker - Scrolling text ticker with weather updates

Technologies Used

Frontend

  • Next.js 14 (App Router)
  • TypeScript
  • React 18
  • Styled-components 6
  • SWR (for data fetching and caching)
  • Lucide React (icons)

Backend & APIs

  • Next.js API Routes
  • OpenWeatherMap API (weather data)
  • OpenAI GPT-4o-mini (AI chat and reports)
  • Upstash Redis (rate limiting)

Fonts

  • Press Start 2P (Google Fonts) - Primary pixel font
  • VT323 (Google Fonts) - Secondary monospace font

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js (v18 or later)
  • npm, yarn, or pnpm
  • An OpenWeatherMap API key (Get one here)
  • An OpenAI API key (Get one here) - Optional but recommended for AI features
  • Upstash Redis credentials (optional, for production rate limiting) - Get one here

Installation

  1. Clone the repository:

    git clone https://github.com/halilatilla/weather-app-styled.git
    cd weather-app-styled
  2. Install the dependencies:

    npm install
    # or
    yarn install
    # or
    pnpm install
  3. Create a .env.local file in the root directory and add your API keys:

    OPENWEATHERMAP_API_KEY=your_openweathermap_api_key_here
    OPENAI_API_KEY=your_openai_api_key_here
    UPSTASH_REDIS_REST_URL=your_upstash_redis_url_here
    UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_token_here
    DAILY_API_LIMIT=20

    Note:

    • OPENWEATHERMAP_API_KEY is required for weather data
    • OPENAI_API_KEY is optional but recommended for AI features (Chip will use static messages if not provided)
    • UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN are optional - without them, the app uses in-memory rate limiting (suitable for development)
    • DAILY_API_LIMIT is optional - sets the daily API request limit per user (default: 20 requests/day)

Usage

Development

To run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

Production

To build the app for production:

npm run build
npm start

Project Structure

weather-app-styled/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ api/              # API routes
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chat/         # AI chat endpoint
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ forecast/     # 5-day forecast endpoint
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ weather/      # Current weather endpoint
โ”‚   โ”‚   โ”œโ”€โ”€ components/       # React components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Forecast/     # 5-day forecast component
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ThemeSwitcher/ # Theme selector
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Weather/      # Main weather display
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ WeatherAnnouncer/ # Chip AI announcer
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ WeatherEffects/ # Animated weather effects
โ”‚   โ”‚   โ”œโ”€โ”€ context/          # React Context (Theme)
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/            # Custom React hooks
โ”‚   โ”‚   โ”œโ”€โ”€ styles/           # Theme configurations
โ”‚   โ”‚   โ””โ”€โ”€ ui/               # Reusable UI components
โ”‚   โ””โ”€โ”€ lib/                  # Utility functions
โ”œโ”€โ”€ public/                    # Static assets
โ””โ”€โ”€ package.json

Theme Customization

The app includes 4 pre-configured retro themes. Themes are defined in src/app/styles/themes.ts and can be customized by modifying:

  • Color palettes (primary, secondary, backgrounds, borders, etc.)
  • Typography (fonts)
  • Effects (scanlines, CRT flicker, shadows)
  • Window styling

Themes are managed via React Context and CSS custom properties (variables), making it easy to add new themes or customize existing ones.

AI Chat Feature

The AI chat feature uses OpenAI's GPT-4o-mini model to provide contextual weather responses. Chip's personality is that of a fun, enthusiastic 90s TV weather announcer who:

  • Uses 90s slang ("radical", "totally", "awesome", "gnarly")
  • Gives practical weather advice (what to wear, activities to do)
  • Makes weather puns and jokes
  • Keeps responses short for the speech bubble UI (150-200 characters)
  • Provides detailed initial weather reports (180-220 characters)

Rate Limiting

  • Per-Minute Limit: 10 requests per minute per IP (sliding window)
  • Daily Limit: 20 requests per day per IP (configurable via DAILY_API_LIMIT env variable)
  • Production: Uses Upstash Redis with sliding windows for both limits
  • Development: Falls back to in-memory rate limiting if Redis is not configured
  • Fallback: Static messages when AI is unavailable or rate-limited
  • Headers: Response includes X-RateLimit-Remaining (per-minute) and X-RateLimit-Daily-Remaining (daily) headers

Accessibility

The app is designed with accessibility in mind:

  • โœ… WCAG AA Compliant - All text meets minimum contrast ratios (4.5:1 for normal text, 3:1 for large text)
  • โœ… High Contrast Mode - Bright colors with text shadows for readability
  • โœ… Keyboard Navigation - Full keyboard support for all interactive elements
  • โœ… Screen Reader Friendly - Semantic HTML and ARIA labels where needed

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is open source and available under the MIT License.


Built with ๐Ÿ’พ and nostalgia

About

๐ŸŽฎ A nostalgic 90s-themed weather app with Windows 95 aesthetics, CRT scanlines, pixel fonts, and neon colors. Built with Next.js, TypeScript & styled-components.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors