{"id":21894221,"url":"https://github.com/bernmic/go2music","last_synced_at":"2025-10-12T17:40:42.273Z","repository":{"id":40302111,"uuid":"143598038","full_name":"bernmic/go2music","owner":"bernmic","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-20T09:57:02.000Z","size":38440,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-20T11:28:03.888Z","etag":null,"topics":["angular","angularmaterial","docker"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/bernmic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-08-05T09:00:46.000Z","updated_at":"2025-07-20T09:57:05.000Z","dependencies_parsed_at":"2024-12-09T09:18:53.735Z","dependency_job_id":"3b226c57-0638-46be-91aa-1ff7930b58bf","html_url":"https://github.com/bernmic/go2music","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bernmic/go2music","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernmic%2Fgo2music","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernmic%2Fgo2music/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernmic%2Fgo2music/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernmic%2Fgo2music/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bernmic","download_url":"https://codeload.github.com/bernmic/go2music/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernmic%2Fgo2music/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012191,"owners_count":26085079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["angular","angularmaterial","docker"],"created_at":"2024-11-28T13:20:19.546Z","updated_at":"2025-10-12T17:40:42.243Z","avatar_url":"https://github.com/bernmic.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go2Music\n\nSimple project for first Go experiences.\nIt is a REST service with a database as backend. At this point, it can scan filesystem after MP3 files, read the metadata (id3v2) and store the data normalized in the database. After that it can deliver songs, albums and artists via REST calls.\nIt can also stream existing songs via http and serve existing covers.\n\nFor better organization, it supports playlists. There are manually created playlists and dynamic playlists which collects songs with a query. Simple Golang expressions (eg. album==\"True\") are supported.\n\nThere is a Dockerfile to create the smallest possible docker image and a docker-compose.yml to setup the complete app with a MySQL database.\n\n## build\n\nClone this repository go to the cloned sources and run:\n\n    go get ./...\n    go build .\n\nThis will build the go2music executable.\n\n## run\n\nThe executable can be started without any parameters. It tries to read the go2music.yaml where all configuration can be done. It supports also some environment variables:\n\n| Environment variable     | Description                                       |\n|--------------------------|---------------------------------------------------|\n| GO2MUSIC_MEDIAPATH       | Path to the media library                         |\n| GO2MUSIC_DBUSERNAME      | database user (default go2music)                  |\n| GO2MUSIC_DBPASSWORD      | database password (default go2music)              |\n| GO2MUSIC_DBSCHEMA        | database schema (default go2music)                |\n| GO2MUSIC_DBURL           | URL to the database                               |\n| GO2MUSIC_DBTYPE          | Type of database (mysql or postgres)              |\n| GO2MUSIC_BULK_INSERT     | use bulk inserts to database (true or false)      |\n| GO2MUSIC_METRICS_COLLECT | collect metric for Prometheus (true or false)     |\n| GO2MUSIC_TAGGINGPATH     | path to files to be tagged                        |\n| GO2MUSIC_TOKENSECRET     | secret for encrypting JWT                         |\n| GO2MUSIC_CORS            | add CORS middleware (all or direct)               |\n| GO2MUSIC_CONFIG          | path to the go2music.yaml config file (default .) |\n\nThey do the same than the parameters in de go2music.yaml\n\n## Database\n\nSupported databases are\n* MySQL 8.0+ for full support)\n* MariaDB\n* PostgreSQL\n* CockroachDB\n\nMariaDB and MySQL are fully tested. The other not. There is a db-create.sql in database-scripts which create the database and user for a MySQL or MariaDB and PostgreSQL.\nMariaDB can be used with database type 'mysql'.\n\n## Docker\n\nThe Dockerfile works in two steps. The first step will build the executable, the second step creates the image from scratch.\nThe docker-compose.yml can build the go2music image and creates the container for MySQL and go2music and links them together.\n\n## Frontend\n\nThere is a complete web frontend for go2music in the frontend folder. It is a single page application written in typescript with Angular and Angular Material. You can build this in the frontend folder.\n```\nng build -c production\n```\nThis will build the frontend and copy the result to assets/front folder.\n\n## Dynamic playlists\nDynamic playlists have an expression which will be converted into a SQL where clause.\nStrings have to be in double quotes. Numbers are not quoted. Parenthesis are supported. Wildcards can be used in strings. '*' means zero or more character. '?' means exact one character.\n\n### Fields in queries\n| field    | description                    | type   |\n|----------|--------------------------------|--------|\n| album    | title of the album             | string |\n| artist   | name of the artist             | string |\n| song     | title of the song              | string |\n| genre    | genre of the song              | string |\n| duration | duration of the song (seconds) | number |\n| year     | year the song was published    | string |\n| rating   | rating of the song (0-255)     | number |\n| track | track number on album             | number |\n| path | path where the song is stored      | string |\n| bitrate | bitrate of the song             | number |\n| samplerate | samplerate of the song       | number |\n\n### Logical operators\n| operator | description     |\n|----------|-----------------|\n| ==       | equal           |\n| !=       | not equal       |\n| \u003e=       | equal or higher |\n| \u003c=       | equal or lower  |\n| \\\u003e       | higher          |\n| \u003c        | lower           |\n| \\|\\| | logical OR |\n| \u0026\u0026 | logical AND |\n\n### Examples\n- artist==\"ABBA\"\n- artist==\"Edguy\" || artist==\"Avantasia\"\n- album==\"Bravo\\*Hits\\*\"\n- artist==\"Nightwish\" \u0026\u0026 year\u003e=\"2013\"\n\n## Next steps\n\n- bind artists, albums, songs to a musicbrainz id\n- bring playcount and rating to the frontend\n- Rewrite authentication and authorization.\n- reduce dependencies in go.mod\n- rewrite frontend with latest Angular and put it in a separate repo\n- ~~Bulk-Insert~~\n- SQlite support (https://pkg.go.dev/modernc.org/sqlite)\n\n[Jetbrains](https://www.jetbrains.com/?from=go2music) supports this project with GoLand/IntelliJ Idea licenses. We appreciate their support for free and open source software!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernmic%2Fgo2music","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbernmic%2Fgo2music","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernmic%2Fgo2music/lists"}