{"id":22441836,"url":"https://github.com/internet4000/radio4000","last_synced_at":"2025-08-01T18:32:55.761Z","repository":{"id":45176213,"uuid":"92039469","full_name":"internet4000/radio4000","owner":"internet4000","description":"public media library system, calm, non-intrusive","archived":false,"fork":false,"pushed_at":"2024-04-27T05:05:04.000Z","size":52965,"stargazers_count":44,"open_issues_count":37,"forks_count":18,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-27T15:59:55.174Z","etag":null,"topics":["ember","firebase-realtime-database","music","music-discovery","music-library"],"latest_commit_sha":null,"homepage":"https://radio4000.com","language":"JavaScript","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/internet4000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2017-05-22T10:06:36.000Z","updated_at":"2024-04-27T05:05:07.000Z","dependencies_parsed_at":"2023-10-11T17:58:39.592Z","dependency_job_id":"3384c1f7-4920-4c89-81c5-32c677e1b63f","html_url":"https://github.com/internet4000/radio4000","commit_stats":null,"previous_names":[],"tags_count":114,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internet4000%2Fradio4000","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internet4000%2Fradio4000/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internet4000%2Fradio4000/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/internet4000%2Fradio4000/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/internet4000","download_url":"https://codeload.github.com/internet4000/radio4000/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228397756,"owners_count":17913540,"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":["ember","firebase-realtime-database","music","music-discovery","music-library"],"created_at":"2024-12-06T02:16:27.435Z","updated_at":"2024-12-06T02:16:28.031Z","avatar_url":"https://github.com/internet4000.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Radio4000\n\nThis repository is the main website for Radio4000, web CMS for streamed media libraries \u0026rarr; https://radio4000.com.\n\nJoin the discussion about the evolution and the development of Radio4000 on \n[GitHub issues](https://github.com/internet4000/radio4000/issues) and the \n[#radio4000:matrix.org](https://riot.im/app/#/group/+radio4000:matrix.org) chat.\n\n## Presentation\n\nThis project aims at development and discussions on building a fair\nand open access ecosystem of tools and services; for music and\ncultural goods to be globally accessed and explored.\n\nThe goals and objectives of Radio4000 are defined in its\n[manifest](https://github.com/internet4000/publications/blob/master/radio4000-manifest.md).\n\nThe application in this repository is written in JavaScript, using the frontend framework\n[Ember.js](https://emberjs.com) for the client part of the\napplication. Ember Data is used for the local data store, and also to build the API calls.\n[Emberfire](https://github.com/firebase/emberfire) is used for its\nadapter and serializers to our Firebase database.\n\nThe server part is, for now, using Google's Firebase and the code can\nbe found on\nthe[radio4000-api](https://github.com/internet4000/radio4000-api)\nrepository.\n\nThe code for the music player used by this project can be found at \n[radio4000-player](https://github.com/internet4000/radio4000-player).\n\nThe plan is to move everything to libre software, self-hosted, with\ndecentralization in mind. It is not there yet and we would love\nassistance in architecture and development.\n\n## Using\n\nTo use Radio4000, you only have to visit\n[radio4000.com](https://radio4000.com), and start discovering new user\nselections.\n\nThe rest of this document will introduce some of the technical aspects\nof:\n- setting up and running an instance of Radio4000 (ex: radio3999.com)\n- developping features and fixing bugs for the Radio4000 project\n\n## Development\n\nSee the file [contributing](./CONTRIBUTING.md), for more information\non how to contribute to the project.\n\n### Pre-requisites\n\nTo start developing on this project (namely radio4000, radio4000-cms,\nr4-cms), you will have to:\n\n1. have [git setup](https://help.github.com/en/github/getting-started-with-github/set-up-git).\n2. have [npm setup (recommended install: nvm)](https://github.com/nvm-sh/nvm) with node version \u003c= 12\n3. have the npm package [yarn set up](https://yarnpkg.com); it is then used as an alternative\n   to npm in this project\n\nThen, clone this repository, install dependencies and start a development server:\n\n```\ngit clone git@github.com:internet4000/radio4000.git\ncd radio4000\nyarn\nyarn start\n```\n\nThe start command will launch the application locally, find it in your\nbrowser at http://localhost:4000.\n\nBy default this repository uses the `radio4000-staging` database. It\ncan also work with any other instance of Firebase Realtime database.\n\n### Testing\n\nRun `yarn test` for a single test or `yarn ember test --server` to start a test server.\n\nLint scripts with:\n\n* `yarn lint:js`\n* `yarn lint:js -- --fix`\n\n\n## Deployment of the production version (radio4000.com)\n\nThe site is hosted on Cloudflare pages and integrated with this git repository.\n\n- The `production` branch to https://radio4000.com ([request new deployment](https://github.com/internet4000/radio4000/compare/production...master?expand=1))\n\nIt usually takes ~2 minutes from git push to deployment is live.\n\nSee [contributing.md](https://github.com/internet4000/radio4000/blob/master/CONTRIBUTING.md) for more.\n\nSome times the Cloudflare Git integration doesn't trigger a deploy, then you can deploy manually as well:\n\n```\n# run locally\nnvm use 12\nyarn build\nwrangler pages deploy dist --project-name radio4000 --branch production\n```\n\n## Backend (api.radio4000.com)\n\nWe use Google's Firebase as our backend (database and API, on Google\nCloud Engine), as well as for authentication.\n\n\u003e Firestore is not supported. Plans are more leaning toward moving off\n\u003e Google's infrastructures.\n\n### Security Rules\n\nThe security rules defining what can be read, updated, written,\ndeleted, on each API endpoints are in the\n[radio4000-api](https://github.com/internet4000/radio4000-api)repository,\nin the `./database.rules.json` file.\n\n\u003e You will need to use this file to setup you database instance if you are\n\u003e running your instance of radio4000. In the Firebase Console of your\n\u003e project, under Datatbase \u003e Rules.\n\n### Running your own instance\n\nTo run your own firebase instance:\n\n1. on the [Firebase Console](https://console.firebase.google.com),\n   create new project, to get an instance of Firebase Realtime database.\n\n2. update the security rules of your project's database, as described\n   in the section above, [**Security**](./#Security Rules)\n\t \n3. If there you don't have an app already, create one of type `Web\nApp`. You can fin the values for your application, in your firebase\nproject's console, at `Settings \u003e Project Settings \u003e General \u003e Your\nApps`. This will provide us the Firebase API keys.\n\n### API Keys\n\nAdd your API keys to the CMS, in the file `./config/environment.js`\n\n#### Firebase keys\n\n- `apiKey` : `'your-api-key'`\n- `authDomain` : `'your-project.firebaseapp.com'`\n- `databaseURL` : `'your-project.firebaseio.com'`\n```\n\n\u003e You will have to update the following keys, for the default\n\u003e environment, as well as `production` depending on your objectives.\n\n## Authentication\n\nWe're using a combination of [Firebase\nAuthentication](https://firebase.google.com/products/auth/),\n[Torii](https://github.com/vestorly/torii) and\n[EmberFire](https://github.com/firebase/emberfire/blob/master/docs/guide/authentication.md)\nto handle authentication.\n\nTo access authentication in the Ember application, all routes and\ncontrollers come with the `session` service already injected.\n\nTo get the current user (model), do `this.get('session.currentUser')`. \n\nFor more on auth, check the folders `app/auth` and `app/torii-adapters` as well as the above links.\n\n## Firebase configuration\n\nLinks:\n- firebase project console: https://console.firebase.google.com\n- google cloud console (GCC) (\u003e credentials): https://console.cloud.google.com/apis/credentials\n\n\u003e At the moment, authentication can be enabled with `Email and\n\u003e Password`, `Google`, `Facebook`. Note that social providers\n\u003e authentication with Google and Facebook will be shutdown in future versions.\n\nFor authentication to work, you need to already have setup the\nFirebase keys in the file `radio4000/config/environment.js`\n\n### Email/password\n\n1. In your project's console, `Authentication \u003e Sign-in methods`, activate **Email/Password** (no\nneed of activating email-link).\n\n2. In the Google Cloud Console, create a new api key (name: `auth`)\n\n- Application restrictions: HTTP referrers\n- Website restriction: `https://your-domain.com/*` +\n  `https://your-project.firebaseapp.com/*`\n- API restriction (1): Identity Toolkit API\n\nYou should be done!\n\n#### Password reset link error\n\nThere has been issues with the reset link set to users asking for it\nthrough the cms interface (and it using the provided firebase sdk method). \n\n\u003e \"Your request to reset your password has expired or the link has\n\u003e already been used\".\n\nThe reset link has a parameter `apiKey=abcd` that might be using a\ndifferent key that the one configured in the cms. Be sure to find that\nkey in the google cloud console for your project, and add it: `API\nrestriction (1): Identity Toolkit API`. This key needs only access to\nthis one service.\n\n### oAuth2 social login\n\n#### Google\n\n1. In the Google cloud Console, create a new `OAuth 2.0 Client IDs`\n\nSet the settings to:\n- Authorized JavaScript origins: `https://your-domain.com`\n- Authorized redirect URIs: `https://your-domain.com` +\n  `https://your-project.firebaseapp.com/__/auth/handler`\n\t\nCopy, for the next step, the `Client ID` and `Client secret` values.\n\n2. In your project's console, `Authentication \u003e Sign-in methods`,\nactivate **Google**.\n\nUnder `Sign-in methods \u003e Google \u003e Web SDK configuration`, paste the\n**Client ID** and **Secret** you copied before; save.\n\n3. Check the oAuth Consent Screen section,\n   https://console.cloud.google.com/apis/credentials/consent\n\t \n- Scopes for Google APIs: only the default (and minimum...), don't\n  require anything else, it is already too much (email, profile, openID).\n- Authorized domains: `your-domain.com` +\n  `your-project.firebaseapp.com`\n\t\n\t\n#### Facebook\n\n1. On the Facebook for Developers site\n   (https://developers.facebook.com), get the **App ID** and an **App Secret**\n   for your app.\n\t \n2. On your Firebase project console, at `Authentication \u003e Sign-in\n   methodes \u003e Facebook`, **activate** Facebook, then paste in **App ID**\n   and **Secret**\n\n\n### Youtube API key\n\nFor automatic fetching of tracks title, you will need a Youtube API key.\n\nhttps://console.cloud.google.com/apis/credentials\n\n- Enable Youtube Data Api\n- Create a new key, and restrict it to Youtube Data Api\n- paste the key in `/config/environment.js`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finternet4000%2Fradio4000","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finternet4000%2Fradio4000","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finternet4000%2Fradio4000/lists"}