Skip to content

MalauD/MopRs

Repository files navigation

MopRs

An awesome deezer client !

build status

Demo

About the Project

This is deezer client providing multiple features like having multiple users, music trends, related musics, making playlists and much more !

Tech Stack

Client
Server
Database
DevOps

Features

  • Creating playlists
  • Suggestion to complete playlists
  • Trending musics
  • Mobile app: MopMobile

Getting Started without Kubernetes

Prerequisites

You will need the following software:

  • MinIO instance running
  • MongoDB database running
  • Redis server running
  • Meilisearch instance running

Environment variables description

You can store your environment variables in the .env file. Here is a quick overview of all env variables available:

Variable Description Default
S3_URL Url used to connect to s3
S3_REGION Region of s3 bucket ``
S3_BUCKET Bucket name
ARL Arl token used to download music from deezer
MONGO_URL Url used to connect to mongo database
REDIS_SERVICE_HOST Address used to connect to redis
REDIS_SERVICE_PORT Port for redis connection
REDIS_PASSWORD Password in case redis is secured
REDIS_USERNAME Username in case redis is secured
MEILISEARCH_HOST Address to meilisearch instance
MEILISEARCH_API_KEY Key to access meilisearch instance
SESSION_KEY Key used for cookie generation Generated at each start
SESSION_DURATION Duration of user session (s) 3600\*24\*7
ARTIST_UPDATE_INTERVAL Specify interval at which an artist top tracks, related.. is updated (s) 3600
ARTIST_SCRAPE_UPDATE_INTERVAL Same as above but for the scraper (s) 3600\*24\*3
ARTIST_SCRAPE_COOLDOWN Cooldown used to not overflow deezer api (ms) 100
ARTIST_PERIODIC_SCRAPE_CHECK_INTERVAL Interval at which all artists in db are checked to be updated or not (s) 60*30
ARTIST_PERIODIC_SCRAPE_UPDATE_INTERVAL Same as ARTIST_UPDATE_INTERVAL but for periodic scraping (s) 3600*24*7

Installation

Transpile MopRs client

  npm install
  npx webpack --mode production

Compile MopRs server

  cargo build --release

Run MopRs server

  cargo run --release

Your app should be available at 8080

Getting Started with Kubernetes

Prerequisites

You will need the following software:

  • Kubernetes
  • MongoDB operator running on Kubernetes

Installation

Install redis on cluster

First install redis operator using

helm upgrade redis-operator ot-helm/redis-operator --install --namespace default

Then install redis standalone

helm upgrade redis ot-helm/redis --install --namespace default  -f .kube/redis_values.yaml

And finally install meilisearch

helm upgrade -i mop-meilisearch meilisearch/meilisearch -f .kube/meilisearch_values.yaml

Applying yaml files

You will just need to apply .yaml files in .kube directory

  kubectl apply -f .kube

Your app should be available at 80

Setup cluster monitoring

You can monitor your cluster using grafana & prometheus by doing the following operations

kubectl create namespace monitoring
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus prometheus-community/kube-prometheus-stack --namespace monitoring

To access prometheus use

sudo kubectl port-forward svc/prometheus-kube-prometheus-prometheus -n monitoring 9090

and for grafana

sudo kubectl port-forward svc/prometheus-grafana -n monitoring 3000:80

Contributing

Contributions are always welcome!

Do not hesitate to start a pull request !

Code of Conduct

Please read the Code of Conduct

License

Distributed under the no License. See LICENSE for more information.