This server is built with [FastAPI](https://fastapi.tiangolo.com/) and provides a comprehensive API for multiple services. The interactive API documentation is available at the [Swagger UI](https://api.codey.lol/docs).
## API Endpoints
### Authentication (`/auth/`) 🔐
-`POST /auth/login` - User authentication with username/password (OAuth2 form data)
-`POST /auth/refresh` - Refresh access tokens using refresh token from cookies
-`GET /auth/id` - Get current user information (requires authentication)
### Lighting Control (`/lighting/`) 💡
-`GET /lighting/state` - Get current lighting state from Redis cache
-`POST /lighting/state` - Set lighting state and control GE Cync smart lights
- Supports power on/off, brightness (0-100), and RGB color control
- Directly interfaces with Cync cloud API for real-time device control
- Requires authentication
### Radio & Streaming (`/radio/`) 📻
**Public Endpoints:**
-`POST /radio/np` - Get currently playing track information (by station: main, rock, rap, electronic, pop)
-`POST /radio/typeahead` - Search typeahead for song/artist suggestions
-`POST /radio/get_queue` - Get current play queue (paged, 20 results per page)
-`GET /radio/album_art` - Get album art for current or specified track
**Authenticated Endpoints:**
-`POST /radio/request` - Submit song requests to radio stations
-`POST /radio/skip` - Skip to next track or specific UUID in queue
-`POST /radio/queue_shift` - Reorder items in the play queue
-`POST /radio/reshuffle` - Reshuffle the entire play queue
-`POST /radio/queue_remove` - Remove specific items from queue
-`POST /radio/ls._next_` - Get next track (for Liquidsoap integration)