summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-07-14 20:35:00 +0300
committerDawid Rycerz <dawid@rycerz.xyz>2025-07-14 20:35:00 +0300
commit1c2873b3059f3e4d6bd02307ec5b22f761ce1c80 (patch)
treede196a57b76fcacbbc842bbb5bf2641c8f82be91 /README.md
parent50ce8cb96b2b218751c2fc2a6b19372f51846acc (diff)
feat: Update routes and fix issues
Diffstat (limited to 'README.md')
-rw-r--r--README.md49
1 files changed, 48 insertions, 1 deletions
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 <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: