diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 49 |
1 files changed, 48 insertions, 1 deletions
@@ -1,4 +1,51 @@ -# Silmataivas +# Silmataivas (Rust Rewrite) + +Silmataivas is a weather monitoring service that sends personalized alerts based on user-defined thresholds and notification preferences. This is the Rust rewrite, providing a RESTful API for managing users, locations, weather thresholds, and notification settings. + +## Features +- Weather monitoring using OpenWeatherMap API +- Custom weather thresholds per user +- Flexible notifications: NTFY (push) and SMTP (email) +- User-specific configuration +- RESTful API for all resources +- Automatic OpenAPI documentation at `/docs` + +## API Usage +All API endpoints (except `/health` and `/docs`) require authentication using a Bearer token: + +``` +Authorization: Bearer <user_id> +``` + +### Main Endpoints +- `GET /health` — Health check +- `GET /api/users` — List users +- `POST /api/users` — Create user +- `GET /api/users/:id` — Get user +- `PUT /api/users/:id` — Update user +- `DELETE /api/users/:id` — Delete user +- `GET /api/locations` — List locations +- `POST /api/locations` — Create location +- `GET /api/locations/:id` — Get location +- `PUT /api/locations/:id` — Update location +- `DELETE /api/locations/:id` — Delete location +- `GET /api/weather-thresholds?user_id=...` — List thresholds for user +- `POST /api/weather-thresholds` — Create threshold +- `GET /api/weather-thresholds/:id/:user_id` — Get threshold +- `PUT /api/weather-thresholds/:id/:user_id` — Update threshold +- `DELETE /api/weather-thresholds/:id/:user_id` — Delete threshold +- `GET /api/ntfy-settings/:user_id` — Get NTFY settings +- `POST /api/ntfy-settings` — Create NTFY settings +- `PUT /api/ntfy-settings/:id` — Update NTFY settings +- `DELETE /api/ntfy-settings/:id` — Delete NTFY settings +- `GET /api/smtp-settings/:user_id` — Get SMTP settings +- `POST /api/smtp-settings` — Create SMTP settings +- `PUT /api/smtp-settings/:id` — Update SMTP settings +- `DELETE /api/smtp-settings/:id` — Delete SMTP settings + +For full details and request/response schemas, see the interactive OpenAPI docs at [`/docs`](http://localhost:4000/docs). + +--- To start your Phoenix server: |
