{"id":26475303,"url":"https://github.com/aliwert/sonic-nest","last_synced_at":"2026-04-29T08:34:40.459Z","repository":{"id":277993367,"uuid":"933397526","full_name":"aliwert/sonic-nest","owner":"aliwert","description":"Sonic Nest a service that provides everything needed for music streaming.","archived":false,"fork":false,"pushed_at":"2025-07-08T11:30:58.000Z","size":238,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T20:40:16.348Z","etag":null,"topics":["postgresql","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliwert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-15T21:17:07.000Z","updated_at":"2025-07-26T19:14:21.000Z","dependencies_parsed_at":"2025-04-10T23:23:05.041Z","dependency_job_id":"be58a76a-ab05-4cd1-967f-919a17eabdcd","html_url":"https://github.com/aliwert/sonic-nest","commit_stats":null,"previous_names":["aliwert/spotify-api","aliwert/track-stream","aliwert/sonic-nest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aliwert/sonic-nest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliwert%2Fsonic-nest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliwert%2Fsonic-nest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliwert%2Fsonic-nest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliwert%2Fsonic-nest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliwert","download_url":"https://codeload.github.com/aliwert/sonic-nest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliwert%2Fsonic-nest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32417969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgresql","spring-boot"],"created_at":"2025-03-19T23:16:43.214Z","updated_at":"2026-04-29T08:34:40.442Z","avatar_url":"https://github.com/aliwert.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sonic Nest API\n\n- Sonic Nest is a comprehensive REST API that mimics core like Spotify functionality, built with Spring Boot. It provides endpoints for managing music tracks, albums, artists, playlists, podcasts and more.\n\n## Database Diagram\n\n\u003cimg src=\"database/er-diagram.png\" alt=\"er-diagram\"\u003e\n\n## Technologies Used\n\n- Java\n- Spring Boot 3\n- Spring Security with JWT authentication\n- Spring Data JPA\n- PostgreSQL as the database\n- Lombok for reducing boilerplate code\n- Maven for dependency management\n- Postman for API testing\n\n## Database Structure\n\nThe application models a music streaming platform with the following key entities:\n\n- **User**: Authentication and account information\n- **Track**: Music tracks with metadata\n- **Album**: Collections of tracks\n- **Artist**: Music creators\n- **Playlist**: User-created collections of tracks\n- **Genre**: Music classifications\n- **Category**: Content groupings\n- **PlayerState**: User's current playback state\n- **Show**: Podcast shows\n- **Episode**: Individual podcast episodes\n- **Audiobook**: Audio book content\n- **Chapter**: Individual chapters of audiobooks\n- **Market**: Geographical regions for content availability\n\n## Getting Started\n\n**Prerequisites**\n\n- JDK 17+\n- PostgreSQL 12+\n- Maven 3.6+ (or use the included Maven wrapper)\n\n## Database Configuration\n\nDefault configuration in `application.properties`:\n\n```\nspring.datasource.url=\nspring.datasource.username=\nspring.datasource.password=\nspring.jpa.properties.hibernate.default_schema=\nspring.jpa.hibernate.ddl-auto=\n```\n\n## Running the Application\n\n**Using Maven**:\n\n```\nmvn spring-boot:run\n```\n\n**Or with the Maven wrapper:**\n\n```\n./mvnw spring-boot:run\n```\n\nThe application will be accessible at `http://localhost:8080`.\n\n## Docker Setup\n\nSonic Nest API can be easily deployed using Docker containers. This simplifies the setup process and ensures consistent environments across different systems.\n\n### Prerequisites\n\n- Docker Engine 19.03.0+\n- Docker Compose 1.27.0+\n\n### Docker Configuration\n\nThe project includes Docker configuration files:\n\n- `Dockerfile`: Defines how the application is built into a container image\n- `docker-compose.yml`: Orchestrates the application and database containers\n- `.dockerignore`: Specifies files that should be excluded from the Docker build\n\n### Running with Docker\n\n1. **Build and start the containers**:\n\n   ```bash\n   docker-compose up -d\n   ```\n\n   This will:\n\n- Build the Sonic Nest API application image\n- Start a PostgreSQL database container\n- Connect the application to the database\n- Make the API available at `http://localhost:8080`\n\n2. View Logs:\n   ```bash\n   docker-compose logs -f\n   ```\n3. Stop the containers:\n   ```bash\n   docker-compose down\n   ```\n\n## Authentication\n\nThe API uses JWT (JSON Web Token) for authentication:\n\n1. Register a new user:\n\n   - POST /api/v1/auth/register\n\n     - Request Body:\n       ```\n        {\n        \"username\": \"user\",\n        \"password\": \"password\"\n        }\n       ```\n\n2. Login:\n\n   - POST /api/v1/auth/authenticate\n\n     - Request Body:\n       ```\n        {\n        \"username\": \"user\",\n        \"password\": \"password\"\n        }\n       ```\n\n3. Using the token:\n\n   - Add the header:\n     `Authorization: Bearer {access_token}` to all API requests\n\n4. Refresh Token:\n\n   - POST /api/v1/auth/refreshtoken\n\n     - Request Body:\n       ```\n        {\n        \"username\": \"user\",\n        \"password\": \"password\"\n        }\n       ```\n\n# API Endpoints\n\n### Authentication\n\n- **POST** `/api/v1/auth/register` - Register a new user\n- **POST** `/api/v1/auth/authenticate` - Authenticate and get tokens\n- **POST** `/api/v1/auth/refreshtoken` - Refresh authentication token\n\n### Tracks\n\n- **GET** `/api/v1/tracks/list` - Get all tracks\n- **GET** `/api/v1/tracks/list/{id}` - Get track by ID\n- **POST** `/api/v1/tracks/create` - Create a track\n- **PUT** `/api/v1/tracks/update/{id}` - Update a track\n- **DELETE** `/api/v1/tracks/delete{id}` - Delete a track\n- **GET** `/api/v1/tracks/album/{albumId}` - Get tracks by album\n- **GET** `/api/v1/tracks/category/{categoryId}` - Get tracks by category\n- **POST** `/api/v1/tracks/{trackId}/categories/{categoryId}` - Add category to track\n- **DELETE** `/api/v1/tracks/{trackId}/categories/{categoryId}` - Remove category from track\n- **GET** `/api/v1/tracks/genre/{genreId}` - Get tracks by genre\n- **POST** `/api/v1/tracks/{trackId}/genres/{genreId}` - Add genre to track\n- **DELETE** `/api/v1/tracks/{trackId}/genres/{genreId}` - Remove genre from track\n\n### Albums\n\n- **GET** `/api/v1/albums/list` - Get all albums\n- **GET** `/api/v1/albums/list/{id}` - Get album by ID\n- **POST** `/api/v1/albums/create` - Create an album\n- **PUT** `/api/v1/albums/update/{id}` - Update an album\n- **DELETE** `/api/v1/albums/delete/{id}` - Delete an album\n\n### Artists\n\n- **GET** `/api/v1/artists/list` - Get all artists\n- **GET** `/api/v1/artists/list/{id}` - Get artist by ID\n- **POST** `/api/v1/artists/create` - Create an artist\n- **PUT** `/api/v1/artists/update/{id}` - Update an artist\n- **DELETE** `/api/v1/artists/delete/{id}` - Delete an artist\n\n### Playlists\n\n- **GET** `/api/v1/playlists/list` - Get all playlists\n- **GET** `/api/v1/playlists/list/{id}` - Get playlist by ID\n- **POST** `/api/v1/playlists/create` - Create a playlist\n- **PUT** `/api/v1/playlists/update/{id}` - Update a playlist\n- **DELETE** `/api/v1/playlists/delete/{id}` - Delete a playlist\n- **GET** `/api/v1/playlists/public` - Get all public playlists\n- **GET** `/api/v1/playlists/user/{userId}` - Get playlists by user\n- **POST** `/api/v1/playlists/{playlistId}/tracks/{trackId}` - Add track to playlist\n- **DELETE** `/api/v1/playlists/{playlistId}/tracks/{trackId}` - Remove track from playlist\n\n### Genres\n\n- **GET** `/api/v1/genres/list` - Get all genres\n- **GET** `/api/v1/genres/list/{id}` - Get genre by ID\n- **POST** `/api/v1/genres/create` - Create a genre\n- **PUT** `/api/v1/genres/update/{id}` - Update a genre\n- **DELETE** `/api/v1/genres/delete/{id}` - Delete a genre\n\n### Categories\n\n- **GET** `/api/v1/categories/list` - Get all categories\n- **GET** `/api/v1/categories/list/{id}` - Get category by ID\n- **POST** `/api/v1/categories/create` - Create a category\n- **PUT** `/api/v1/categories/update/{id}` - Update a category\n- **DELETE** `/api/v1/categories/delete/{id}` - Delete a category\n\n### Shows\n\n- **GET** `/api/v1/shows/list` - Get all shows\n- **GET** `/api/v1/shows/list/{id}` - Get show by ID\n- **POST** `/api/v1/shows/create` - Create a show\n- **PUT** `/api/v1/shows/update/{id}` - Update a show\n- **DELETE** `/api/v1/shows/delete/{id}` - Delete a show\n\n### Episodes\n\n- **GET** `/api/v1/episodes/list` - Get all episodes\n- **GET** `/api/v1/episodes/list/{id}` - Get episode by ID\n- **POST** `/api/v1/episodes/create` - Create an episode\n- **PUT** `/api/v1/episodes/update/{id}` - Update an episode\n- **DELETE** `/api/v1/episodes/delete/{id}` - Delete an episode\n\n### Audiobooks\n\n- **GET** `/api/v1/audiobooks/list` - Get all audiobooks\n- **GET** `/api/v1/audiobooks/list/{id}` - Get audiobook by ID\n- **POST** `/api/v1/audiobooks/create` - Create an audiobook\n- **PUT** `/api/v1/audiobooks/update/{id}` - Update an audiobook\n- **DELETE** `/api/v1/audiobooks/delete/{id}` - Delete an audiobook\n\n### Chapters\n\n- **GET** `/api/v1/chapters/list` - Get all chapters\n- **GET** `/api/v1/chapters/list/{id}` - Get chapter by ID\n- **POST** `/api/v1/chapters/create` - Create a chapter\n- **PUT** `/api/v1/chapters/update/{id}` - Update a chapter\n- **DELETE** `/api/v1/chapters/delete/{id}` - Delete a chapter\n\n### Player State\n\n- **GET** `/api/v1/player-states/list` - Get all player states\n- **GET** `/api/v1/player-states/list/{id}` - Get player state by ID\n- **POST** `/api/v1/player-states/create` - Create a player state\n- **PUT** `/api/v1/player-states/update/{id}` - Update a player state\n- **DELETE** `/api/v1/player-states/delete/{id}` - Delete a player state\n- **GET** `/api/v1/player-states/user/{userId}` - Get player state by user\n\n### Markets\n\n- **GET** `/api/v1/markets/list` - Get all markets\n- **GET** `/api/v1/markets/list/{id}` - Get market by ID\n- **POST** `/api/v1/markets/create` - Create a market\n- **PUT** `/api/v1/markets/update/{id}` - Update a market\n- **DELETE** `/api/v1/markets/delete/{id}` - Delete a market\n- **GET** `/api/v1/markets/code/{countryCode}` - Get market by country code\n\n### Podcasts\n\n- **GET** `/api/v1/podcasts/list` - Get all podcasts\n- **GET** `/api/v1/podcasts/list/{id}` - Get podcast by ID\n- **POST** `/api/v1/podcasts/create` - Create a podcast\n- **PUT** `/api/v1/podcasts/update/{id}` - Update a podcast\n- **DELETE** `/api/v1/podcasts/delete/{id}` - Delete a podcast\n- **POST** `/api/v1/podcasts/{podcastId}/categories/{categoryId}` - Add category to podcast\n- **DELETE** `/api/v1/podcasts/{podcastId}/categories/{categoryId}` - Remove category from podcast\n\n### Podcast Episodes\n\n- **GET** `/api/v1/podcast-episodes/list` - Get all podcast episodes\n- **GET** `/api/v1/podcast-episodes/list/{id}` - Get podcast episode by ID\n- **POST** `/api/v1/podcast-episodes/create` - Create a podcast episode\n- **PUT** `/api/v1/podcast-episodes/update/{id}` - Update a podcast episode\n- **DELETE** `/api/v1/podcast-episodes/delete/{id}` - Delete a podcast episode\n- **GET** `/api/v1/podcast-episodes/podcast/{podcastId}` - Get episodes by podcast ID\n\n### Payments\n\n- **GET** `/api/v1/payments/list` - Get all payments\n- **GET** `/api/v1/payments/list/{id}` - Get payment by ID\n- **GET** `/api/v1/payments/user/{userId}` - Get payments by user ID\n- **GET** `/api/v1/payments/transaction/{transactionId}` - Get payment by transaction ID\n- **GET** `/api/v1/payments/status/{status}` - Get payments by status (PENDING, COMPLETED, FAILED, REFUNDED, CANCELLED)\n- **POST** `/api/v1/payments/create` - Create a payment\n- **PUT** `/api/v1/payments/update/{id}` - Update a payment\n- **POST** `/api/v1/payments/process/{id}` - Process a payment (change status from PENDING to COMPLETED)\n- **POST** `/api/v1/payments/refund/{id}` - Refund a payment (change status from COMPLETED to REFUNDED)\n- **DELETE** `/api/v1/payments/delete/{id}` - Delete a payment\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliwert%2Fsonic-nest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliwert%2Fsonic-nest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliwert%2Fsonic-nest/lists"}