Personal music streaming server, built with Node.js and GraphQL.
Work in progress, nearing initial working prototype (i.e currently can stream music, though metadata is not parsed). Things that are already implemented include signing in/up/out, authentication, scanning for music files (+ a lot of backend groundwork).
I was a long time user of Plex for my media collection, however the interface is woeful for music in my opinion, it is proprietary, and the company has a poor direction. Jellyfin/Emby is not really designed with music in mind as well.
That's my justification for starting this project, I may not finish it but we'll see.
The following is the current tech stack for the project, frontend unfinished comparatively thus will likely change / grow.
Backend: Node.js, Typedi, Type-GraphQL w/ Apollo, Express, Better-sqlite3, TypeScript, Webpack. Frontend: React, MobX, Apollo, React-Router, TypeScript, Webpack.
-
Install dependencies
You will need to have the build dependencies installed, these include
npm
,nodejs
,webpack
,node-gyp
andgcc
(used to build better-sqlite3).# Install webpack globally (may require root privileges) $> npm install -g webpack $> npm install && cd frontend/ && npm install
-
Run build
Acceptable scripts are:
[ build, build:front, build:back ]
, while the second argument is the mode:[ dev, prod, release ]
. See build details for more details. Here is the recommended command for most users:# See #modes for information on the difference # between release and dev / prod. $> npm run build release
-
Make sure you have the runtime dependencies installed, these include
nodejs
(tested with version ^13.9.0). -
See build details - modes for information on what directories the application will use for runtime data, as it depends on what mode was used at build (e.g release / dev).
# alternatively: `$> ./build/go-music [ARGS]` $> npm run start -- [ARGS]
That's it! You can supply arguments such as --config. Run with --help for more information.
When developing there is the frontend dev server (uses webpack-dev-server). This is intended for working on the frontend without needing to build the backend every time, as well as live reloading of changes. You can run it like so:
# runs dev server on port + 1 $> npm run start:devServer
When running the frontend dev server you will likely still need to run the backend api for it to pull data from:
# disables serving of frontend by Express, only exposes /api. # alternatively: `$> ./build/go-music --api-only` $> npm run start:apiOnly
-
There are three main scripts you may want to run,
build
,build:front
, andbuild:back
. End users looking to just build & run the application should only needbuild
.build [MODE]:
Build both the frontend and backend components.build:front [MODE]:
Build the frontend but not the backend.build:back [MODE]:
Build the backend but not the frontend. The frontend should be built prior to running this, unless running the frontend withstart:front
.
-
[ dev (default), prod, release ]
The
MODE
option is used to enable/disable optimizations and change the application directory structure & paths. Thedev
andprod
modes are the same, exceptprod
enables Webpack optimization. Application runtime data will be stored in the ./build/runtime/ directory.If
release
is used, application runtime data will be stored in XDG user directories, such as ~/.config/go-music/ and ~/.local/share/go-music/.