Back to projects

Musix-Backend

Cloud-native Go microservices backend for music streaming, powered by gRPC, Kubernetes, and full observability.

go

Go

postgresql

Postgres

kubernetes

kubernetes

elasticsearch

elastic search

amazonaws

AWS

graphql

GraphQL

grafana

grafana

Musix-Backend project

Musix-Backend

A cloud-native microservices backend engineered in Go for a music streaming platform.

Musix decouples core streaming domains—content ingestion, catalog indexing, user accounts, personalized preferences, and audio playback—into independent services communicating over HTTP and gRPC. Built for both rapid local development and production Kubernetes deployments via Helm, the platform integrates Elasticsearch for search, PostgreSQL for relational persistence, and Prometheus with Grafana for end-to-end observability.

Technology Stack

  • Backend & RPC: Go, gRPC
  • Containerization & Orchestration: Docker, Docker Compose, Kubernetes, Helm, Bash
  • Data & Search: PostgreSQL, Elasticsearch, Kibana (ELK / ECK Stack)
  • Observability: Prometheus, Grafana

Architecture

Musix follows a domain-driven microservices architecture where each service owns a specific capability and exposes HTTP and/or gRPC interfaces depending on latency and internal communication needs.

Services

ServiceProtocol / PortResponsibility
service-contentHTTP (3333)Content management and ingestion
service-catalogHTTP (3334)Music catalog indexing and discovery
service-userHTTP (3335) / gRPC (3336)User authentication, profiles, and internal user RPCs
service-userchoiceHTTP (3337) / gRPC (3001)User preferences, likes, playlists, and recommendation signals
service-playbackHTTP (3338)Audio streaming and playback session handling

Infrastructure & Observability

  • Elasticsearch & Kibana: Full-text music search, ingestion pipelines, and log exploration.
  • PostgreSQL: Primary relational data store for user accounts, preferences, and metadata.
  • Prometheus & Grafana: Metrics scraping, service health monitoring, and real-time performance dashboards.

Getting Started

Running the Full Stack (Docker Compose)

Start the entire application stack using the initialization script inside cmd:

cd cmd
./init up app

Loading Content into Elasticsearch

  1. Generate an API key from Elasticsearch and add it to your environment configuration files under envs/*.
  2. Execute the .http request files located in elastic/elastic-setup to initialize indices, ingestion pipelines, and sample catalog resources.

Local Development Setup

For active development on individual microservices without rebuilding containers:

  1. Boot up the Elasticsearch (ECK) infrastructure dependencies:
cd cmd
./init up eck
  1. Navigate to the target microservice directory and run it locally with live reloading using air:
air

Service Endpoints

Depending on your deployment environment, services are reachable via the following internal and external endpoints:

Host Machine (Local)

ServiceEndpoint
service-contenthttp://localhost:3333
service-cataloghttp://localhost:3334
service-userhttp://localhost:3335
service-user-grpctcp://localhost:3336
service-userchoicehttp://localhost:3337
service-playbackhttp://localhost:3338
elasticsearchhttp://localhost:9200
kibanahttp://localhost:5601
grafanahttp://localhost:3000
prometheushttp://localhost:9090

Docker Compose Network

ServiceInternal Endpoint
service-contenthttp://service-content:3000
service-cataloghttp://service-catalog:3000
service-userhttp://service-user:3000
service-user-grpcservice-user:3001
service-userchoicehttp://service-userchoice:3000
service-userchoice-grpchttp://service-userchoice:3001
elasticsearchhttp://elastic:9200
postgres-dbdb:5432
grafanahttp://grafana:3000
prometheushttp://prometheus:9090

Kubernetes Cluster (Helm / ECK)

ServiceCluster DNS
service-contenthttp://svc-content.default.svc.cluster.local
service-cataloghttp://svc-catalog.default.svc.cluster.local
service-userhttp://svc-user.default.svc.cluster.local
service-userchoicehttp://svc-userchoice.default.svc.cluster.local
elasticsearchhttps://elasticsearch-es-default.eck.svc.cluster.local:9200
postgres-dbpostgres-postgresql.default.svc.cluster.local:5432
grafanahttps://grafana.monitoring.svc.cluster.local
prometheushttps://prometheus.monitoring.svc.cluster.local