{"id":14007151,"url":"https://github.com/fwcd/bassment","last_synced_at":"2025-04-14T03:34:00.642Z","repository":{"id":53855012,"uuid":"457749200","full_name":"fwcd/bassment","owner":"fwcd","description":"Music library server with support for playlists, crates and a web/mobile frontend","archived":false,"fork":false,"pushed_at":"2023-07-08T09:56:36.000Z","size":2749,"stargazers_count":10,"open_issues_count":52,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-26T01:33:00.098Z","etag":null,"topics":["actix-web","crates","dj","music","music-library","playlists","react-native-web","server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fwcd.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}},"created_at":"2022-02-10T11:20:08.000Z","updated_at":"2024-08-10T10:04:00.950Z","dependencies_parsed_at":"2024-08-10T10:14:15.146Z","dependency_job_id":null,"html_url":"https://github.com/fwcd/bassment","commit_stats":{"total_commits":529,"total_committers":2,"mean_commits":264.5,"dds":0.007561436672967825,"last_synced_commit":"be70ceda412e7f8a9cb4fcfeab382c83c2c63462"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fbassment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fbassment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fbassment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fbassment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwcd","download_url":"https://codeload.github.com/fwcd/bassment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248815599,"owners_count":21165953,"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","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":["actix-web","crates","dj","music","music-library","playlists","react-native-web","server"],"created_at":"2024-08-10T10:01:51.882Z","updated_at":"2025-04-14T03:34:00.623Z","avatar_url":"https://github.com/fwcd.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Bassment\n\n[![Build](https://github.com/fwcd/bassment/actions/workflows/build.yml/badge.svg)](https://github.com/fwcd/bassment/actions/workflows/build.yml)\n[![Frontend](https://github.com/fwcd/bassment/actions/workflows/frontend.yml/badge.svg)](https://github.com/fwcd/bassment/actions/workflows/frontend.yml)\n\nMusic library server with support for playlists, crates and more.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg alt=\"Icon\" src=\"icons/icon-rounded.svg\" width=\"100\"\u003e\n\n  \u003cimg src=\"screenshots/web.png\" width=\"1074\"\u003e\n\u003c/div\u003e\n\n## Repository Structure\n\nBassment primarily consists of two components:\n\n- The backend server, written in Rust (using `actix-web` and `diesel`), located in the repository root.\n- The frontend, written in TypeScript (using `react-native`, targeting Web, iOS and Android), located in the `frontend` folder.\n\nWhile the backend server can serve the frontend from `frontend/dist` (after building and bundling it with Webpack), it can also run in API-only mode and independently (with `--api-only`).\n\n## Getting Started\n\n### Backend\n\nTo develop the backend server, make sure to have a Rust toolchain and PostgreSQL installed (the latter also running). Create a database and make sure that the `pgcrypto` extension is enabled (within the database). With sufficient privileges, you can enable it from `psql your_db_name` using\n\n```sql\nCREATE EXTENSION pgcrypto;\n```\n\nCreate a database and a `.env` file in this repo that points to the database:\n\n```\nDATABASE_URL=postgres://your_username:your_password@localhost/your_db_name\n```\n\nTo start the server, run\n\n```sh\nscripts/run-dev-backend\n```\n\nBy default, the server will run on `http://localhost:8090` in API-only mode and allow CORS requests (to permit requests from a frontend dev server running in parallel).\n\n\u003e You can of course also use `cargo run` manually. Note that the default configuration is more geared towards production use, however, therefore check out `cargo run -- --help` to view the list of flags.\n\nOn the first run, the server will automatically run all of the migrations and generate a root user, whose password is output to the console. If, at any point, you wish to regenerate this root user, pass `--regenerate-root` to the server.\n\n\u003e Note that the Diesel CLI, which can be installed using `cargo install diesel_cli --no-default-features --features postgres` (see [here](https://diesel.rs/guides/getting-started)), might also be useful. The Diesel CLI lets you e.g. run migrations with `diesel migration run` and undo them with `diesel migration revert`.\n\nSince all API routes are gated behind authentication (you need to log in via `/auth/v1/login`), it can sometimes be cumbersome to manually copy-and-paste tokens to `curl` while developing. Therefore the server also supports the flag `--allow-unauthenticated-access` for disabling authentication (obviously do not use this production):\n\n```sh\nscripts/run-dev-backend --allow-unauthenticated-access\n```\n\nWe can verify that this works correctly by sending a simple API request with `curl`:\n\n```sh\ncurl -i http://localhost:8090/api/v1/tracks\n```\n\n```\nHTTP/1.1 200 OK\ncontent-length: 2\naccess-control-expose-headers: host, user-agent, accept\nvary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers\naccess-control-allow-credentials: true\ncontent-type: application/json\ndate: Sun, 08 May 2022 19:42:42 GMT\n\n[]\n```\n\n### Frontend\n\nTo develop the frontend, you can either use `npm` in the `frontend` directory directly or the convenience scripts mentioned in the following paragraphs from the repository root.\n\nFirst, make sure to have the npm dependencies installed:\n\n```sh\nscripts/bootstrap-frontend\n```\n\nNow you can run the frontend with a dev server on `http://localhost:8080` (you probably want to have the backend running in API-only mode simultaneously for it to do anything useful):\n\n```sh\nscripts/run-dev-frontend\n```\n\nTo bundle the frontend for production use into `frontend/dist`, run\n\n```sh\nscripts/bundle-frontend\n```\n\nYou can then run the backend server, now also serving the frontend, with vanilla `cargo run` and visit the entire web application at `http://localhost:8090` in your browser.\n\n\u003c!-- TODO: Add instructions for mobile --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fbassment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwcd%2Fbassment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fbassment/lists"}