Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ soonic Public

self-hosted web music library/player built with Symfony

License

Notifications You must be signed in to change notification settings

frian/soonic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

198 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soonic

Symfony 8 application for local music playback (library, playlists, radios, audio file scanning).

Requirements

  • PHP >= 8.4
  • Composer 2
  • Node.js + npm
  • MariaDB/MySQL (recommended)

Installation

composer install
npm install

Configure local environment values in .env.local (not committed), especially:

  • DATABASE_URL (dev database, e.g. soonic)
  • DEFAULT_URI (e.g. http://127.0.0.1:8000)

Example:

APP_ENV=dev
DATABASE_URL="mysql://user:[email protected]:3306/soonic?serverVersion=11.8.3-MariaDB&charset=utf8mb4"
DEFAULT_URI="http://127.0.0.1:8000"

Database

Initialize with migrations:

php bin/console doctrine:migrations:migrate
php bin/console doctrine:fixtures:load --no-interaction

Or run a full reset with the project command:

php bin/console soonic:reset --force

Notes:

  • in dev, soonic:reset refuses to run unless DATABASE_URL points to soonic
  • in test, it requires soonic_test

Run the Application

symfony server:start

SCSS / Frontend

Build CSS:

npm run build:scss

Watch mode:

npm run build:scss:watch

Lint SCSS:

npm run lint:scss

Business Commands

Scan library:

php bin/console soonic:scan

Add one radio:

php bin/console soonic:add:radio "Radio Name" "https://stream.example/live" "https://site.example"

Import radios from .csv or .m3u:

php bin/console soonic:add:radios path/to/radios.csv
php bin/console soonic:add:radios path/to/radios.m3u --format=m3u
php bin/console soonic:add:radios path/to/radios.csv --dry-run

Tests

Run all project checks:

bin/check

Fast mode (without PHPUnit suites):

bin/check --fast

CI mode (no DB checks, no PHPUnit suites):

bin/check --ci

PHPUnit suites:

php bin/phpunit --testsuite no-music
php bin/phpunit --testsuite with-music
php bin/phpunit --testsuite scan

Important notes:

  • with-music prepares its own test DB and injects a dedicated music dataset
  • tests run with APP_ENV=test and target soonic_test
  • controller suites rebuild the test database before seeding (drop/create/schema/fixtures)

Quality / Lint Commands

composer validate --no-check-publish
vendor/bin/phpstan analyse --configuration=phpstan.neon.dist
php bin/console lint:twig templates
php bin/console lint:yaml config
php bin/console lint:container
php bin/console doctrine:schema:validate
php bin/console doctrine:migrations:status

CI

A GitHub Actions workflow is available in .github/workflows/ci.yml. It runs dependency installation and bin/check --ci on pushes and pull requests.

License

This project is licensed under the MIT License. See LICENSE.

Useful Project Structure

  • src/Controller: HTTP controllers
  • src/Command: console commands (soonic:*)
  • src/Entity / src/Repository: domain model and DB access
  • templates: Twig views
  • assets/styles: SCSS sources
  • public/js: frontend scripts
  • tests: PHPUnit suites

About

self-hosted web music library/player built with Symfony

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors