Weather simulation service for the fictional Principality of Eulenthal.
- PHP 8.1+
- SQLite3 extension
- Composer (for autoloading)
composer install- Copy the example environment file:
cp .env.example .env- Set secure values in
.env(or in Coolify environment variables):
ADMIN_PASSWORD- required for/admin/loginCRON_SECRET- required for/cron.phpSESSION_SECRET- session secretAPP_DEBUG-falsein productionAPP_TIMEZONE- e.g.Europe/VaduzDB_PATH- optional SQLite path override
The SQLite database is stored at database/clauswetter.db.
Initialize the database:
sqlite3 database/clauswetter.db < database/schema.sqlphp -S localhost:3000Point your web server's document root to the project root.
Apache: The included .htaccess handles routing.
Nginx example:
location /api {
try_files $uri $uri/ /index.php?$query_string;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}Set up a daily cron job to generate weather data:
0 0 * * * curl "https://your-domain.com/cron.php?secret=YOUR_CRON_SECRET"| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health | Health check |
| GET | /api/regions | List all regions |
| GET | /api/regions/{id} | Get region details |
| GET | /api/stations | List all stations |
| GET | /api/stations/with-weather | Stations with current weather |
| GET | /api/stations/{id} | Get station details |
| GET | /api/stations/{id}/weather | Current weather for station |
| GET | /api/stations/{id}/day-hours | Hourly data for a day |
| GET | /api/forecast/{stationId} | 7-day forecast |
| POST | /api/weather/generate | Generate weather now |
| POST | /api/weather/generate-7days | Generate 7 days of data |
| GET | /api/map/config | Map configuration |