From 1c2873b3059f3e4d6bd02307ec5b22f761ce1c80 Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Mon, 14 Jul 2025 20:35:00 +0300 Subject: feat: Update routes and fix issues --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 8d47613..3910fc4 100644 --- a/README.md +++ b/README.md @@ -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 +``` + +### 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: -- cgit v1.2.3