Skip to content

singhaditya21/CLIMAAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ClimaAI - AI-Powered Weather Application

ClimaAI Logo

A complete, production-ready, subscription-based AI weather application for iOS and Android with intelligent weather insights powered by OpenAI.

🌟 Features

Free Tier

  • βœ… Current temperature & conditions
  • βœ… Today's hourly forecast (24 hours)
  • βœ… 7-day daily forecast
  • βœ… Sunrise / sunset times
  • βœ… Basic wind & precipitation
  • βœ… Location auto-detect
  • βœ… Light/Dark mode

Premium Features (πŸ’Ž $4.99/month or $39.99/year)

  • 🌩 Advanced Forecasting

    • 16-day weather forecast
    • Minute-level rain prediction
    • Severe weather alerts
    • Storm tracking
  • 🧠 AI Weather Intelligence

    • "What should I wear today?" outfit recommendations
    • Travel weather risk analysis
    • Outdoor activity recommendations with best times
    • Health insights (heat stress, pollen risk, air quality impact)
    • AI daily weather summary in natural language
  • 🌬 Environment & Health

    • Air Quality Index (AQI) with detailed breakdown
    • UV exposure risk analysis
    • Pollution component breakdown (PM2.5, PM10, NOβ‚‚, O₃, etc.)
    • Weather impact on asthma/allergies
  • 🧳 Lifestyle & Planning

    • Best time to go outside
    • Best time to exercise
    • Farming/weather advisory (rainfall, humidity)
    • Marine & beach weather (coastal locations)

πŸ—οΈ Architecture

clima-ai/
β”œβ”€β”€ backend/                    # Backend services
β”‚   β”œβ”€β”€ api/                   # FastAPI main service
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ models/        # SQLAlchemy models
β”‚   β”‚   β”‚   β”œβ”€β”€ routers/       # API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ services/      # Business logic
β”‚   β”‚   β”‚   └── schemas/       # Pydantic schemas
β”‚   β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”‚   └── requirements.txt
β”‚   β”œβ”€β”€ payment-service/       # Node.js payment webhooks
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ routes/        # Apple & Google webhooks
β”‚   β”‚   β”‚   └── index.js
β”‚   β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”‚   └── package.json
β”‚   β”œβ”€β”€ docker-compose.yml     # Full stack orchestration
β”‚   └── init.sql              # Database schema
β”œβ”€β”€ android/                   # Android Jetpack Compose app
β”œβ”€β”€ ios/                       # iOS SwiftUI app
└── docs/                      # Documentation

πŸš€ Quick Start

Prerequisites

  • Backend:

    • Docker & Docker Compose
    • Python 3.11+
    • Node.js 18+
    • PostgreSQL 15+
    • Redis 7+
  • Mobile:

    • iOS: Xcode 15+, Swift 5.9+
    • Android: Android Studio, Kotlin 1.9+
  • API Keys:

    • OpenAI API key (for AI insights)
    • Apple Developer Account (for iOS)
    • Google Play Developer Account (for Android)

Backend Setup

  1. Clone the repository:
git clone <repository-url>
cd clima-ai/backend
  1. Configure environment:
cd api
cp .env.example .env
# Edit .env with your OpenAI API key and other settings
  1. Start all services:
cd ..
docker-compose up -d
  1. Verify services:
# API health check
curl http://localhost:8000/health

# Payment service health check
curl http://localhost:3000/health
  1. Access API documentation:

iOS Setup

  1. Navigate to iOS project:
cd ios
  1. Open in Xcode:
open ClimaAI.xcodeproj
  1. Configure:
  • Update Bundle Identifier in project settings
  • Configure StoreKit products in App Store Connect
  • Update product IDs in SubscriptionManager.swift
  • Add required capabilities: Location, In-App Purchase
  1. Run on simulator or device

Android Setup

  1. Navigate to Android project:
cd android
  1. Open in Android Studio:
studio .
  1. Configure:
  • Update applicationId in build.gradle
  • Configure Google Play Billing products
  • Update product IDs in billing configuration
  • Add required permissions in AndroidManifest.xml
  1. Run on emulator or device

πŸ”§ Configuration

Backend Environment Variables

# Database
DATABASE_URL=postgresql+asyncpg://climaai:password@postgres:5432/climaai

# Redis
REDIS_URL=redis://redis:6379/0

# OpenAI
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4-turbo-preview

# JWT
JWT_SECRET=your-super-secret-key-min-32-chars

# App IDs
APPLE_BUNDLE_ID=com.climaai.app
GOOGLE_PACKAGE_NAME=com.climaai.app

iOS Configuration

Update the following in Xcode:

  1. Bundle Identifier: com.yourcompany.climaai
  2. Team: Your Apple Developer Team
  3. Product IDs:
    • Monthly: com.yourcompany.climaai.monthly
    • Annual: com.yourcompany.climaai.annual

Android Configuration

Update in build.gradle:

applicationId "com.yourcompany.climaai"

Update product IDs in billing configuration to match Google Play Console.

πŸ“‘ API Endpoints

Weather (Public)

  • GET /weather/current - Current weather
  • GET /weather/hourly - Hourly forecast
  • GET /weather/daily - Daily forecast
  • GET /weather/air-quality - Air quality data

AI Insights (Premium)

  • GET /ai/insights - Complete AI insights
  • GET /ai/summary - Daily summary
  • GET /ai/outfit - Outfit recommendation
  • GET /ai/activities - Activity suggestions
  • GET /ai/health - Health insights

User Management

  • POST /users/register - Register new user
  • POST /users/login - Login
  • GET /users/me - Get current user
  • PUT /users/me - Update user

Subscriptions

  • GET /subscriptions/status - Check subscription
  • POST /subscriptions/trial - Start 7-day trial
  • POST /subscriptions/activate - Activate subscription
  • GET /subscriptions/plans - Get available plans

πŸ“± Mobile Features

iOS (SwiftUI)

  • Native SwiftUI interface
  • StoreKit 2 integration
  • CoreLocation for geolocation
  • Offline caching
  • Background weather updates
  • Push notifications support
  • Dark mode support
  • Accessibility (VoiceOver, Dynamic Type)

Android (Jetpack Compose)

  • Material 3 design
  • Google Play Billing Library 5
  • FusedLocationProvider
  • Room database for caching
  • WorkManager for background updates
  • Firebase Cloud Messaging
  • Dark theme support
  • TalkBack accessibility

πŸ§ͺ Testing

Backend Tests

cd backend/api
pytest tests/ -v

iOS Tests

cd ios
xcodebuild test -scheme ClimaAI -destination 'platform=iOS Simulator,name=iPhone 15'

Android Tests

cd android
./gradlew test
./gradlew connectedAndroidTest

🚒 Deployment

Backend Deployment

Docker Compose (Production):

docker-compose -f docker-compose.prod.yml up -d

Individual Services:

# API
cd backend/api
docker build -t climaai-api .
docker run -p 8000:8000 --env-file .env climaai-api

# Payment Service
cd backend/payment-service
docker build -t climaai-payment .
docker run -p 3000:3000 --env-file .env climaai-payment

Cloud Deployment:

  • AWS: ECS/Fargate, RDS PostgreSQL, ElastiCache Redis
  • Google Cloud: Cloud Run, Cloud SQL, Memorystore
  • Azure: Container Apps, Azure Database, Azure Cache

iOS Deployment

  1. Archive the app:

    • Product β†’ Archive in Xcode
  2. Upload to App Store Connect:

    • Distribute App β†’ App Store Connect
  3. Configure in App Store Connect:

    • App metadata
    • Screenshots
    • Privacy information
    • In-App Purchase products
  4. Submit for review

Android Deployment

  1. Generate signed APK/AAB:
cd android
./gradlew bundleRelease
  1. Upload to Google Play Console:

    • Production track or Internal testing
  2. Configure:

    • Store listing
    • Content rating
    • Pricing & distribution
    • In-app products
  3. Submit for review

πŸ“Š Database Schema

users
β”œβ”€β”€ id (UUID, PK)
β”œβ”€β”€ email (VARCHAR, UNIQUE)
β”œβ”€β”€ password_hash (VARCHAR)
β”œβ”€β”€ full_name (VARCHAR)
β”œβ”€β”€ preferences (JSONB)
└── timestamps

subscriptions
β”œβ”€β”€ id (UUID, PK)
β”œβ”€β”€ user_id (UUID, FK)
β”œβ”€β”€ platform (VARCHAR)
β”œβ”€β”€ plan (VARCHAR)
β”œβ”€β”€ status (VARCHAR)
β”œβ”€β”€ trial_dates
β”œβ”€β”€ subscription_dates
└── platform_specific_ids

πŸ” Security

  • JWT-based authentication
  • Bcrypt password hashing
  • HTTPS only in production
  • Receipt validation (Apple & Google)
  • Rate limiting
  • SQL injection prevention (SQLAlchemy)
  • XSS protection
  • CORS configuration

πŸ“ˆ Monitoring & Analytics

Backend Metrics

  • Request latency
  • Error rates
  • Cache hit rates
  • API usage by endpoint

Mobile Analytics

  • User acquisition
  • Subscription conversion
  • Feature usage
  • Crash reports

Recommended Tools:

  • Backend: Prometheus + Grafana, Sentry
  • Mobile: Firebase Analytics, Crashlytics

πŸ’° Monetization

Subscription Tiers

  • Monthly Premium: $4.99/month
  • Annual Premium: $39.99/year (33% savings)
  • Free Trial: 7 days

Revenue Sharing

  • Apple: 30% for first year, 15% after
  • Google: 15% for subscriptions

πŸ“œ License

Proprietary - All rights reserved

🀝 Contributing

This is a production application. For contributions, please contact the development team.

πŸ“ž Support

πŸ”„ Version History

v1.0.0 (Initial Release)

  • βœ… Complete weather data integration (Open-Meteo)
  • βœ… AI-powered insights (OpenAI GPT-4)
  • βœ… Subscription management (Apple & Google)
  • βœ… iOS & Android apps
  • βœ… 7-day free trial
  • βœ… Offline caching
  • βœ… Background updates

πŸ—ΊοΈ Roadmap

v1.1 (Planned)

  • Weather widgets
  • Apple Watch support
  • Android Wear OS support
  • Multi-location support
  • Weather alerts push notifications

v1.2 (Planned)

  • Historical weather data
  • Weather radar overlay
  • Share weather snapshots
  • Voice assistant integration
  • Weather-based automations

v2.0 (Future)

  • Hyperlocal forecasting
  • AR weather visualization
  • Community weather reports
  • Advanced AI with GPT-5
  • Gamification features

πŸ™ Credits

  • Weather Data: Open-Meteo API
  • AI: OpenAI GPT-4
  • Icons: SF Symbols (iOS), Material Icons (Android)
  • Backend: FastAPI, Express.js
  • Mobile: SwiftUI, Jetpack Compose

Built with ❀️ by the ClimaAI Team

About

CLIMAAI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors