MusicMash is an API that lets you search for music across Spotify, SoundCloud and YouTube from a single endpoint.
- Setting up and running
- Environment variables example
- API Documentation
- Features
- Bugs and feature requests
- Contribution
- License
- Contributors
-
Create a virtual environment using a virtual environment tool of your choice, e.g.
nodeenv .env
orvirtualenv .env
-
Activate the new environment
source .env/bin/activate
-
Load the .envvars file with variables
source .envvars
-
Install the required dependencies
npm install
oryarn install
-
Finally, run the server with the following command
npm start
oryarn start
docker build -t musicmash-api .
docker run -d \
--name musicmash-api \
--env-file .env.list \
-p 8080:80 \
-p 8080:443 \
musicmash-api
MongoDB and the API
Create data folder for Mongo
sudo mkdir -p /musicmash/data/datadir
Run MongoDB
docker run -d \
--name musicmash-mongo \
-v /musicmash/data/datadir:/data/db \
--expose 27017 \
mongo --auth
docker build -t musicmash-api .
docker run -d \
--name musicmash-api \
--env-file .env.list \
-p 8080:80 \
-p 8080:443 \
--link musicmash-mongo:mongo \
musicmash-api
With NGINX proxy, automatic Let's Encrypt certificate creation/renewal, MongoDB and the API
NGINX Proxy See here for full reference on usage
docker run -d -p 80:80 -p 443:443 \
--name musicmash-nginx-proxy \
-v $HOME/certs:/etc/nginx/certs:ro \
-v /etc/nginx/vhost.d \
-v /usr/share/nginx/html \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy \
jwilder/nginx-proxy
LetsEncrypt NGINX companion See here for full reference on usage
docker run -d \
--name musicmash-nginx-letsencrypt \
-v $HOME/certs:/etc/nginx/certs:rw \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--volumes-from musicmash-nginx-proxy \
jrcs/letsencrypt-nginx-proxy-companion
*Optional to run in Docker, but a database is required for the API to work Create data folder for Mongo
sudo mkdir -p /musicmash/data/datadir
Run MongoDB
docker run -d \
--name musicmash-mongo \
-v /musicmash/data/datadir:/data/db \
--expose 27017 \
mongo --auth
docker build -t musicmash-api .
docker run -d \
--name musicmash-api \
--env-file .env.list \
-e 'VIRTUAL_HOST=sub.domain.com' \
-e 'LETSENCRYPT_HOST=sub.domain.com' \
-e 'LETSENCRYPT_EMAIL=you@domain.com' \
-p 8080:8080 \
--link musicmash-mongo:mongo \
musicmash-api
Templates can be found in the files .envvars.example
and .env.list.example
(for Docker)
SPOTIFY_ID=app_id
SPOTIFY_SECRET=secret
SOUNDCLOUD_ID=app_id
YOUTUBE_KEY=api_key
HOST=localhost
PORT=8080 // Port to run the server on
NODE_ENV=production
APP_SECRET=super secret phrase // Used by JWT
MONGO_HOST=mongo // If using Dockerized mongo, use the alias specified when running the container.
MONGO_PORT=27017
MONGO_USERNAME=user
MONGO_PASSWORD=secret
MONGO_DATABASE=musicmash
API docs are hosted with Postman here
Coming soon! In the meantime, see the API documentation
I would love your help in the development of MusicMash. Please follow the guidelines on Contribution on how to report bugs and request features you'd like to see, in addition to how you can contribute with development. By following these guidelines, we make sure that communication is efficient and understandable, which will hopefully help to improve the project.
If you want to submit a feature request or bug, please keep this in mind:
- Stay on topic, both regarding the request/bug itself and any discussion around it.
- Please avoid opening issues if it involves lines of code you do not understand.
Definition of a bug: A bug is an error, fault or failure in the application which is caused by the sourcecode found in this repository, which results in an incorrect or unexpected result.
I appreciate feedback of any sort, and it helps me in developing a great service and growing as a developer. Thank you!
- Please browse the issue tracker before you submit a bug or feature, to avoid duplicate entries.
- Before submitting, make sure to pull the latest version to check if the bug is fixed, or feature is implemented.
- Stick to ONE bug per issue.
Short description of what happened
Description
Expected behaviour
Description
Actual Behaviour
Description
Steps to reproduce
Description
Your enviroment
Operative system and version, Node Version, [Docker version], and any other information of relevance
I'm open to suggestions for new features, but please keep in mind that it should be of relevance to this project.
Including details when submitting feature requests is essential. It makes it easier for the developers to understand the request.
- Please include documentation on all code submitted
- If a new feature is implemented, it should be explained in detail in the Wiki
Developed by: Morten Amundsen (@mortea15)