PHPackages                             clarion-app/weather-backend - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. clarion-app/weather-backend

ActiveLibrary[API Development](/categories/api)

clarion-app/weather-backend
===========================

Fetchs and store weather data. Provides endpoints for frontend weather app.

02PHP

Since Mar 8Pushed 2mo agoCompare

[ Source](https://github.com/clarion-app/weather-backend)[ Packagist](https://packagist.org/packages/clarion-app/weather-backend)[ RSS](/packages/clarion-app-weather-backend/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

clarion-app/weather-backend
===========================

[](#clarion-appweather-backend)

A Laravel package that fetches and stores weather data, providing comprehensive weather forecasting endpoints for frontend applications. This backend integrates with weather APIs (like OpenWeatherMap) to deliver current conditions, forecasts, alerts, and minutely precipitation data.

Features
--------

[](#features)

- **Multi-Location Support**: Manage multiple weather locations with favorites and active status
- **Comprehensive Weather Data**: Current, hourly, daily, and historical weather information
- **Weather Alerts**: Store and manage weather alerts with severity levels and acknowledgment
- **Minutely Precipitation**: Detailed precipitation forecasts for the next hour
- **Geocoding Integration**: Location search and creation from coordinates
- **Multiple Weather APIs**: Support for multiple weather service providers
- **Data Cleanup**: Automated cleanup of old weather data
- **Background Jobs**: Asynchronous weather data updates via Laravel queues
- **REST API**: Full RESTful API with authentication

Database Schema
---------------

[](#database-schema)

The package creates the following database tables:

- **weather\_apis**: Configuration for weather service providers
- **weather\_locations**: Geographic locations for weather monitoring
- **weather\_data**: Current, hourly, daily, and historical weather data
- **weather\_alerts**: Weather warnings and alerts
- **weather\_minutely**: Minute-by-minute precipitation forecasts

API Endpoints
-------------

[](#api-endpoints)

### Weather APIs Management

[](#weather-apis-management)

- `GET /weather-apis` - List all weather APIs
- `POST /weather-apis` - Create new weather API configuration
- `GET /weather-apis/{id}` - Get specific weather API
- `PUT /weather-apis/{id}` - Update weather API configuration
- `DELETE /weather-apis/{id}` - Delete weather API
- `PATCH /weather-apis/{id}/activate` - Activate weather API
- `PATCH /weather-apis/{id}/deactivate` - Deactivate weather API
- `GET /weather-apis/active` - Get active weather APIs

### Location Management

[](#location-management)

- `GET /locations` - List all locations
- `POST /locations` - Create new location
- `GET /locations/{id}` - Get specific location
- `PUT /locations/{id}` - Update location
- `DELETE /locations/{id}` - Delete location
- `GET /locations/active` - Get active locations
- `GET /locations/favorites` - Get favorite locations
- `GET /locations/nearby` - Find nearby locations
- `GET /locations/search-geocode` - Search locations by geocoding
- `POST /locations/from-geocode` - Create location from geocode data
- `PATCH /locations/{id}/activate` - Activate location
- `PATCH /locations/{id}/deactivate` - Deactivate location
- `PATCH /locations/{id}/favorite` - Add location to favorites
- `DELETE /locations/{id}/favorite` - Remove location from favorites

### Weather Data

[](#weather-data)

- `GET /weather-data` - List all weather data
- `POST /weather-data` - Create weather data entry
- `GET /weather-data/{id}` - Get specific weather data
- `PUT /weather-data/{id}` - Update weather data
- `DELETE /weather-data/{id}` - Delete weather data
- `GET /weather-data/{locationId}/current` - Get current weather for location
- `GET /weather-data/{locationId}/hourly` - Get hourly forecast for location
- `GET /weather-data/{locationId}/daily` - Get daily forecast for location
- `GET /weather-data/{locationId}/historical` - Get historical data for location
- `POST /weather-data/cleanup` - Clean up old weather data

### Weather Alerts

[](#weather-alerts)

- `GET /weather-alerts` - List all weather alerts
- `POST /weather-alerts` - Create weather alert
- `GET /weather-alerts/{id}` - Get specific weather alert
- `PUT /weather-alerts/{id}` - Update weather alert
- `DELETE /weather-alerts/{id}` - Delete weather alert
- `GET /weather-alerts/{locationId}/active` - Get active alerts for location
- `GET /weather-alerts/statistics` - Get alert statistics
- `GET /weather-alerts/severity/{severity}` - Get alerts by severity
- `PATCH /weather-alerts/{id}/acknowledge` - Acknowledge alert
- `PATCH /weather-alerts/{id}/resolve` - Resolve alert
- `POST /weather-alerts/cleanup` - Clean up old alerts

### Minutely Precipitation

[](#minutely-precipitation)

- `GET /weather-minutely` - List minutely data
- `POST /weather-minutely` - Create minutely data
- `GET /weather-minutely/{id}` - Get specific minutely data
- `PUT /weather-minutely/{id}` - Update minutely data
- `DELETE /weather-minutely/{id}` - Delete minutely data
- `GET /weather-minutely/{locationId}/next-hour` - Get next hour precipitation
- `GET /weather-minutely/{locationId}/precipitation` - Get precipitation data
- `GET /weather-minutely/{locationId}/recent` - Get recent minutely data
- `POST /weather-minutely/bulk` - Bulk create minutely data
- `POST /weather-minutely/cleanup` - Clean up old minutely data

### OpenWeatherMap Integration

[](#openweathermap-integration)

- `POST /openweathermap/fetch-current` - Fetch current weather from OpenWeatherMap
- `POST /openweathermap/fetch-complete` - Fetch complete weather data
- `POST /openweathermap/fetch-historical` - Fetch historical weather data

Commands
--------

[](#commands)

### Weather Update Command

[](#weather-update-command)

Update weather data for all active locations:

```
php artisan weather:update
```

This command dispatches a job to update weather data asynchronously via Laravel's queue system.

Configuration
-------------

[](#configuration)

The package integrates with the Clarion framework and includes custom prompts for AI-assisted operations:

- **Choose Operations**: Guides users to first get location IDs, then fetch weather data
- **Generate API Calls**: Provides context for proper API parameter usage

Models
------

[](#models)

- **WeatherApi**: Weather service provider configurations
- **WeatherLocation**: Geographic locations with coordinates and metadata
- **WeatherData**: Weather measurements and forecasts
- **WeatherAlert**: Weather warnings and notifications
- **WeatherMinutely**: Minute-by-minute precipitation data

Jobs
----

[](#jobs)

- **WeatherDataUpdate**: Background job for updating weather data from external APIs

Authentication
--------------

[](#authentication)

All API endpoints require authentication via Laravel's `auth:api` middleware.

Units Support
-------------

[](#units-support)

The package supports different unit systems for temperature, wind speed, and other measurements, configurable per location.

Data Retention
--------------

[](#data-retention)

The package includes cleanup functionality to manage data retention and prevent database bloat from historical weather data.

License
-------

[](#license)

MIT License

Author
------

[](#author)

Tim Schwartz ()

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance58

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/544de7b46960eb87f0f60bc59cb8bd4dccd2679622adf0c8ed82b75df9f65685?d=identicon)[timschwartz](/maintainers/timschwartz)

---

Top Contributors

[![timschwartz](https://avatars.githubusercontent.com/u/13080528?v=4)](https://github.com/timschwartz "timschwartz (4 commits)")

### Embed Badge

![Health badge](/badges/clarion-app-weather-backend/health.svg)

```
[![Health](https://phpackages.com/badges/clarion-app-weather-backend/health.svg)](https://phpackages.com/packages/clarion-app-weather-backend)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
